diff options
author | Julia Reynolds <juliacr@google.com> | 2015-07-14 20:23:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-14 20:23:50 +0000 |
commit | 5cf30c608f21a9685310e6cf7d5970c8b7fb36c8 (patch) | |
tree | 62f0cb8fd0c238acff7f8208287000e63b28ab5f | |
parent | 353886b2dd1d6751d83469ddd3eb01dd0039231e (diff) | |
parent | b8a46a6c77bcb4a6d837c6ddfc4418a21022949a (diff) | |
download | frameworks_base-5cf30c608f21a9685310e6cf7d5970c8b7fb36c8.zip frameworks_base-5cf30c608f21a9685310e6cf7d5970c8b7fb36c8.tar.gz frameworks_base-5cf30c608f21a9685310e6cf7d5970c8b7fb36c8.tar.bz2 |
Merge "Pass wifi ap state through to tile when receiver triggered." into mnc-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java | 8 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java index f28a24b..ddde106 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java @@ -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); } }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java index 4bfd528..1e3bc4d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java @@ -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); } } } |