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

Commit bc027275 authored by Wink Saville's avatar Wink Saville
Browse files

Change suffix UsingSubId to ForSubscriber.

Bug: 17255752
Change-Id: Ifd522888b5aaae111f642d1e35bd1bb939e539d4
parent 8fd30e44
Loading
Loading
Loading
Loading
+43 −43
Original line number Original line Diff line number Diff line
@@ -196,7 +196,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    if (VDBG) log("MSG_USER_SWITCHED userId=" + msg.arg1);
                    if (VDBG) log("MSG_USER_SWITCHED userId=" + msg.arg1);
                    int numPhones = TelephonyManager.getDefault().getPhoneCount();
                    int numPhones = TelephonyManager.getDefault().getPhoneCount();
                    for (int sub = 0; sub < numPhones; sub++) {
                    for (int sub = 0; sub < numPhones; sub++) {
                        TelephonyRegistry.this.notifyCellLocationUsingSubId(sub,
                        TelephonyRegistry.this.notifyCellLocationForSubscriber(sub,
                                mCellLocation[sub]);
                                mCellLocation[sub]);
                    }
                    }
                    break;
                    break;
@@ -326,7 +326,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    @Override
    @Override
    public void listenUsingSubId(long subId, String pkgForDebug, IPhoneStateListener callback,
    public void listenForSubscriber(long subId, String pkgForDebug, IPhoneStateListener callback,
            int events, boolean notifyNow) {
            int events, boolean notifyNow) {
        listen(pkgForDebug, callback, events, notifyNow, subId, false);
        listen(pkgForDebug, callback, events, notifyNow, subId, false);
    }
    }
