Bug 995407 - Revert enabling wifi and cell tower data reporting on release builds. r=mfinkle, a=sledru
authorBrad Lassey <blassey@mozilla.com>
Thu, 12 Jun 2014 18:20:28 -0700
changeset 207012 5ab56f2e6febcca7eb2936055fb85b5d588467fc
parent 207011 90a66c80a38b986d9c76159d0269ae5a9e840b45
child 207013 f6d22cf586e140f9d549723fec8aa62edb2f9602
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, sledru
bugs995407
milestone32.0a2
Bug 995407 - Revert enabling wifi and cell tower data reporting on release builds. r=mfinkle, a=sledru
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/confvars.sh
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -12,18 +12,20 @@
     <uses-sdk android:minSdkVersion="8"
               android:targetSdkVersion="@ANDROID_TARGET_SDK@"/>
 
 #include ../services/manifests/AnnouncementsAndroidManifest_permissions.xml.in
 #include ../services/manifests/FxAccountAndroidManifest_permissions.xml.in
 #include ../services/manifests/HealthReportAndroidManifest_permissions.xml.in
 #include ../services/manifests/SyncAndroidManifest_permissions.xml.in
 
+#ifndef RELEASE_BUILD
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+#endif
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
     <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
     <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
 
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -636,16 +636,21 @@ OnSharedPreferenceChangeListener
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 } else if (!AppConstants.MOZ_CRASHREPORTER &&
                            PREFS_CRASHREPORTER_ENABLED.equals(key)) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
+                } else if (AppConstants.RELEASE_BUILD && PREFS_GEO_REPORTING.equals(key)) {
+                    // We don't build wifi/cell tower collection in release builds, so hide the UI.
+                    preferences.removePreference(pref);
+                    i--;
+                    continue;
                 } else if (PREFS_DEVTOOLS_REMOTE_ENABLED.equals(key)) {
                     final Context thisContext = this;
                     pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                         @Override
                         public boolean onPreferenceClick(Preference preference) {
                             // Display toast to remind setting up tcp forwarding.
                             if (((CheckBoxPreference) preference).isChecked()) {
                                 Toast.makeText(thisContext, R.string.devtools_remote_debugging_forward, Toast.LENGTH_SHORT).show();
--- a/mobile/android/confvars.sh
+++ b/mobile/android/confvars.sh
@@ -56,18 +56,20 @@ MOZ_FOLD_LIBS=1
 MOZ_PAY=1
 
 # Enable UI for healthreporter
 MOZ_SERVICES_HEALTHREPORT=1
 
 # Enable FirefoxAccounts
 MOZ_SERVICES_FXACCOUNTS=1
 
-# Enable Wifi-AP/cell tower data reporting
+# Wifi-AP/cell tower data reporting is enabled on non-release builds.
+if test ! "$RELEASE_BUILD"; then
 MOZ_DATA_REPORTING=1
+fi
 
 # Enable runtime locale switching.
 MOZ_LOCALE_SWITCHER=1
 
 # Enable the "synthetic APKs" implementation of Open Web Apps.
 MOZ_ANDROID_SYNTHAPKS=1
 
 # Enable second screen and casting support for external devices.