diff options
author | David Christie <dnchrist@google.com> | 2013-08-13 16:14:10 -0700 |
---|---|---|
committer | David Christie <dnchrist@google.com> | 2013-08-13 16:14:10 -0700 |
commit | ef20fd1ea09f1f0d7fb396d55d2a648ef1b06124 (patch) | |
tree | b4ad48b4f1c9b4385c80ec17db3797bfaa5bbb27 | |
parent | 87fefc449bffabebf98020f40d21d28500b1c1bb (diff) | |
download | frameworks_base-ef20fd1ea09f1f0d7fb396d55d2a648ef1b06124.zip frameworks_base-ef20fd1ea09f1f0d7fb396d55d2a648ef1b06124.tar.gz frameworks_base-ef20fd1ea09f1f0d7fb396d55d2a648ef1b06124.tar.bz2 |
Don't allow airplane mode to affect location status icon.
Gps still operates when airplane mode is on, and consumes
just as much power so the icon shouldn't be hidden.
Change-Id: I10edc8771d3dd1831e94d26c6f61ca82d805cc12
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java index fcf04ac..c2ffff8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java @@ -53,7 +53,6 @@ public class LocationController extends BroadcastReceiver { private StatusBarManager mStatusBarManager; private boolean mAreActiveLocationRequests; - private boolean mIsAirplaneMode; private ArrayList<LocationSettingsChangeCallback> mSettingsChangeCallbacks = new ArrayList<LocationSettingsChangeCallback>(); @@ -76,9 +75,6 @@ public class LocationController extends BroadcastReceiver { IntentFilter filter = new IntentFilter(); filter.addAction(LocationManager.HIGH_POWER_REQUEST_CHANGE_ACTION); - // Listen for a change in the airplane mode setting so we can defensively turn off the - // high power location icon when radios are disabled. - filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); context.registerReceiver(this, filter); mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); @@ -100,7 +96,6 @@ public class LocationController extends BroadcastReceiver { // Examine the current location state and initialize the status view. updateActiveLocationRequests(); - updateAirplaneMode(); refreshViews(); } @@ -170,11 +165,9 @@ public class LocationController extends BroadcastReceiver { return false; } - // Updates the status view based on the current state of location requests and airplane mode. + // Updates the status view based on the current state of location requests. private void refreshViews() { - // The airplane mode check is defensive - there shouldn't be any active high power - // location requests when airplane mode is on. - if (!mIsAirplaneMode && mAreActiveLocationRequests) { + if (mAreActiveLocationRequests) { mStatusBarManager.setIcon(LOCATION_STATUS_ICON_PLACEHOLDER, LOCATION_STATUS_ICON_ID, 0, mContext.getString(R.string.accessibility_location_active)); } else { @@ -191,25 +184,11 @@ public class LocationController extends BroadcastReceiver { } } - // Reads the airplane mode setting and updates the status view if necessary. - private void updateAirplaneMode() { - boolean wasAirplaneMode = mIsAirplaneMode; - // TODO This probably warrants a utility method in Settings.java. - mIsAirplaneMode = (Settings.Global.getInt( - mContext.getContentResolver(), - Settings.Global.AIRPLANE_MODE_ON, 0) == 1); - if (mIsAirplaneMode != wasAirplaneMode) { - refreshViews(); - } - } - @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (LocationManager.HIGH_POWER_REQUEST_CHANGE_ACTION.equals(action)) { updateActiveLocationRequests(); - } else if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(action)) { - updateAirplaneMode(); } } } |