bug 866957 - Collect and report cell tower and WiFi AP info, put it all behind a default-off pref r=mfinkle

This commit is contained in:
Brad Lassey 2013-05-31 17:32:12 -04:00
parent b8e52632df
commit 37aa768ef4

View File

@ -197,6 +197,7 @@ abstract public class GeckoApp
private int mSignalStrenth;
private PhoneStateListener mPhoneStateListener = null;
private boolean mShouldReportGeoData = false;
abstract public int getLayout();
abstract public boolean hasTabsSideBar();
@ -229,7 +230,7 @@ abstract public class GeckoApp
}
public LocationListener getLocationListener() {
if (mPhoneStateListener == null) {
if (mShouldReportGeoData && mPhoneStateListener == null) {
mPhoneStateListener = new PhoneStateListener() {
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
setCurrentSignalStrenth(signalStrength);
@ -1450,6 +1451,15 @@ abstract public class GeckoApp
}
});
PrefsHelper.getPref("app.geo.reportdata", new PrefsHelper.PrefHandlerBase() {
@Override public void prefValue(String pref, int value) {
if (value == 1)
mShouldReportGeoData = true;
else
mShouldReportGeoData = false;
}
});
// End of the startup of our Java App
mJavaUiStartupTimer.stop();
@ -2188,7 +2198,8 @@ abstract public class GeckoApp
public void onLocationChanged(Location location) {
// No logging here: user-identifying information.
GeckoAppShell.sendEventToGecko(GeckoEvent.createLocationEvent(location));
collectAndReportLocInfo(location);
if (mShouldReportGeoData)
collectAndReportLocInfo(location);
}
public void setCurrentSignalStrenth(SignalStrength ss) {