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

Commit 459c3728 authored by Xiangyu/Malcolm Chen's avatar Xiangyu/Malcolm Chen Committed by android-build-merger
Browse files

Merge "Replace getPhoneCount with getMaxPhoneCount upon object allocation." am: 27f92d01

am: 6c2f5a59

Change-Id: I0e70e7cb334f71f7fb2448943143d13c87af7687
parents ee34ff99 6c2f5a59
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class CarrierServiceBindHelper {
    public CarrierServiceBindHelper(Context context) {
        mContext = context;

        int numPhones = TelephonyManager.from(context).getPhoneCount();
        int numPhones = TelephonyManager.from(context).getMaxPhoneCount();
        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)).getPhoneCount();
                Context.TELEPHONY_SERVICE)).getMaxPhoneCount();
        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().getPhoneCount();
                int numPhones = TelephonyManager.getDefault().getMaxPhoneCount();

                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().getPhoneCount()) {
        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount()) {
            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().getPhoneCount()) {
        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount()) {
            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().getPhoneCount()) {
        if (phoneId >= 0 && phoneId < TelephonyManager.getDefault().getMaxPhoneCount()) {
            return mPhones[phoneId].areAllDataDisconnected();
        } else {
            // if we can't find a phone for the given subId, it is disconnected.
+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ import android.telephony.Rlog;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SmsManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyHistogram;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager.PrefNetworkMode;
@@ -413,6 +414,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    /** Returns a {@link IRadio} instance or null if the service is not available. */
    @VisibleForTesting
    public synchronized IRadio getRadioProxy(Message result) {
        if (!SubscriptionManager.isActivePhoneId(mPhoneId)) return null;
        if (!mIsMobileNetworkSupported) {
            if (RILJ_LOGV) riljLog("getRadioProxy: Not calling getService(): wifi-only");
            if (result != null) {
@@ -506,6 +508,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    /** Returns an {@link IOemHook} instance or null if the service is not available. */
    @VisibleForTesting
    public synchronized IOemHook getOemHookProxy(Message result) {
        if (!SubscriptionManager.isActivePhoneId(mPhoneId)) return null;
        if (!mIsMobileNetworkSupported) {
            if (RILJ_LOGV) riljLog("getOemHookProxy: Not calling getService(): wifi-only");
            if (result != null) {
Loading