Fix LocationManagerTest#testGpsStatusListener test failure on
fugu/molly/MTK boards. It is originally caused by what seems to be a present bug in android.location.LocationManager API where it does not throw a SecurityException under the condition that the app does not have a permission to ACCESS_FINE_LOCATION when it should according to our API specs This CL adds a workaround to the bug by also considering the return value of <LocationManager>.addGpsStatusListener method: Return true if the listener was successfully added, and not just depend on a SecurityException, which does not get thrown due to the bug. Tested with Fugu, Molly, SONY/MTK CVT board, Nexus 5 and they all get PASS (expected) as a result of the change. Bug: 17759639 Change-Id: Ibadb3ae1eea3ab35ded9ebd38a684808e06b9d56 (cherry picked from commit 05f97cc3)
Loading
Please sign in to comment