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

Commit e5b4c121 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am 4dec130c: Merge "Change subId to int from long" into lmp-mr1-dev

* commit '4dec130c':
  Change subId to int from long
parents 8e250576 4dec130c
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -28715,8 +28715,8 @@ package android.telephony {
    method public void downloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent);
    method public android.os.Bundle getCarrierConfigValues();
    method public static android.telephony.SmsManager getDefault();
    method public static android.telephony.SmsManager getSmsManagerForSubscriber(long);
    method public long getSubId();
    method public static android.telephony.SmsManager getSmsManagerForSubscriber(int);
    method public int getSubId();
    method public void injectSmsPdu(byte[], java.lang.String, android.app.PendingIntent);
    method public void sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent);
    method public void sendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent);
@@ -28834,7 +28834,7 @@ package android.telephony {
  public class SubInfoRecord implements android.os.Parcelable {
    ctor public SubInfoRecord();
    ctor public SubInfoRecord(long, java.lang.String, int, java.lang.String, int, int, java.lang.String, int, int, int[], int, int);
    ctor public SubInfoRecord(int, java.lang.String, int, java.lang.String, int, int, java.lang.String, int, int, int[], int, int);
    method public int describeContents();
    method public int getColor();
    method public android.graphics.drawable.BitmapDrawable getIconDrawable();
@@ -28852,22 +28852,22 @@ package android.telephony {
    field public java.lang.String number;
    field public int[] simIconRes;
    field public int slotId;
    field public long subId;
    field public int subId;
  }
  public class SubscriptionManager implements android.provider.BaseColumns {
    method public static java.util.List<android.telephony.SubInfoRecord> getActiveSubInfoList();
    method public static long getDefaultSmsSubId();
    method public static int getSlotId(long);
    method public static android.telephony.SubInfoRecord getSubInfoForSubscriber(long);
    method public static int getDefaultSmsSubId();
    method public static int getSlotId(int);
    method public static android.telephony.SubInfoRecord getSubInfoForSubscriber(int);
    method public static java.util.List<android.telephony.SubInfoRecord> getSubInfoUsingSlotId(int);
    method public static boolean isValidSubId(long);
    field public static final long ASK_USER_SUB_ID = -1001L; // 0xfffffffffffffc17L
    method public static boolean isValidSubId(int);
    field public static final int ASK_USER_SUB_ID = -1001; // 0xfffffc17
    field public static final int DEFAULT_PHONE_ID = 2147483647; // 0x7fffffff
    field public static final long DEFAULT_SUB_ID = 9223372036854775807L; // 0x7fffffffffffffffL
    field public static final int DEFAULT_SUB_ID = 2147483647; // 0x7fffffff
    field public static final int INVALID_PHONE_ID = -1000; // 0xfffffc18
    field public static final int INVALID_SLOT_ID = -1000; // 0xfffffc18
    field public static final long INVALID_SUB_ID = -1000L; // 0xfffffffffffffc18L
    field public static final int INVALID_SUB_ID = -1000; // 0xfffffc18
    field public static final java.lang.String MCC = "mcc";
    field public static final java.lang.String MNC = "mnc";
    field public static final int SIM_NOT_INSERTED = -1; // 0xffffffff
+4 −4
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ public class MmsServiceBroker extends SystemService {
    // Service API calls implementation, proxied to the real MmsService in "com.android.mms.service"
    private final class BinderService extends IMms.Stub {
        @Override
        public void sendMessage(long subId, String callingPkg, Uri contentUri,
        public void sendMessage(int subId, String callingPkg, Uri contentUri,
                String locationUrl, Bundle configOverrides, PendingIntent sentIntent)
                        throws RemoteException {
            mContext.enforceCallingPermission(Manifest.permission.SEND_SMS, "Send MMS message");
@@ -232,7 +232,7 @@ public class MmsServiceBroker extends SystemService {
        }

        @Override
        public void downloadMessage(long subId, String callingPkg, String locationUrl,
        public void downloadMessage(int subId, String callingPkg, String locationUrl,
                Uri contentUri, Bundle configOverrides,
                PendingIntent downloadedIntent) throws RemoteException {
            mContext.enforceCallingPermission(Manifest.permission.RECEIVE_MMS,
@@ -259,7 +259,7 @@ public class MmsServiceBroker extends SystemService {
        }

        @Override
        public Bundle getCarrierConfigValues(long subId) throws RemoteException {
        public Bundle getCarrierConfigValues(int subId) throws RemoteException {
            return getServiceGuarded().getCarrierConfigValues(subId);
        }

@@ -360,7 +360,7 @@ public class MmsServiceBroker extends SystemService {
        }

        @Override
        public void sendStoredMessage(long subId, String callingPkg, Uri messageUri,
        public void sendStoredMessage(int subId, String callingPkg, Uri messageUri,
                Bundle configOverrides, PendingIntent sentIntent) throws RemoteException {
            mContext.enforceCallingPermission(Manifest.permission.SEND_SMS,
                    "Send stored MMS message");
+27 −27
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ import com.android.server.am.BatteryStatsService;
 * and 15973975 by saving the phoneId of the registrant and then using the
 * phoneId when deciding to to make a callback. This is necessary because
 * a subId changes from to a dummy value when a SIM is removed and thus won't
 * compare properly. Because SubscriptionManager.getPhoneId(long subId) handles
 * compare properly. Because SubscriptionManager.getPhoneId(int subId) handles
 * the dummy value conversion we properly do the callbacks.
 *
 * Eventually we may want to remove the notion of dummy value but for now this
@@ -95,7 +95,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {

        int events;

        long subId;
        int subId;

        int phoneId;

@@ -154,7 +154,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {

    private VoLteServiceState mVoLteServiceState = new VoLteServiceState();

    private long mDefaultSubId = SubscriptionManager.INVALID_SUB_ID;
    private int mDefaultSubId = SubscriptionManager.INVALID_SUB_ID;

    private int mDefaultPhoneId = SubscriptionManager.INVALID_PHONE_ID;

@@ -201,7 +201,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                }
                case MSG_UPDATE_DEFAULT_SUB: {
                    int newDefaultPhoneId = msg.arg1;
                    long newDefaultSubId = (Long)(msg.obj);
                    int newDefaultSubId = (Integer)(msg.obj);
                    if (VDBG) {
                        log("MSG_UPDATE_DEFAULT_SUB:current mDefaultSubId=" + mDefaultSubId
                            + " current mDefaultPhoneId=" + mDefaultPhoneId + " newDefaultSubId= "
@@ -236,7 +236,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                if (DBG) log("onReceive: userHandle=" + userHandle);
                mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, userHandle, 0));
            } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) {
                Long newDefaultSubIdObj = new Long(intent.getLongExtra(
                Integer newDefaultSubIdObj = new Integer(intent.getIntExtra(
                        PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.getDefaultSubId()));
                int newDefaultPhoneId = intent.getIntExtra(PhoneConstants.SLOT_KEY,
                    SubscriptionManager.getPhoneId(mDefaultSubId));
@@ -332,13 +332,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }

    @Override
    public void listenForSubscriber(long subId, String pkgForDebug, IPhoneStateListener callback,
    public void listenForSubscriber(int subId, String pkgForDebug, IPhoneStateListener callback,
            int events, boolean notifyNow) {
        listen(pkgForDebug, callback, events, notifyNow, subId);
    }

    private void listen(String pkgForDebug, IPhoneStateListener callback, int events,
            boolean notifyNow, long subId) {
            boolean notifyNow, int subId) {
        int callerUid = UserHandle.getCallingUserId();
        int myUid = UserHandle.myUserId();
        if (VDBG) {
@@ -545,7 +545,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        broadcastCallStateChanged(state, incomingNumber, SubscriptionManager.DEFAULT_SUB_ID);
    }

    public void notifyCallStateForSubscriber(long subId, int state, String incomingNumber) {
    public void notifyCallStateForSubscriber(int subId, int state, String incomingNumber) {
        if (!checkNotifyPermission("notifyCallState()")) {
            return;
        }
@@ -575,7 +575,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        broadcastCallStateChanged(state, incomingNumber, subId);
    }

    public void notifyServiceStateForPhoneId(int phoneId, long subId, ServiceState state) {
    public void notifyServiceStateForPhoneId(int phoneId, int subId, ServiceState state) {
        if (!checkNotifyPermission("notifyServiceState()")){
            return;
        }
@@ -621,7 +621,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        notifySignalStrengthForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, signalStrength);
    }

    public void notifySignalStrengthForSubscriber(long subId, SignalStrength signalStrength) {
    public void notifySignalStrengthForSubscriber(int subId, SignalStrength signalStrength) {
        if (!checkNotifyPermission("notifySignalStrength()")) {
            return;
        }
@@ -681,7 +681,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
         notifyCellInfoForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, cellInfo);
    }

    public void notifyCellInfoForSubscriber(long subId, List<CellInfo> cellInfo) {
    public void notifyCellInfoForSubscriber(int subId, List<CellInfo> cellInfo) {
        if (!checkNotifyPermission("notifyCellInfo()")) {
            return;
        }
@@ -738,7 +738,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }

    @Override
    public void notifyMessageWaitingChangedForPhoneId(int phoneId, long subId, boolean mwi) {
    public void notifyMessageWaitingChangedForPhoneId(int phoneId, int subId, boolean mwi) {
        if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
            return;
        }
@@ -768,7 +768,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        notifyCallForwardingChangedForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, cfi);
    }

    public void notifyCallForwardingChangedForSubscriber(long subId, boolean cfi) {
    public void notifyCallForwardingChangedForSubscriber(int subId, boolean cfi) {
        if (!checkNotifyPermission("notifyCallForwardingChanged()")) {
            return;
        }
@@ -799,7 +799,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        notifyDataActivityForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, state);
    }

    public void notifyDataActivityForSubscriber(long subId, int state) {
    public void notifyDataActivityForSubscriber(int subId, int state) {
        if (!checkNotifyPermission("notifyDataActivity()" )) {
            return;
        }
@@ -827,7 +827,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
            networkCapabilities, networkType, roaming);
    }

    public void notifyDataConnectionForSubscriber(long subId, int state,
    public void notifyDataConnectionForSubscriber(int subId, int state,
            boolean isDataConnectivityPossible, String reason, String apn, String apnType,
            LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
            int networkType, boolean roaming) {
@@ -916,7 +916,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                 reason, apnType);
    }

    public void notifyDataConnectionFailedForSubscriber(long subId,
    public void notifyDataConnectionFailedForSubscriber(int subId,
            String reason, String apnType) {
        if (!checkNotifyPermission("notifyDataConnectionFailed()")) {
            return;
@@ -949,7 +949,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
         notifyCellLocationForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, cellLocation);
    }

    public void notifyCellLocationForSubscriber(long subId, Bundle cellLocation) {
    public void notifyCellLocationForSubscriber(int subId, Bundle cellLocation) {
        log("notifyCellLocationForSubscriber: subId=" + subId
                + " cellLocation=" + cellLocation);
        if (!checkNotifyPermission("notifyCellLocation()")) {
@@ -1096,7 +1096,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
    }

    public void notifyOemHookRawEventForSubscriber(long subId, byte[] rawData) {
    public void notifyOemHookRawEventForSubscriber(int subId, byte[] rawData) {
        if (!checkNotifyPermission("notifyOemHookRawEventForSubscriber")) {
            return;
        }
@@ -1162,7 +1162,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    // the legacy intent broadcasting
    //

    private void broadcastServiceStateChanged(ServiceState state, long subId) {
    private void broadcastServiceStateChanged(ServiceState state, int subId) {
        long ident = Binder.clearCallingIdentity();
        try {
            mBatteryStats.notePhoneState(state.getState());
@@ -1181,7 +1181,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
    }

    private void broadcastSignalStrengthChanged(SignalStrength signalStrength, long subId) {
    private void broadcastSignalStrengthChanged(SignalStrength signalStrength, int subId) {
        long ident = Binder.clearCallingIdentity();
        try {
            mBatteryStats.notePhoneSignalStrength(signalStrength);
@@ -1200,7 +1200,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
    }

    private void broadcastCallStateChanged(int state, String incomingNumber, long subId) {
    private void broadcastCallStateChanged(int state, String incomingNumber, int subId) {
        long ident = Binder.clearCallingIdentity();
        try {
            if (state == TelephonyManager.CALL_STATE_IDLE) {
@@ -1228,7 +1228,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    private void broadcastDataConnectionStateChanged(int state,
            boolean isDataConnectivityPossible,
            String reason, String apn, String apnType, LinkProperties linkProperties,
            NetworkCapabilities networkCapabilities, boolean roaming, long subId) {
            NetworkCapabilities networkCapabilities, boolean roaming, int subId) {
        // Note: not reporting to the battery stats service here, because the
        // status bar takes care of that after taking into account all of the
        // required info.
@@ -1260,7 +1260,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }

    private void broadcastDataConnectionFailed(String reason, String apnType,
            long subId) {
            int subId) {
        Intent intent = new Intent(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED);
        intent.putExtra(PhoneConstants.FAILURE_REASON_KEY, reason);
        intent.putExtra(PhoneConstants.DATA_APN_TYPE_KEY, apnType);
@@ -1376,11 +1376,11 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    private static class LogSSC {
        private Time mTime;
        private String mS;
        private long mSubId;
        private int mSubId;
        private int mPhoneId;
        private ServiceState mState;

        public void set(Time t, String s, long subId, int phoneId, ServiceState state) {
        public void set(Time t, String s, int subId, int phoneId, ServiceState state) {
            mTime = t; mS = s; mSubId = subId; mPhoneId = phoneId; mState = state;
        }

@@ -1393,7 +1393,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    private LogSSC logSSC [] = new LogSSC[10];
    private int next = 0;

    private void logServiceStateChanged(String s, long subId, int phoneId, ServiceState state) {
    private void logServiceStateChanged(String s, int subId, int phoneId, ServiceState state) {
        if (logSSC == null || logSSC.length == 0) {
            return;
        }
@@ -1429,7 +1429,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
    }

    boolean subIdMatch(long rSubId, long subId) {
    boolean subIdMatch(int rSubId, int subId) {
        if(rSubId == SubscriptionManager.DEFAULT_SUB_ID) {
            return (subId == mDefaultSubId);
        } else {
+11 −11
Original line number Diff line number Diff line
@@ -1570,7 +1570,7 @@ public class PhoneNumberUtils
     *         listed in the RIL / SIM, otherwise return false.
     * @hide
     */
    public static boolean isEmergencyNumber(long subId, String number) {
    public static boolean isEmergencyNumber(int subId, String number) {
        // Return true only if the specified number *exactly* matches
        // one of the emergency numbers listed by the RIL / SIM.
        return isEmergencyNumberInternal(subId, number, true /* useExactMatch */);
@@ -1620,7 +1620,7 @@ public class PhoneNumberUtils
     *         same digits as any of those emergency numbers.
     * @hide
     */
    public static boolean isPotentialEmergencyNumber(long subId, String number) {
    public static boolean isPotentialEmergencyNumber(int subId, String number) {
        // Check against the emergency numbers listed by the RIL / SIM,
        // and *don't* require an exact match.
        return isEmergencyNumberInternal(subId, number, false /* useExactMatch */);
@@ -1669,7 +1669,7 @@ public class PhoneNumberUtils
     * @return true if the number is in the list of emergency numbers
     *         listed in the RIL / sim, otherwise return false.
     */
    private static boolean isEmergencyNumberInternal(long subId, String number,
    private static boolean isEmergencyNumberInternal(int subId, String number,
            boolean useExactMatch) {
        return isEmergencyNumberInternal(subId, number, null, useExactMatch);
    }
@@ -1698,7 +1698,7 @@ public class PhoneNumberUtils
     * otherwise false
     * @hide
     */
    public static boolean isEmergencyNumber(long subId, String number, String defaultCountryIso) {
    public static boolean isEmergencyNumber(int subId, String number, String defaultCountryIso) {
        return isEmergencyNumberInternal(subId, number,
                                         defaultCountryIso,
                                         true /* useExactMatch */);
@@ -1750,7 +1750,7 @@ public class PhoneNumberUtils
     *         any of those emergency numbers.
     * @hide
     */
    public static boolean isPotentialEmergencyNumber(long subId, String number,
    public static boolean isPotentialEmergencyNumber(int subId, String number,
            String defaultCountryIso) {
        return isEmergencyNumberInternal(subId, number,
                                         defaultCountryIso,
@@ -1794,7 +1794,7 @@ public class PhoneNumberUtils
     * @return true if the number is an emergency number for the specified country.
     * @hide
     */
    private static boolean isEmergencyNumberInternal(long subId, String number,
    private static boolean isEmergencyNumberInternal(int subId, String number,
                                                     String defaultCountryIso,
                                                     boolean useExactMatch) {
        // If the number passed in is null, just return false:
@@ -1911,7 +1911,7 @@ public class PhoneNumberUtils
     * is currently in.
     * @hide
     */
    public static boolean isLocalEmergencyNumber(Context context, long subId, String number) {
    public static boolean isLocalEmergencyNumber(Context context, int subId, String number) {
        return isLocalEmergencyNumberInternal(subId, number,
                                              context,
                                              true /* useExactMatch */);
@@ -1965,7 +1965,7 @@ public class PhoneNumberUtils
     *
     * @hide
     */
    public static boolean isPotentialLocalEmergencyNumber(Context context, long subId,
    public static boolean isPotentialLocalEmergencyNumber(Context context, int subId,
            String number) {
        return isLocalEmergencyNumberInternal(subId, number,
                                              context,
@@ -2014,7 +2014,7 @@ public class PhoneNumberUtils
     *              local country, based on the CountryDetector.
     * @hide
     */
    private static boolean isLocalEmergencyNumberInternal(long subId, String number,
    private static boolean isLocalEmergencyNumberInternal(int subId, String number,
                                                          Context context,
                                                          boolean useExactMatch) {
        String countryIso;
@@ -2057,7 +2057,7 @@ public class PhoneNumberUtils
     * to read the VM number.
     * @hide
     */
    public static boolean isVoiceMailNumber(long subId, String number) {
    public static boolean isVoiceMailNumber(int subId, String number) {
        String vmNumber;

        try {
@@ -2796,7 +2796,7 @@ public class PhoneNumberUtils
    /**
     * Returns Default voice subscription Id.
     */
    private static long getDefaultVoiceSubId() {
    private static int getDefaultVoiceSubId() {
        return SubscriptionManager.getDefaultVoiceSubId();
    }
    //==== End of utility methods used only in compareStrictly() =====
+4 −4
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ public class PhoneStateListener {
     * @hide
     */
    /** @hide */
    protected long mSubId = SubscriptionManager.INVALID_SUB_ID;
    protected int mSubId = SubscriptionManager.INVALID_SUB_ID;

    private final Handler mHandler;

@@ -252,10 +252,10 @@ public class PhoneStateListener {
    /**
     * Create a PhoneStateListener for the Phone using the specified subscription.
     * This class requires Looper.myLooper() not return null. To supply your
     * own non-null Looper use PhoneStateListener(long subId, Looper looper) below.
     * own non-null Looper use PhoneStateListener(int subId, Looper looper) below.
     * @hide
     */
    public PhoneStateListener(long subId) {
    public PhoneStateListener(int subId) {
        this(subId, Looper.myLooper());
    }

@@ -264,7 +264,7 @@ public class PhoneStateListener {
     * and non-null Looper.
     * @hide
     */
    public PhoneStateListener(long subId, Looper looper) {
    public PhoneStateListener(int subId, Looper looper) {
        if (DBG) log("ctor: subId=" + subId + " looper=" + looper);
        mSubId = subId;
        mHandler = new Handler(looper) {
Loading