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

Commit cc717083 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android Git Automerger
Browse files

am a05e7ac2: am 5cf30c60: Merge "Pass wifi ap state through to tile when...

am a05e7ac2: am 5cf30c60: Merge "Pass wifi ap state through to tile when receiver triggered." into mnc-dev

* commit 'a05e7ac2':
  Pass wifi ap state through to tile when receiver triggered.
parents f7810b44 a05e7ac2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -94,7 +94,11 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
        state.visible = mController.isHotspotSupported() && mUsageTracker.isRecentlyUsed();
        state.label = mContext.getString(R.string.quick_settings_hotspot_label);

        state.value = mController.isHotspotEnabled();
        if (arg instanceof Boolean) {
            state.value = (boolean) arg;
        } else {
            mController.isHotspotEnabled();
        }
        state.icon = state.visible && state.value ? mEnable : mDisable;
    }

@@ -120,7 +124,7 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
    private final class Callback implements HotspotController.Callback {
        @Override
        public void onHotspotChanged(boolean enabled) {
            refreshState();
            refreshState(enabled);
        }
    };

+3 −1
Original line number Diff line number Diff line
@@ -111,7 +111,9 @@ public class HotspotControllerImpl implements HotspotController {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (DEBUG) Log.d(TAG, "onReceive " + intent.getAction());
            fireCallback(isHotspotEnabled());
            int state = intent.getIntExtra(
                    WifiManager.EXTRA_WIFI_AP_STATE, WifiManager.WIFI_AP_STATE_FAILED);
            fireCallback(WifiManager.WIFI_AP_STATE_ENABLED == state);
        }
    }
}