Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b2df291 authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "SysUI: Use LocationController from status bar service for GPSTile." into cm-11.0

parents 28070f9e 07c549e4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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() {
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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)) {
+7 −0
Original line number Diff line number Diff line
@@ -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.
     *