Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 387dc0ef authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Rename and publicize getMaxPhoneCount; and deprecate getPhoneCount.

To have better names reflecting what getPhoneCount / getMaxPhoneCount
actually represent, we replace them with getActiveModemCount and
getSupportedModemCount. As getPhoneCount is public API, we mark
it as @Deprecated.

Bug: 141388730
Test: build
Change-Id: If086c50ae803b384691f709057bceeac2fc1d9d5
Merged-In: If086c50ae803b384691f709057bceeac2fc1d9d5
parent 64ff73fe
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -44970,6 +44970,7 @@ package android.telephony {
    method @Nullable public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle);
    method public android.telephony.TelephonyManager createForSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean doesSwitchMultiSimConfigTriggerReboot();
    method public int getActiveModemCount();
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public java.util.List<android.telephony.CellInfo> getAllCellInfo();
    method public int getCallState();
    method public int getCardIdForDefaultEuicc();
@@ -45002,7 +45003,7 @@ package android.telephony {
    method public String getNetworkOperatorName();
    method public String getNetworkSpecifier();
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType();
    method public int getPhoneCount();
    method @Deprecated public int getPhoneCount();
    method public int getPhoneType();
    method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription();
    method @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.ACCESS_COARSE_LOCATION}) public android.telephony.ServiceState getServiceState();
@@ -45018,6 +45019,7 @@ package android.telephony {
    method public int getSimState();
    method public int getSimState(int);
    method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getSubscriberId();
    method public int getSupportedModemCount();
    method @Nullable public String getTypeAllocationCode();
    method @Nullable public String getTypeAllocationCode(int);
    method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") @NonNull public java.util.List<android.telephony.UiccCardInfo> getUiccCardsInfo();
@@ -45122,6 +45124,10 @@ 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
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ public class CarrierTextController {
        mSeparator = separator;
        mWakefulnessLifecycle = Dependency.get(WakefulnessLifecycle.class);
        mSimSlotsNumber = ((TelephonyManager) context.getSystemService(
                Context.TELEPHONY_SERVICE)).getMaxPhoneCount();
                Context.TELEPHONY_SERVICE)).getSupportedModemCount();
        mSimErrorState = new boolean[mSimSlotsNumber];
        updateDisplayOpportunisticSubscriptionCarrierText(SystemProperties.getBoolean(
                TelephonyProperties.DISPLAY_OPPORTUNISTIC_SUBSCRIPTION_CARRIER_TEXT_PROPERTY_NAME,
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public class CarrierTextControllerTest extends SysuiTestCase {

        mCarrierTextCallbackInfo = new CarrierTextController.CarrierTextCallbackInfo("",
                new CharSequence[]{}, false, new int[]{});
        when(mTelephonyManager.getMaxPhoneCount()).thenReturn(3);
        when(mTelephonyManager.getSupportedModemCount()).thenReturn(3);

        mCarrierTextController = new TestCarrierTextController(mContext, SEPARATOR, true, true,
                mKeyguardUpdateMonitor);
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        mContext = context;
        mBatteryStats = BatteryStatsService.getService();

        int numPhones = TelephonyManager.getDefault().getMaxPhoneCount();
        int numPhones = TelephonyManager.getDefault().getSupportedModemCount();
        if (DBG) log("TelephonyRegistry: ctor numPhones=" + numPhones);
        mNumPhones = numPhones;
        mCallState = new int[numPhones];
+2 −2
Original line number Diff line number Diff line
@@ -2095,13 +2095,13 @@ public class SubscriptionManager {
    /** @hide */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    public static boolean isValidSlotIndex(int slotIndex) {
        return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getMaxPhoneCount();
        return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getSupportedModemCount();
    }

    /** @hide */
    @UnsupportedAppUsage
    public static boolean isValidPhoneId(int phoneId) {
        return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount();
        return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getSupportedModemCount();
    }

    /** @hide */
Loading