diff options
Diffstat (limited to 'packages/SystemUI/src/com/android')
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 { |