From 7253f5b09e413ef68a371ee3cdaa28816d6a776d Mon Sep 17 00:00:00 2001 From: Matthew Finkel Date: Wed, 11 Apr 2018 17:52:59 +0000 Subject: [PATCH] Bug 25741 - TBA: Conditionally require WIFI and NETWORK permissions Only require the {ACCESS,CHANGE}_WIFI_STATE and ACCESS_NETWORK_STATE permissions if MOZ_ANDROID_NETWORK_STATE is defined in the preprocessor. Also: 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). Bug 25741 - TBA: Move CAMERA permission within MOZ_WEBRTC Require the CAMERA permissions if MOZ_WEBRTC is defined in the preprocessor. Bug 25741 - TBA: Only include GCM permissions if we want them Bug 26826 - Disable tab queue and delete SYSTEM_ALERT_WINDOW permission Bug 24796 - Comment out excess permissions from GeckoView The GeckoView AndroidManifest.xml is not preprocessed unlike Fennec's manifest, so we can't use the ifdef preprocessor guards around the permissions we do not want. Commenting the permissions is the next-best-thing. --- .../src/main/res/xml/preferences_general.xml | 1 + .../res/xml/preferences_general_tablet.xml | 1 + .../base/FennecManifest_permissions.xml.in | 18 +++++++++++++---- .../geckoview/src/main/AndroidManifest.xml | 20 ++++++++++++++++--- mobile/android/moz.configure | 8 ++++++++ ...xAccountAndroidManifest_permissions.xml.in | 2 ++ mobile/android/torbrowser.configure | 3 +++ 7 files changed, 46 insertions(+), 7 deletions(-) diff --git a/mobile/android/app/src/main/res/xml/preferences_general.xml b/mobile/android/app/src/main/res/xml/preferences_general.xml index f148ae61b169d..ef739db0c3d81 100644 --- a/mobile/android/app/src/main/res/xml/preferences_general.xml +++ b/mobile/android/app/src/main/res/xml/preferences_general.xml @@ -31,6 +31,7 @@ diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index f3e43bb4e3caf..796e28777aad4 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -8,14 +8,23 @@ them during the same release, which should be Fennec 48. Therefore we decouple the push permission from MOZ_ANDROID_GCM to let it ride ahead (potentially) of the push feature. --> + +#ifdef MOZ_ANDROID_GCM #include GcmAndroidManifest_permissions.xml.in +#endif #include SamsungAppStoreManifest_permissions.xml.in +#ifdef MOZ_ANDROID_NETWORK_STATE + +#endif + +#ifdef MOZ_ANDROID_LOCATION +#endif #ifdef MOZ_ANDROID_MLS_STUMBLER @@ -25,7 +34,9 @@ +#ifdef MOZ_ANDROID_LOCATION +#endif @@ -34,13 +45,12 @@ #endif +#ifdef MOZ_ANDROID_LOCATION +#endif - - - @@ -55,10 +65,10 @@ -#endif +#endif diff --git a/mobile/android/geckoview/src/main/AndroidManifest.xml b/mobile/android/geckoview/src/main/AndroidManifest.xml index a14bb6b1750e7..0d93ee53ee4b3 100644 --- a/mobile/android/geckoview/src/main/AndroidManifest.xml +++ b/mobile/android/geckoview/src/main/AndroidManifest.xml @@ -2,20 +2,32 @@ + + + + + + + + + + +#ifdef MOZ_ANDROID_NETWORK_STATE +#endif diff --git a/mobile/android/torbrowser.configure b/mobile/android/torbrowser.configure index 5e3ab67dca6a9..ac30fde888a62 100644 --- a/mobile/android/torbrowser.configure +++ b/mobile/android/torbrowser.configure @@ -41,3 +41,6 @@ imply_option('MOZ_SERVICES_HEALTHREPORT', False) # them here, as well. #imply_option('MOZ_TELEMETRY_REPORTING', False) #imply_option('MOZ_DATA_REPORTING', False) + +imply_option('MOZ_ANDROID_NETWORK_STATE', False); +imply_option('MOZ_ANDROID_LOCATION', False); -- GitLab