From 4c9681135692a056d038866d9c60f60475911aa6 Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Tue, 25 Feb 2020 13:34:09 -0800 Subject: Remove @ModemCount enum definitions. Per API council's feedback, they are not needed. Replacing enums with integers 0, 1, 2, 3. Bug: 143652732 Test: build Change-Id: Id9e87ea28a2f31e1aa842424770096e16f1cb208 Merged-In: Id9e87ea28a2f31e1aa842424770096e16f1cb208 --- api/current.txt | 4 ---- .../android/keyguard/KeyguardUpdateMonitor.java | 3 +-- .../statusbar/policy/NetworkControllerImpl.java | 3 +-- .../java/android/telephony/TelephonyManager.java | 27 +++++----------------- 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/api/current.txt b/api/current.txt index cf57819d77c4..317ec9341e99 100644 --- a/api/current.txt +++ b/api/current.txt @@ -46050,10 +46050,6 @@ package android.telephony { field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.extra.SUBSCRIPTION_ID"; field public static final String EXTRA_VOICEMAIL_NUMBER = "android.telephony.extra.VOICEMAIL_NUMBER"; field public static final String METADATA_HIDE_VOICEMAIL_SETTINGS_MENU = "android.telephony.HIDE_VOICEMAIL_SETTINGS_MENU"; - field public static final int MODEM_COUNT_DUAL_MODEM = 2; // 0x2 - field public static final int MODEM_COUNT_NO_MODEM = 0; // 0x0 - field public static final int MODEM_COUNT_SINGLE_MODEM = 1; // 0x1 - field public static final int MODEM_COUNT_TRI_MODEM = 3; // 0x3 field public static final int MULTISIM_ALLOWED = 0; // 0x0 field public static final int MULTISIM_NOT_SUPPORTED_BY_CARRIER = 2; // 0x2 field public static final int MULTISIM_NOT_SUPPORTED_BY_HARDWARE = 1; // 0x1 diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 5dfb21bb9f64..8d505e7e708f 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -29,7 +29,6 @@ import static android.os.BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE; import static android.os.BatteryManager.EXTRA_PLUGGED; import static android.os.BatteryManager.EXTRA_STATUS; import static android.telephony.PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE; -import static android.telephony.TelephonyManager.MODEM_COUNT_DUAL_MODEM; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_BOOT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW; @@ -527,7 +526,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { */ public List getFilteredSubscriptionInfo(boolean forceReload) { List subscriptions = getSubscriptionInfo(false); - if (subscriptions.size() == MODEM_COUNT_DUAL_MODEM) { + if (subscriptions.size() == 2) { SubscriptionInfo info1 = subscriptions.get(0); SubscriptionInfo info2 = subscriptions.get(1); if (info1.getGroupUuid() != null && info1.getGroupUuid().equals(info2.getGroupUuid())) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index e3d8ea2f9048..2ced30f3c608 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -23,7 +23,6 @@ import static android.net.wifi.WifiManager.TrafficStateCallback.DATA_ACTIVITY_IN import static android.net.wifi.WifiManager.TrafficStateCallback.DATA_ACTIVITY_NONE; import static android.net.wifi.WifiManager.TrafficStateCallback.DATA_ACTIVITY_OUT; import static android.telephony.PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE; -import static android.telephony.TelephonyManager.MODEM_COUNT_DUAL_MODEM; import static com.android.systemui.Dependency.BG_LOOPER_NAME; @@ -607,7 +606,7 @@ public class NetworkControllerImpl extends BroadcastReceiver } private void filterMobileSubscriptionInSameGroup(List subscriptions) { - if (subscriptions.size() == MODEM_COUNT_DUAL_MODEM) { + if (subscriptions.size() == 2) { SubscriptionInfo info1 = subscriptions.get(0); SubscriptionInfo info2 = subscriptions.get(1); if (info1.getGroupUuid() != null && info1.getGroupUuid().equals(info2.getGroupUuid())) { diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 059692de134e..3918778c4a31 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -316,21 +316,6 @@ public class TelephonyManager { UNKNOWN }; - /** @hide */ - @IntDef(prefix = {"MODEM_COUNT_"}, - value = { - MODEM_COUNT_NO_MODEM, - MODEM_COUNT_SINGLE_MODEM, - MODEM_COUNT_DUAL_MODEM, - MODEM_COUNT_TRI_MODEM - }) - public @interface ModemCount {} - - public static final int MODEM_COUNT_NO_MODEM = 0; - public static final int MODEM_COUNT_SINGLE_MODEM = 1; - public static final int MODEM_COUNT_DUAL_MODEM = 2; - public static final int MODEM_COUNT_TRI_MODEM = 3; - /** @hide */ @UnsupportedAppUsage public TelephonyManager(Context context) { @@ -439,22 +424,22 @@ public class TelephonyManager { * Returns 2 for Dual standby mode (Dual SIM functionality). * Returns 3 for Tri standby mode (Tri SIM functionality). */ - public @ModemCount int getActiveModemCount() { + public int getActiveModemCount() { int modemCount = 1; switch (getMultiSimConfiguration()) { case UNKNOWN: - modemCount = MODEM_COUNT_SINGLE_MODEM; + modemCount = 1; // check for voice and data support, 0 if not supported if (!isVoiceCapable() && !isSmsCapable() && !isDataCapable()) { - modemCount = MODEM_COUNT_NO_MODEM; + modemCount = 0; } break; case DSDS: case DSDA: - modemCount = MODEM_COUNT_DUAL_MODEM; + modemCount = 2; break; case TSTS: - modemCount = MODEM_COUNT_TRI_MODEM; + modemCount = 3; break; } return modemCount; @@ -467,7 +452,7 @@ public class TelephonyManager { * dual-SIM capable device operating in single SIM mode (only one logical modem is turned on), * {@link #getActiveModemCount} returns 1 while this API returns 2. */ - public @ModemCount int getSupportedModemCount() { + public int getSupportedModemCount() { return TelephonyProperties.max_active_modems().orElse(getActiveModemCount()); } -- cgit v1.2.3-59-g8ed1b