commit a549bf2a62b4a84eaf1326436a6e899d9d156572 Author: Matthew Finkel Matthew.Finkel@gmail.com Date: Wed Apr 11 18:07:25 2018 +0000
Bug 25741 - TBA: Conditionally require *_LOCATION permissions
Only require the {FINE,COURSE}_LOCATION permissions if MOZ_ANDROID_LOCATION is defined in the preprocessor. Also include location features (with gps). --- mobile/android/base/FennecManifest_permissions.xml.in | 5 +++++ mobile/android/geckoview/src/main/AndroidManifest.xml | 2 ++ mobile/android/moz.configure | 4 ++++ mobile/android/torbrowser.configure | 1 + 4 files changed, 12 insertions(+)
diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index 747f1e988147..25c4b4f215d5 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -13,8 +13,11 @@ <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> #endif + +#ifdef MOZ_ANDROID_LOCATION <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> +#endif <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> @@ -30,8 +33,10 @@ <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> #endif
+#ifdef MOZ_ANDROID_LOCATION <uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location.gps" android:required="false"/> +#endif <uses-feature android:name="android.hardware.touchscreen"/>
<!-- Tab Queue --> diff --git a/mobile/android/geckoview/src/main/AndroidManifest.xml b/mobile/android/geckoview/src/main/AndroidManifest.xml index 2a84ae4611ad..da1508336d90 100644 --- a/mobile/android/geckoview/src/main/AndroidManifest.xml +++ b/mobile/android/geckoview/src/main/AndroidManifest.xml @@ -18,8 +18,10 @@ <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/>
+#ifdef MOZ_ANDROID_LOCATION <uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location.gps" android:required="false"/> +#endif <uses-feature android:name="android.hardware.touchscreen"/>
<uses-permission android:name="android.permission.CAMERA" /> diff --git a/mobile/android/moz.configure b/mobile/android/moz.configure index 468ec4723632..7033d4283211 100644 --- a/mobile/android/moz.configure +++ b/mobile/android/moz.configure @@ -189,3 +189,7 @@ def check_android_gcm(android_gcm, project_flag('MOZ_ANDROID_NETWORK_STATE', help='Include permission for accessing WiFi/network state on Android', default=False) + +project_flag('MOZ_ANDROID_LOCATION', + help='Include permission for accessing fine and course-grain Location on Android', + default=False) diff --git a/mobile/android/torbrowser.configure b/mobile/android/torbrowser.configure index 3e84355774d5..ac30fde888a6 100644 --- a/mobile/android/torbrowser.configure +++ b/mobile/android/torbrowser.configure @@ -43,3 +43,4 @@ imply_option('MOZ_SERVICES_HEALTHREPORT', False) #imply_option('MOZ_DATA_REPORTING', False)
imply_option('MOZ_ANDROID_NETWORK_STATE', False); +imply_option('MOZ_ANDROID_LOCATION', False);
tbb-commits@lists.torproject.org