Loading packages/SystemUI/src/com/android/systemui/quicksettings/GPSTile.java +8 −2 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ public class GPSTile extends QuickSettingsTile implements LocationSettingsChange private LocationController mLocationController; private int mCurrentMode; public GPSTile(Context context, QuickSettingsController qsc) { public GPSTile(Context context, QuickSettingsController qsc, LocationController lc) { super(context, qsc); mContentResolver = mContext.getContentResolver(); mLocationController = new LocationController(mContext); mLocationController = lc; mLocationController.addSettingsChangedCallback(this); mOnClick = new OnClickListener() { Loading Loading @@ -78,6 +78,12 @@ public class GPSTile extends QuickSettingsTile implements LocationSettingsChange super.onPostCreate(); } @Override public void onDestroy() { super.onDestroy(); mLocationController.removeSettingsChangedCallback(this); } @Override public void updateResources() { updateTile(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class QuickSettingsController { qs = new WiFiTile(mContext, this, mStatusBarService.mNetworkController); } } else if (tile.equals(TILE_GPS)) { qs = new GPSTile(mContext, this); qs = new GPSTile(mContext, this, mStatusBarService.mLocationController); } else if (tile.equals(TILE_BLUETOOTH) && bluetoothSupported) { qs = new BluetoothTile(mContext, this, mStatusBarService.mBluetoothController); } else if (tile.equals(TILE_BRIGHTNESS)) { Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java +7 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,13 @@ public class LocationController extends BroadcastReceiver { mSettingsChangeCallbacks.add(cb); } /** * Remove a callback to listen for changes in location settings. */ public void removeSettingsChangedCallback(LocationSettingsChangeCallback cb) { mSettingsChangeCallbacks.remove(cb); } /** * Enable or disable location in settings. * Loading Loading
packages/SystemUI/src/com/android/systemui/quicksettings/GPSTile.java +8 −2 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ public class GPSTile extends QuickSettingsTile implements LocationSettingsChange private LocationController mLocationController; private int mCurrentMode; public GPSTile(Context context, QuickSettingsController qsc) { public GPSTile(Context context, QuickSettingsController qsc, LocationController lc) { super(context, qsc); mContentResolver = mContext.getContentResolver(); mLocationController = new LocationController(mContext); mLocationController = lc; mLocationController.addSettingsChangedCallback(this); mOnClick = new OnClickListener() { Loading Loading @@ -78,6 +78,12 @@ public class GPSTile extends QuickSettingsTile implements LocationSettingsChange super.onPostCreate(); } @Override public void onDestroy() { super.onDestroy(); mLocationController.removeSettingsChangedCallback(this); } @Override public void updateResources() { updateTile(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class QuickSettingsController { qs = new WiFiTile(mContext, this, mStatusBarService.mNetworkController); } } else if (tile.equals(TILE_GPS)) { qs = new GPSTile(mContext, this); qs = new GPSTile(mContext, this, mStatusBarService.mLocationController); } else if (tile.equals(TILE_BLUETOOTH) && bluetoothSupported) { qs = new BluetoothTile(mContext, this, mStatusBarService.mBluetoothController); } else if (tile.equals(TILE_BRIGHTNESS)) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java +7 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,13 @@ public class LocationController extends BroadcastReceiver { mSettingsChangeCallbacks.add(cb); } /** * Remove a callback to listen for changes in location settings. */ public void removeSettingsChangedCallback(LocationSettingsChangeCallback cb) { mSettingsChangeCallbacks.remove(cb); } /** * Enable or disable location in settings. * Loading