@@ -542,12 +542,12 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        broadcastCallStateChanged(state, incomingNumber, mDefaultSubId);
        broadcastCallStateChanged(state, incomingNumber, mDefaultSubId);
    }
    }


    public void notifyCallStateUsingSubId(long subId, int state, String incomingNumber) {
    public void notifyCallStateForSubscriber(long subId, int state, String incomingNumber) {
        if (!checkNotifyPermission("notifyCallState()")) {
        if (!checkNotifyPermission("notifyCallState()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyCallStateUsingSubId: subId=" + subId
            log("notifyCallStateForSubscriber: subId=" + subId
                + " state=" + state + " incomingNumber=" + incomingNumber);
                + " state=" + state + " incomingNumber=" + incomingNumber);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
@@ -573,38 +573,38 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


     public void notifyServiceState(ServiceState state) {
     public void notifyServiceState(ServiceState state) {
         notifyServiceStateUsingSubId(mDefaultSubId, state);
         notifyServiceStateForSubscriber(mDefaultSubId, state);
     }
     }


    public void notifyServiceStateUsingSubId(long subId, ServiceState state) {
    public void notifyServiceStateForSubscriber(long subId, ServiceState state) {
        if (!checkNotifyPermission("notifyServiceState()")){
        if (!checkNotifyPermission("notifyServiceState()")){
            return;
            return;
        }
        }
        if (subId == SubscriptionManager.DEFAULT_SUB_ID) {
        if (subId == SubscriptionManager.DEFAULT_SUB_ID) {
            subId = mDefaultSubId;
            subId = mDefaultSubId;
            if (VDBG) log("notifyServiceStateUsingSubId: using mDefaultSubId=" + mDefaultSubId);
            if (VDBG) log("notifyServiceStateForSubscriber: using mDefaultSubId=" + mDefaultSubId);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
            int phoneId = SubscriptionManager.getPhoneId(subId);
            int phoneId = SubscriptionManager.getPhoneId(subId);
            if (VDBG) {
            if (VDBG) {
                log("notifyServiceStateUsingSubId: subId=" + subId + " phoneId=" + phoneId
                log("notifyServiceStateForSubscriber: subId=" + subId + " phoneId=" + phoneId
                    + " state=" + state);
                    + " state=" + state);
            }
            }
            if (validatePhoneId(phoneId)) {
            if (validatePhoneId(phoneId)) {
                mServiceState[phoneId] = state;
                mServiceState[phoneId] = state;
                logServiceStateChanged("notifyServiceStateUsingSubId", subId, phoneId, state);
                logServiceStateChanged("notifyServiceStateForSubscriber", subId, phoneId, state);
                if (VDBG) toStringLogSSC("notifyServiceStateUsingSubId");
                if (VDBG) toStringLogSSC("notifyServiceStateForSubscriber");


                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (VDBG) {
                    if (VDBG) {
                        log("notifyServiceStateUsingSubId: r=" + r + " subId=" + subId
                        log("notifyServiceStateForSubscriber: r=" + r + " subId=" + subId
                                + " phoneId=" + phoneId + " state=" + state);
                                + " phoneId=" + phoneId + " state=" + state);
                    }
                    }
                    if (((r.events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) &&
                        (r.phoneId == phoneId)) {
                        (r.phoneId == phoneId)) {
                        try {
                        try {
                            if (DBG) {
                            if (DBG) {
                                log("notifyServiceStateUsingSubId: callback.onSSC r=" + r
                                log("notifyServiceStateForSubscriber: callback.onSSC r=" + r
                                        + " subId=" + subId + " phoneId=" + phoneId
                                        + " subId=" + subId + " phoneId=" + phoneId
                                        + " state=" + state);
                                        + " state=" + state);
                            }
                            }
@@ -615,7 +615,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    }
                    }
                }
                }
            } else {
            } else {
                log("notifyServiceStateUsingSubId: INVALID phoneId=" + phoneId);
                log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId);
            }
            }
            handleRemoveListLocked();
            handleRemoveListLocked();
        }
        }
@@ -623,33 +623,33 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifySignalStrength(SignalStrength signalStrength) {
    public void notifySignalStrength(SignalStrength signalStrength) {
        notifySignalStrengthUsingSubId(mDefaultSubId, signalStrength);
        notifySignalStrengthForSubscriber(mDefaultSubId, signalStrength);
    }
    }


    public void notifySignalStrengthUsingSubId(long subId, SignalStrength signalStrength) {
    public void notifySignalStrengthForSubscriber(long subId, SignalStrength signalStrength) {
        if (!checkNotifyPermission("notifySignalStrength()")) {
        if (!checkNotifyPermission("notifySignalStrength()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifySignalStrengthUsingSubId: subId=" + subId
            log("notifySignalStrengthForSubscriber: subId=" + subId
                + " signalStrength=" + signalStrength);
                + " signalStrength=" + signalStrength);
            toStringLogSSC("notifySignalStrengthUsingSubId");
            toStringLogSSC("notifySignalStrengthForSubscriber");
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
            int phoneId = SubscriptionManager.getPhoneId(subId);
            int phoneId = SubscriptionManager.getPhoneId(subId);
            if (validatePhoneId(phoneId)) {
            if (validatePhoneId(phoneId)) {
                if (VDBG) log("notifySignalStrengthUsingSubId: valid phoneId=" + phoneId);
                if (VDBG) log("notifySignalStrengthForSubscriber: valid phoneId=" + phoneId);
                mSignalStrength[phoneId] = signalStrength;
                mSignalStrength[phoneId] = signalStrength;
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (VDBG) {
                    if (VDBG) {
                        log("notifySignalStrengthUsingSubId: r=" + r + " subId=" + subId
                        log("notifySignalStrengthForSubscriber: r=" + r + " subId=" + subId
                                + " phoneId=" + phoneId + " ss=" + signalStrength);
                                + " phoneId=" + phoneId + " ss=" + signalStrength);
                    }
                    }
                    if (((r.events & PhoneStateListener.LISTEN_SIGNAL_STRENGTHS) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_SIGNAL_STRENGTHS) != 0) &&
                        (r.phoneId == phoneId)) {
                        (r.phoneId == phoneId)) {
                        try {
                        try {
                            if (DBG) {
                            if (DBG) {
                                log("notifySignalStrengthUsingSubId: callback.onSsS r=" + r
                                log("notifySignalStrengthForSubscriber: callback.onSsS r=" + r
                                        + " subId=" + subId + " phoneId=" + phoneId
                                        + " subId=" + subId + " phoneId=" + phoneId
                                        + " ss=" + signalStrength);
                                        + " ss=" + signalStrength);
                            }
                            }
@@ -664,7 +664,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                            int gsmSignalStrength = signalStrength.getGsmSignalStrength();
                            int gsmSignalStrength = signalStrength.getGsmSignalStrength();
                            int ss = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength);
                            int ss = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength);
                            if (DBG) {
                            if (DBG) {
                                log("notifySignalStrengthUsingSubId: callback.onSS r=" + r
                                log("notifySignalStrengthForSubscriber: callback.onSS r=" + r
                                        + " subId=" + subId + " phoneId=" + phoneId
                                        + " subId=" + subId + " phoneId=" + phoneId
                                        + " gsmSS=" + gsmSignalStrength + " ss=" + ss);
                                        + " gsmSS=" + gsmSignalStrength + " ss=" + ss);
                            }
                            }
@@ -675,7 +675,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    }
                    }
                }
                }
            } else {
            } else {
                log("notifySignalStrengthUsingSubId: invalid phoneId=" + phoneId);
                log("notifySignalStrengthForSubscriber: invalid phoneId=" + phoneId);
            }
            }
            handleRemoveListLocked();
            handleRemoveListLocked();
        }
        }
@@ -683,15 +683,15 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyCellInfo(List<CellInfo> cellInfo) {
    public void notifyCellInfo(List<CellInfo> cellInfo) {
         notifyCellInfoUsingSubId(mDefaultSubId, cellInfo);
         notifyCellInfoForSubscriber(mDefaultSubId, cellInfo);
    }
    }


    public void notifyCellInfoUsingSubId(long subId, List<CellInfo> cellInfo) {
    public void notifyCellInfoForSubscriber(long subId, List<CellInfo> cellInfo) {
        if (!checkNotifyPermission("notifyCellInfo()")) {
        if (!checkNotifyPermission("notifyCellInfo()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyCellInfoUsingSubId: subId=" + subId
            log("notifyCellInfoForSubscriber: subId=" + subId
                + " cellInfo=" + cellInfo);
                + " cellInfo=" + cellInfo);
        }
        }


@@ -743,15 +743,15 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyMessageWaitingChanged(boolean mwi) {
    public void notifyMessageWaitingChanged(boolean mwi) {
        notifyMessageWaitingChangedUsingSubId(mDefaultSubId, mwi);
        notifyMessageWaitingChangedForSubscriber(mDefaultSubId, mwi);
    }
    }


    public void notifyMessageWaitingChangedUsingSubId(long subId, boolean mwi) {
    public void notifyMessageWaitingChangedForSubscriber(long subId, boolean mwi) {
        if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
        if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyMessageWaitingChangedUsingSubId: subId=" + subId
            log("notifyMessageWaitingChangedForSubscriber: subId=" + subId
                + " mwi=" + mwi);
                + " mwi=" + mwi);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
@@ -774,15 +774,15 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyCallForwardingChanged(boolean cfi) {
    public void notifyCallForwardingChanged(boolean cfi) {
        notifyCallForwardingChangedUsingSubId(mDefaultSubId, cfi);
        notifyCallForwardingChangedForSubscriber(mDefaultSubId, cfi);
    }
    }


    public void notifyCallForwardingChangedUsingSubId(long subId, boolean cfi) {
    public void notifyCallForwardingChangedForSubscriber(long subId, boolean cfi) {
        if (!checkNotifyPermission("notifyCallForwardingChanged()")) {
        if (!checkNotifyPermission("notifyCallForwardingChanged()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyCallForwardingChangedUsingSubId: subId=" + subId
            log("notifyCallForwardingChangedForSubscriber: subId=" + subId
                + " cfi=" + cfi);
                + " cfi=" + cfi);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
@@ -805,10 +805,10 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyDataActivity(int state) {
    public void notifyDataActivity(int state) {
        notifyDataActivityUsingSubId(mDefaultSubId, state);
        notifyDataActivityForSubscriber(mDefaultSubId, state);
    }
    }


    public void notifyDataActivityUsingSubId(long subId, int state) {
    public void notifyDataActivityForSubscriber(long subId, int state) {
        if (!checkNotifyPermission("notifyDataActivity()" )) {
        if (!checkNotifyPermission("notifyDataActivity()" )) {
            return;
            return;
        }
        }
@@ -831,12 +831,12 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    public void notifyDataConnection(int state, boolean isDataConnectivityPossible,
    public void notifyDataConnection(int state, boolean isDataConnectivityPossible,
            String reason, String apn, String apnType, LinkProperties linkProperties,
            String reason, String apn, String apnType, LinkProperties linkProperties,
            NetworkCapabilities networkCapabilities, int networkType, boolean roaming) {
            NetworkCapabilities networkCapabilities, int networkType, boolean roaming) {
        notifyDataConnectionUsingSubId(mDefaultSubId, state, isDataConnectivityPossible,
        notifyDataConnectionForSubscriber(mDefaultSubId, state, isDataConnectivityPossible,
            reason, apn, apnType, linkProperties,
            reason, apn, apnType, linkProperties,
            networkCapabilities, networkType, roaming);
            networkCapabilities, networkType, roaming);
    }
    }


    public void notifyDataConnectionUsingSubId(long subId, int state,
    public void notifyDataConnectionForSubscriber(long subId, int state,
            boolean isDataConnectivityPossible, String reason, String apn, String apnType,
            boolean isDataConnectivityPossible, String reason, String apn, String apnType,
            LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
            LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
            int networkType, boolean roaming) {
            int networkType, boolean roaming) {
@@ -844,7 +844,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyDataConnectionUsingSubId: subId=" + subId
            log("notifyDataConnectionForSubscriber: subId=" + subId
                + " state=" + state + " isDataConnectivityPossible=" + isDataConnectivityPossible
                + " state=" + state + " isDataConnectivityPossible=" + isDataConnectivityPossible
                + " reason='" + reason
                + " reason='" + reason
                + "' apn='" + apn + "' apnType=" + apnType + " networkType=" + networkType
                + "' apn='" + apn + "' apnType=" + apnType + " networkType=" + networkType
@@ -921,16 +921,16 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyDataConnectionFailed(String reason, String apnType) {
    public void notifyDataConnectionFailed(String reason, String apnType) {
         notifyDataConnectionFailedUsingSubId(mDefaultSubId, reason, apnType);
         notifyDataConnectionFailedForSubscriber(mDefaultSubId, reason, apnType);
    }
    }


    public void notifyDataConnectionFailedUsingSubId(long subId,
    public void notifyDataConnectionFailedForSubscriber(long subId,
            String reason, String apnType) {
            String reason, String apnType) {
        if (!checkNotifyPermission("notifyDataConnectionFailed()")) {
        if (!checkNotifyPermission("notifyDataConnectionFailed()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyDataConnectionFailedUsingSubId: subId=" + subId
            log("notifyDataConnectionFailedForSubscriber: subId=" + subId
                + " reason=" + reason + " apnType=" + apnType);
                + " reason=" + reason + " apnType=" + apnType);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
@@ -954,17 +954,17 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyCellLocation(Bundle cellLocation) {
    public void notifyCellLocation(Bundle cellLocation) {
         notifyCellLocationUsingSubId(mDefaultSubId, cellLocation);
         notifyCellLocationForSubscriber(mDefaultSubId, cellLocation);
    }
    }


    public void notifyCellLocationUsingSubId(long subId, Bundle cellLocation) {
    public void notifyCellLocationForSubscriber(long subId, Bundle cellLocation) {
        log("notifyCellLocationUsingSubId: subId=" + subId
        log("notifyCellLocationForSubscriber: subId=" + subId
                + " cellLocation=" + cellLocation);
                + " cellLocation=" + cellLocation);
        if (!checkNotifyPermission("notifyCellLocation()")) {
        if (!checkNotifyPermission("notifyCellLocation()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyCellLocationUsingSubId: subId=" + subId
            log("notifyCellLocationForSubscriber: subId=" + subId
                + " cellLocation=" + cellLocation);
                + " cellLocation=" + cellLocation);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
+6 −6
Original line number Original line Diff line number Diff line
@@ -265,9 +265,9 @@ public class SubscriptionManager implements BaseColumns {
     * @return SubInfoRecord, maybe null
     * @return SubInfoRecord, maybe null
     * @hide - to be unhidden
     * @hide - to be unhidden
     */
     */
    public static SubInfoRecord getSubInfoUsingSubId(long subId) {
    public static SubInfoRecord getSubInfoForSubscriber(long subId) {
        if (!isValidSubId(subId)) {
        if (!isValidSubId(subId)) {
            logd("[getSubInfoUsingSubIdx]- invalid subId");
            logd("[getSubInfoForSubscriberx]- invalid subId");
            return null;
            return null;
        }
        }


@@ -276,7 +276,7 @@ public class SubscriptionManager implements BaseColumns {
        try {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
            if (iSub != null) {
                subInfo = iSub.getSubInfoUsingSubId(subId);
                subInfo = iSub.getSubInfoForSubscriber(subId);
            }
            }
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // ignore it
            // ignore it
@@ -783,7 +783,7 @@ public class SubscriptionManager implements BaseColumns {


    /** @hide */
    /** @hide */
    public static SubInfoRecord getDefaultVoiceSubInfo() {
    public static SubInfoRecord getDefaultVoiceSubInfo() {
        return getSubInfoUsingSubId(getDefaultVoiceSubId());
        return getSubInfoForSubscriber(getDefaultVoiceSubId());
    }
    }


    /** @hide */
    /** @hide */
@@ -826,7 +826,7 @@ public class SubscriptionManager implements BaseColumns {


    /** @hide */
    /** @hide */
    public static SubInfoRecord getDefaultSmsSubInfo() {
    public static SubInfoRecord getDefaultSmsSubInfo() {
        return getSubInfoUsingSubId(getDefaultSmsSubId());
        return getSubInfoForSubscriber(getDefaultSmsSubId());
    }
    }


    /** @hide */
    /** @hide */
@@ -866,7 +866,7 @@ public class SubscriptionManager implements BaseColumns {


    /** @hide */
    /** @hide */
    public static SubInfoRecord getDefaultDataSubInfo() {
    public static SubInfoRecord getDefaultDataSubInfo() {
        return getSubInfoUsingSubId(getDefaultDataSubId());
        return getSubInfoForSubscriber(getDefaultDataSubId());
    }
    }


    /** @hide */
    /** @hide */
+24 −24
Original line number Original line Diff line number Diff line
@@ -608,7 +608,7 @@ public class TelephonyManager {
    public String getDeviceId(int slotId) {
    public String getDeviceId(int slotId) {
        long[] subId = SubscriptionManager.getSubId(slotId);
        long[] subId = SubscriptionManager.getSubId(slotId);
        try {
        try {
            return getSubscriberInfo().getDeviceIdUsingSubId(subId[0]);
            return getSubscriberInfo().getDeviceIdForSubscriber(subId[0]);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -639,7 +639,7 @@ public class TelephonyManager {
    public String getImei(int slotId) {
    public String getImei(int slotId) {
        long[] subId = SubscriptionManager.getSubId(slotId);
        long[] subId = SubscriptionManager.getSubId(slotId);
        try {
        try {
            return getSubscriberInfo().getImeiUsingSubId(subId[0]);
            return getSubscriberInfo().getImeiForSubscriber(subId[0]);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -703,7 +703,7 @@ public class TelephonyManager {
    /** @hide */
    /** @hide */
    public void enableLocationUpdates(long subId) {
    public void enableLocationUpdates(long subId) {
        try {
        try {
            getITelephony().enableLocationUpdatesUsingSubId(subId);
            getITelephony().enableLocationUpdatesForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
        }
        }
@@ -725,7 +725,7 @@ public class TelephonyManager {
    /** @hide */
    /** @hide */
    public void disableLocationUpdates(long subId) {
    public void disableLocationUpdates(long subId) {
        try {
        try {
            getITelephony().disableLocationUpdatesUsingSubId(subId);
            getITelephony().disableLocationUpdatesForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
        }
        }
@@ -793,7 +793,7 @@ public class TelephonyManager {
        try{
        try{
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                return telephony.getActivePhoneTypeUsingSubId(subId);
                return telephony.getActivePhoneTypeForSubscriber(subId);
            } else {
            } else {
                // This can happen when the ITelephony interface is not up yet.
                // This can happen when the ITelephony interface is not up yet.
                return getPhoneTypeFromProperty(subId);
                return getPhoneTypeFromProperty(subId);
@@ -1159,7 +1159,7 @@ public class TelephonyManager {
       try {
       try {
           ITelephony telephony = getITelephony();
           ITelephony telephony = getITelephony();
           if (telephony != null) {
           if (telephony != null) {
               return telephony.getNetworkTypeUsingSubId(subId);
               return telephony.getNetworkTypeForSubscriber(subId);
           } else {
           } else {
               // This can happen when the ITelephony interface is not up yet.
               // This can happen when the ITelephony interface is not up yet.
               return NETWORK_TYPE_UNKNOWN;
               return NETWORK_TYPE_UNKNOWN;
@@ -1213,7 +1213,7 @@ public class TelephonyManager {
        try{
        try{
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                return telephony.getDataNetworkTypeUsingSubId(subId);
                return telephony.getDataNetworkTypeForSubscriber(subId);
            } else {
            } else {
                // This can happen when the ITelephony interface is not up yet.
                // This can happen when the ITelephony interface is not up yet.
                return NETWORK_TYPE_UNKNOWN;
                return NETWORK_TYPE_UNKNOWN;
@@ -1245,7 +1245,7 @@ public class TelephonyManager {
        try{
        try{
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null) {
            if (telephony != null) {
                return telephony.getVoiceNetworkTypeUsingSubId(subId);
                return telephony.getVoiceNetworkTypeForSubscriber(subId);
            } else {
            } else {
                // This can happen when the ITelephony interface is not up yet.
                // This can happen when the ITelephony interface is not up yet.
                return NETWORK_TYPE_UNKNOWN;
                return NETWORK_TYPE_UNKNOWN;
@@ -1572,7 +1572,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getSimSerialNumber(long subId) {
    public String getSimSerialNumber(long subId) {
        try {
        try {
            return getSubscriberInfo().getIccSerialNumberUsingSubId(subId);
            return getSubscriberInfo().getIccSerialNumberForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1608,7 +1608,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public int getLteOnCdmaMode(long subId) {
    public int getLteOnCdmaMode(long subId) {
        try {
        try {
            return getITelephony().getLteOnCdmaModeUsingSubId(subId);
            return getITelephony().getLteOnCdmaModeForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // Assume no ICC card if remote exception which shouldn't happen
            // Assume no ICC card if remote exception which shouldn't happen
            return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
            return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
@@ -1648,7 +1648,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getSubscriberId(long subId) {
    public String getSubscriberId(long subId) {
        try {
        try {
            return getSubscriberInfo().getSubscriberIdUsingSubId(subId);
            return getSubscriberInfo().getSubscriberIdForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1687,7 +1687,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getGroupIdLevel1(long subId) {
    public String getGroupIdLevel1(long subId) {
        try {
        try {
            return getSubscriberInfo().getGroupIdLevel1UsingSubId(subId);
            return getSubscriberInfo().getGroupIdLevel1ForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1728,7 +1728,7 @@ public class TelephonyManager {
            return number;
            return number;
        }
        }
        try {
        try {
            return getSubscriberInfo().getLine1NumberUsingSubId(subId);
            return getSubscriberInfo().getLine1NumberForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1811,7 +1811,7 @@ public class TelephonyManager {
            return alphaTag;
            return alphaTag;
        }
        }
        try {
        try {
            return getSubscriberInfo().getLine1AlphaTagUsingSubId(subId);
            return getSubscriberInfo().getLine1AlphaTagForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1845,7 +1845,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getMsisdn(long subId) {
    public String getMsisdn(long subId) {
        try {
        try {
            return getSubscriberInfo().getMsisdnUsingSubId(subId);
            return getSubscriberInfo().getMsisdnForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1875,7 +1875,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getVoiceMailNumber(long subId) {
    public String getVoiceMailNumber(long subId) {
        try {
        try {
            return getSubscriberInfo().getVoiceMailNumberUsingSubId(subId);
            return getSubscriberInfo().getVoiceMailNumberForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1907,7 +1907,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getCompleteVoiceMailNumber(long subId) {
    public String getCompleteVoiceMailNumber(long subId) {
        try {
        try {
            return getSubscriberInfo().getCompleteVoiceMailNumberUsingSubId(subId);
            return getSubscriberInfo().getCompleteVoiceMailNumberForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1937,7 +1937,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public int getVoiceMessageCount(long subId) {
    public int getVoiceMessageCount(long subId) {
        try {
        try {
            return getITelephony().getVoiceMessageCountUsingSubId(subId);
            return getITelephony().getVoiceMessageCountForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return 0;
            return 0;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1969,7 +1969,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getVoiceMailAlphaTag(long subId) {
    public String getVoiceMailAlphaTag(long subId) {
        try {
        try {
            return getSubscriberInfo().getVoiceMailAlphaTagUsingSubId(subId);
            return getSubscriberInfo().getVoiceMailAlphaTagForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2059,7 +2059,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public int getCallState(long subId) {
    public int getCallState(long subId) {
        try {
        try {
            return getITelephony().getCallStateUsingSubId(subId);
            return getITelephony().getCallStateForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // the phone process is restarting.
            // the phone process is restarting.
            return CALL_STATE_IDLE;
            return CALL_STATE_IDLE;
@@ -2181,7 +2181,7 @@ public class TelephonyManager {
        String pkgForDebug = mContext != null ? mContext.getPackageName() : "<unknown>";
        String pkgForDebug = mContext != null ? mContext.getPackageName() : "<unknown>";
        try {
        try {
            Boolean notifyNow = (getITelephony() != null);
            Boolean notifyNow = (getITelephony() != null);
            sRegistry.listenUsingSubId(listener.mSubId, pkgForDebug, listener.callback, events, notifyNow);
            sRegistry.listenForSubscriber(listener.mSubId, pkgForDebug, listener.callback, events, notifyNow);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // system process dead
            // system process dead
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2204,7 +2204,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public int getCdmaEriIconIndex(long subId) {
    public int getCdmaEriIconIndex(long subId) {
        try {
        try {
            return getITelephony().getCdmaEriIconIndexUsingSubId(subId);
            return getITelephony().getCdmaEriIconIndexForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // the phone process is restarting.
            // the phone process is restarting.
            return -1;
            return -1;
@@ -2232,7 +2232,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public int getCdmaEriIconMode(long subId) {
    public int getCdmaEriIconMode(long subId) {
        try {
        try {
            return getITelephony().getCdmaEriIconModeUsingSubId(subId);
            return getITelephony().getCdmaEriIconModeForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // the phone process is restarting.
            // the phone process is restarting.
            return -1;
            return -1;
@@ -2257,7 +2257,7 @@ public class TelephonyManager {
    /** {@hide} */
    /** {@hide} */
    public String getCdmaEriText(long subId) {
    public String getCdmaEriText(long subId) {
        try {
        try {
            return getITelephony().getCdmaEriTextUsingSubId(subId);
            return getITelephony().getCdmaEriTextForSubscriber(subId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            // the phone process is restarting.
            // the phone process is restarting.
            return null;
            return null;
+11 −11

File changed.

Preview size limit exceeded, changes collapsed.

+14 −14

File changed.

Preview size limit exceeded, changes collapsed.

Loading