diff options
author | Jason Monk <jmonk@google.com> | 2015-01-22 14:26:29 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-01-22 14:26:29 +0000 |
commit | 086e3116180341bd545689dab90ec240bfbd9419 (patch) | |
tree | abe924f6ebc5a071a350d0bdd3df1e30b088711a /packages/SystemUI/src | |
parent | 56bbefccf27d3c32029121fe23f0b02c01eba338 (diff) | |
parent | 4185030ad49d4e9b42721355953001cd890ed05a (diff) | |
download | frameworks_base-086e3116180341bd545689dab90ec240bfbd9419.zip frameworks_base-086e3116180341bd545689dab90ec240bfbd9419.tar.gz frameworks_base-086e3116180341bd545689dab90ec240bfbd9419.tar.bz2 |
Merge "Show connect dialog when selecting secure QS wifi" into lmp-mr1-dev automerge: 1a5ac5b automerge: 3c55689
automerge: 4185030
* commit '4185030ad49d4e9b42721355953001cd890ed05a':
Show connect dialog when selecting secure QS wifi
Diffstat (limited to 'packages/SystemUI/src')
3 files changed, 18 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java index 101a192..bd4dbe6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java @@ -30,6 +30,7 @@ import com.android.systemui.qs.QSDetailItems.Item; import com.android.systemui.qs.QSTile; import com.android.systemui.qs.QSTileView; import com.android.systemui.qs.SignalTileView; +import com.android.systemui.statusbar.phone.QSTileHost; import com.android.systemui.statusbar.policy.NetworkController; import com.android.systemui.statusbar.policy.NetworkController.AccessPointController; import com.android.systemui.statusbar.policy.NetworkController.AccessPointController.AccessPoint; @@ -290,6 +291,11 @@ public class WifiTile extends QSTile<QSTile.SignalState> { } @Override + public void onSettingsActivityTriggered(Intent settingsIntent) { + mHost.startSettingsActivity(settingsIntent); + } + + @Override public void onDetailItemClick(Item item) { if (item == null || item.tag == null) return; final AccessPoint ap = (AccessPoint) item.tag; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java index dc6af6a..ad4c211 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessPointControllerImpl.java @@ -125,7 +125,7 @@ public class AccessPointControllerImpl implements NetworkController.AccessPointC Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS); intent.putExtra(EXTRA_START_CONNECT_SSID, ap.ssid); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - mContext.startActivityAsUser(intent, new UserHandle(mCurrentUser)); + fireSettingsIntentCallback(intent); return true; } else { WifiConfiguration config = new WifiConfiguration(); @@ -139,7 +139,13 @@ public class AccessPointControllerImpl implements NetworkController.AccessPointC return false; } - private void fireCallback(AccessPoint[] aps) { + private void fireSettingsIntentCallback(Intent intent) { + for (AccessPointCallback callback : mCallbacks) { + callback.onSettingsActivityTriggered(intent); + } + } + + private void fireAcccessPointsCallback(AccessPoint[] aps) { for (AccessPointCallback callback : mCallbacks) { callback.onAccessPointsChanged(aps); } @@ -208,7 +214,7 @@ public class AccessPointControllerImpl implements NetworkController.AccessPointC aps.add(ap); } Collections.sort(aps, mByStrength); - fireCallback(aps.toArray(new AccessPoint[aps.size()])); + fireAcccessPointsCallback(aps.toArray(new AccessPoint[aps.size()])); } private final ActionListener mConnectListener = new ActionListener() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index bcf08ff..3cffc85 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.policy; +import android.content.Intent; + public interface NetworkController { boolean hasMobileDataFeature(); @@ -53,6 +55,7 @@ public interface NetworkController { public interface AccessPointCallback { void onAccessPointsChanged(AccessPoint[] accessPoints); + void onSettingsActivityTriggered(Intent settingsIntent); } public static class AccessPoint { |