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

Commit 388a42e8 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: I2a64309347407fb22d50bc93f61b9e6754a20cca
parent f8a66e1d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@ import android.text.TextUtils;
import android.util.Log;

import com.android.internal.content.PackageMonitor;

import com.android.internal.telephony.util.TelephonyUtils;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;
@@ -108,7 +108,7 @@ public class CarrierServiceBindHelper {
    public CarrierServiceBindHelper(Context context) {
        mContext = context;

        int numPhones = TelephonyManager.from(context).getMaxPhoneCount();
        int numPhones = TelephonyManager.from(context).getSupportedModemCount();
        mBindings = new AppBinding[numPhones];
        mLastSimState = new String[numPhones];

+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ public class MultiSimSettingController extends Handler {

        // Initialize mCarrierConfigLoadedSubIds and register to listen to carrier config change.
        final int phoneCount = ((TelephonyManager) mContext.getSystemService(
                Context.TELEPHONY_SERVICE)).getMaxPhoneCount();
                Context.TELEPHONY_SERVICE)).getSupportedModemCount();
        mCarrierConfigLoadedSubIds = new int[phoneCount];
        Arrays.fill(mCarrierConfigLoadedSubIds, SubscriptionManager.INVALID_SUBSCRIPTION_ID);

+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ public class PhoneFactory {
                /* In case of multi SIM mode two instances of Phone, RIL are created,
                   where as in single SIM mode only instance. isMultiSimEnabled() function checks
                   whether it is single SIM or multi SIM mode */
                int numPhones = TelephonyManager.getDefault().getMaxPhoneCount();
                int numPhones = TelephonyManager.getDefault().getSupportedModemCount();

                int[] networkModes = new int[numPhones];
                sPhones = new Phone[numPhones];
+3 −3
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ public class ProxyController {
    public void registerForAllDataDisconnected(int subId, Handler h, int what) {
        int phoneId = SubscriptionController.getInstance().getPhoneId(subId);

        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount()) {
        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getSupportedModemCount()) {
            mPhones[phoneId].registerForAllDataDisconnected(h, what);
        }
    }
@@ -159,7 +159,7 @@ public class ProxyController {
    public void unregisterForAllDataDisconnected(int subId, Handler h) {
        int phoneId = SubscriptionController.getInstance().getPhoneId(subId);

        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount()) {
        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getSupportedModemCount()) {
            mPhones[phoneId].unregisterForAllDataDisconnected(h);
        }
    }
@@ -168,7 +168,7 @@ public class ProxyController {
    public boolean areAllDataDisconnected(int subId) {
        int phoneId = SubscriptionController.getInstance().getPhoneId(subId);

        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount()) {
        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getSupportedModemCount()) {
            return mPhones[phoneId].areAllDataDisconnected();
        } else {
            // if we can't find a phone for the given subId, it is disconnected.
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ import java.util.List;
public class SubscriptionInfoUpdater extends Handler {
    private static final String LOG_TAG = "SubscriptionInfoUpdater";
    @UnsupportedAppUsage
    private static final int PROJECT_SIM_NUM = TelephonyManager.getDefault().getMaxPhoneCount();
    private static final int PROJECT_SIM_NUM = TelephonyManager.getDefault()
            .getSupportedModemCount();

    private static final boolean DBG = true;

Loading