diff options
author | Luis Vidal <lvidal@cyngn.com> | 2016-02-17 12:22:37 -0800 |
---|---|---|
committer | Luis Vidal <lvidal@cyngn.com> | 2016-02-19 14:58:44 -0800 |
commit | 862c4e2b5b6183b2732ad3af329db848b25bfbeb (patch) | |
tree | 15c7ebe1c9afb83949f8e2dcbfa6825ce1a36bf4 /packages/SystemUI/src | |
parent | f42b8b25adeb7e5f0e9d1f9ebe146796c46d8d95 (diff) | |
download | frameworks_base-862c4e2b5b6183b2732ad3af329db848b25bfbeb.zip frameworks_base-862c4e2b5b6183b2732ad3af329db848b25bfbeb.tar.gz frameworks_base-862c4e2b5b6183b2732ad3af329db848b25bfbeb.tar.bz2 |
Show SIM card settings in MSIM devices
Fix to show the SIM card settings when QS network tile is long
pressed.
This patch also ports commit d427e02 from cm-12 to prevent showing
mobile network options for seconday users
Change-Id: I6c94fda5d2de0aa26285bd7d14b7dceac044bf41
TICKET: CYNGNOS-2052
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java index f4602de..5402582 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -17,10 +17,12 @@ package com.android.systemui.qs.tiles; +import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.res.Resources; +import android.os.UserHandle; import android.telephony.TelephonyManager; import android.view.LayoutInflater; import android.view.View; @@ -47,11 +49,8 @@ public class CellularTile extends QSTile<QSTile.SignalState> { private static final Intent MOBILE_NETWORK_SETTINGS = new Intent(Intent.ACTION_MAIN) .setComponent(new ComponentName("com.android.phone", "com.android.phone.MobileNetworkSettings")); - private static final Intent MOBILE_NETWORK_SETTINGS_MSIM = new Intent(Intent.ACTION_MAIN) - .setClassName("com.android.phone", "com.android.phone.msim.SelectSubscription") - .putExtra("PACKAGE", "com.android.phone") - .putExtra("TARGET_CLASS", "com.android.phone.MobileNetworkSettings") - .putExtra("TARGET_THEME", "Theme.Material.Settings"); + private static final Intent MOBILE_NETWORK_SETTINGS_MSIM + = new Intent("com.android.settings.sim.SIM_SUB_INFO_SETTINGS"); private final NetworkController mController; private final MobileDataController mDataController; @@ -93,6 +92,13 @@ public class CellularTile extends QSTile<QSTile.SignalState> { } @Override + protected void handleUserSwitch(int newUserId) { + if (newUserId != UserHandle.USER_OWNER) { + refreshState(); + } + } + + @Override protected void handleClick() { MetricsLogger.action(mContext, getMetricsCategory()); if (mDataController.isMobileDataSupported()) { @@ -118,7 +124,8 @@ public class CellularTile extends QSTile<QSTile.SignalState> { @Override protected void handleUpdateState(SignalState state, Object arg) { - state.visible = mController.hasMobileDataFeature(); + state.visible = mController.hasMobileDataFeature() + && (ActivityManager.getCurrentUser() == UserHandle.USER_OWNER); if (!state.visible) return; CallbackInfo cb = (CallbackInfo) arg; if (cb == null) { |