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

Commit 43c50293 authored by xinhe's avatar xinhe
Browse files

Fix for empty RSSI triangle after boot

After device bootup, the signal strength triangle is empty although there is
both voice and data connection. This is due to when TelephonyRegistry doing call
back listen register, some APP use mDefaultSubID. However, when the reigister
happen, the mDefaultSubId does not exist. Althouhgh it can be update later, if
the update event comes too late (especially after the steady state), no
ServiceStatechange event can be received anymore. Thus the service is always not
available and the signal stength trangle has no chance to be updated anymore.
This is a risk condition.

Bug:17472622

Change-Id: I772d29e6dd9da212b78fd0d4438b8273e3318dba
parent 36e793c7
Loading
Loading
Loading
Loading
+60 −97
Original line number Original line Diff line number Diff line
@@ -99,8 +99,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {


        int phoneId;
        int phoneId;


        boolean isLegacyApp;

        @Override
        @Override
        public String toString() {
        public String toString() {
            return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + " subId=" + subId +
            return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + " subId=" + subId +
@@ -156,10 +154,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {


    private VoLteServiceState mVoLteServiceState = new VoLteServiceState();
    private VoLteServiceState mVoLteServiceState = new VoLteServiceState();


    private long mDefaultSubId;

    private int mDefaultPhoneIdForDefaultSubId;

    private DataConnectionRealTimeInfo mDcRtInfo = new DataConnectionRealTimeInfo();
    private DataConnectionRealTimeInfo mDcRtInfo = new DataConnectionRealTimeInfo();


    private int mRingingCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
    private int mRingingCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
@@ -201,23 +195,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    }
                    }
                    break;
                    break;
                }
                }
                case MSG_UPDATE_DEFAULT_SUB: {
                case MSG_UPDATE_DEFAULT_SUB: {// do nothing
                    if (VDBG) {
                    if (VDBG) log(TAG + "MSG_UPDATE_DEFAULT_SUB");
                        log("MSG_UPDATE_DEFAULT_SUB subid=" + mDefaultSubId
                                + " phoneId=" + mDefaultPhoneIdForDefaultSubId);
                    }
                    // Default subscription id changed, update the changed default subscription
                    // id in  all the legacy application listener records.
                    synchronized (mRecords) {
                        for (Record r : mRecords) {
                            // FIXME: Be sure we're using isLegacyApp correctly!
                            if (r.isLegacyApp == true) {
                                r.subId = mDefaultSubId;
                                r.phoneId = mDefaultPhoneIdForDefaultSubId;
                            }
                        }
                    }
                    break;
                }
                }
            }
            }
        }
        }
@@ -233,13 +212,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                if (DBG) log("onReceive: userHandle=" + userHandle);
                if (DBG) log("onReceive: userHandle=" + userHandle);
                mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, userHandle, 0));
                mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, userHandle, 0));
            } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) {
            } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) {
                mDefaultSubId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY,
                        SubscriptionManager.getDefaultSubId());
                mDefaultPhoneIdForDefaultSubId = intent.getIntExtra(PhoneConstants.SLOT_KEY,
                        SubscriptionManager.getPhoneId(mDefaultSubId));
                if (DBG) {
                if (DBG) {
                    log("onReceive: mDefaultSubId=" + mDefaultSubId
                    log(TAG + "onReceive: ACTION_DEFAULT_SUBSCRIPTION_CHANGED");
                            + " mDefaultPhoneIdForDefaultSubId=" + mDefaultPhoneIdForDefaultSubId);
                }
                }
                mHandler.sendMessage(mHandler.obtainMessage(MSG_UPDATE_DEFAULT_SUB, 0, 0));
                mHandler.sendMessage(mHandler.obtainMessage(MSG_UPDATE_DEFAULT_SUB, 0, 0));
            }
            }
@@ -260,10 +234,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        mBatteryStats = BatteryStatsService.getService();
        mBatteryStats = BatteryStatsService.getService();
        mConnectedApns = new ArrayList<String>();
        mConnectedApns = new ArrayList<String>();


        // Initialize default subId and its phoneId.
        mDefaultSubId = SubscriptionManager.getDefaultSubId();
        mDefaultPhoneIdForDefaultSubId = SubscriptionManager.getPhoneId(mDefaultSubId);

        int numPhones = TelephonyManager.getDefault().getPhoneCount();
        int numPhones = TelephonyManager.getDefault().getPhoneCount();
        if (DBG) log("TelephonyRegistor: ctor numPhones=" + numPhones);
        if (DBG) log("TelephonyRegistor: ctor numPhones=" + numPhones);
        mNumPhones = numPhones;
        mNumPhones = numPhones;
@@ -322,25 +292,23 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    @Override
    @Override
    public void listen(String pkgForDebug, IPhoneStateListener callback, int events,
    public void listen(String pkgForDebug, IPhoneStateListener callback, int events,
            boolean notifyNow) {
            boolean notifyNow) {
        listen(pkgForDebug, callback, events, notifyNow, mDefaultSubId, true);
        listenForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, pkgForDebug, callback, events,
            notifyNow);
    }
    }


    @Override
    @Override
    public void listenForSubscriber(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);
    }
    }


    private void listen(String pkgForDebug, IPhoneStateListener callback, int events,
    private void listen(String pkgForDebug, IPhoneStateListener callback, int events,
            boolean notifyNow, long subId, boolean isLegacyApp) {
            boolean notifyNow, long subId) {
        int callerUid = UserHandle.getCallingUserId();
        int callerUid = UserHandle.getCallingUserId();
        int myUid = UserHandle.myUserId();
        int myUid = UserHandle.myUserId();
        int phoneId = SubscriptionManager.getPhoneId(subId);
        if (VDBG) {
        if (VDBG) {
            log("listen: E pkg=" + pkgForDebug + " events=0x" + Integer.toHexString(events)
            log("listen: E pkg=" + pkgForDebug + " events=0x" + Integer.toHexString(events)
                + " notifyNow=" + notifyNow + " subId=" + subId + " phoneId=" + phoneId
                + " notifyNow=" + notifyNow + " subId=" + subId + " myUid=" + myUid
                + " isLegacyApp=" + isLegacyApp
                + " myUid=" + myUid
                + " callerUid=" + callerUid);
                + " callerUid=" + callerUid);
        }
        }
        if (events != 0) {
        if (events != 0) {
@@ -364,28 +332,23 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    r.callback = callback;
                    r.callback = callback;
                    r.pkgForDebug = pkgForDebug;
                    r.pkgForDebug = pkgForDebug;
                    r.callerUid = callerUid;
                    r.callerUid = callerUid;
                    // Legacy applications pass SubscriptionManager.DEFAULT_SUB_ID,
                    // force all illegal subId to SubscriptionManager.DEFAULT_SUB_ID
                    if (!SubscriptionManager.isValidSubId(subId)) {
                        r.subId = SubscriptionManager.DEFAULT_SUB_ID;
                     } else {//APP specify subID
                        r.subId = subId;
                        r.subId = subId;
                    r.phoneId = phoneId;
                    r.isLegacyApp = isLegacyApp;
                    // Legacy applications pass invalid subId(-1), based on
                    // the received subId value update the isLegacyApp field
                    if ((r.subId <= 0) || (r.subId == SubscriptionManager.INVALID_SUB_ID)) {
                        r.subId = mDefaultSubId;
                        r.phoneId = mDefaultPhoneIdForDefaultSubId;
                        r.isLegacyApp = true; // subId & phoneId are updated when default changes.
                    }
                    if (r.subId == SubscriptionManager.DEFAULT_SUB_ID) {
                        r.subId = mDefaultSubId;
                        r.phoneId = mDefaultPhoneIdForDefaultSubId;
                        r.isLegacyApp = true; // subId & phoneId are updated when default changes.
                        if (DBG) log("listen: DEFAULT_SUB_ID");
                    }
                    }
                    r.phoneId = SubscriptionManager.getPhoneId(r.subId);

                    mRecords.add(r);
                    mRecords.add(r);
                    if (DBG) log("listen: add new record");
                    if (DBG) log("listen: add new record");
                }
                }

                int phoneId = r.phoneId;
                r.events = events;
                r.events = events;
                if (DBG) {
                if (DBG) {
                    log("listen: r=" + r + " subId=" + subId + " phoneId=" + phoneId);
                    log("listen: r=" + r + " r.subId=" + r.subId + " phoneId=" + phoneId);
                }
                }
                if (VDBG) toStringLogSSC("listen");
                if (VDBG) toStringLogSSC("listen");
                if (notifyNow && validatePhoneId(phoneId)) {
                if (notifyNow && validatePhoneId(phoneId)) {
@@ -525,11 +488,15 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        if (!checkNotifyPermission("notifyCallState()")) {
        if (!checkNotifyPermission("notifyCallState()")) {
            return;
            return;
        }
        }

        if (VDBG) {
            log("notifyCallState: state=" + state + " incomingNumber=" + incomingNumber);
        }

        synchronized (mRecords) {
        synchronized (mRecords) {
            for (Record r : mRecords) {
            for (Record r : mRecords) {
                if (((r.events & PhoneStateListener.LISTEN_CALL_STATE) != 0) &&
                if (((r.events & PhoneStateListener.LISTEN_CALL_STATE) != 0) &&
                    (r.isLegacyApp == true)) {
                        (r.subId == SubscriptionManager.DEFAULT_SUB_ID)) {
                    // FIXME: why does isLegacyApp need to be true?
                    try {
                    try {
                        r.callback.onCallStateChanged(state, incomingNumber);
                        r.callback.onCallStateChanged(state, incomingNumber);
                    } catch (RemoteException ex) {
                    } catch (RemoteException ex) {
@@ -539,7 +506,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
            }
            }
            handleRemoveListLocked();
            handleRemoveListLocked();
        }
        }
        broadcastCallStateChanged(state, incomingNumber, mDefaultSubId);
        broadcastCallStateChanged(state, incomingNumber, SubscriptionManager.DEFAULT_SUB_ID);
    }
    }


    public void notifyCallStateForSubscriber(long subId, int state, String incomingNumber) {
    public void notifyCallStateForSubscriber(long subId, int state, String incomingNumber) {
@@ -557,8 +524,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                mCallIncomingNumber[phoneId] = incomingNumber;
                mCallIncomingNumber[phoneId] = incomingNumber;
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (((r.events & PhoneStateListener.LISTEN_CALL_STATE) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_CALL_STATE) != 0) &&
                            (r.phoneId == phoneId) &&
                            (r.subId == subId) &&
                            (r.isLegacyApp == false)) { // FIXME: why isLegacyApp false?
                            (r.subId != SubscriptionManager.DEFAULT_SUB_ID)) {
                        try {
                        try {
                            r.callback.onCallStateChanged(state, incomingNumber);
                            r.callback.onCallStateChanged(state, incomingNumber);
                        } catch (RemoteException ex) {
                        } catch (RemoteException ex) {
@@ -572,20 +539,12 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        broadcastCallStateChanged(state, incomingNumber, subId);
        broadcastCallStateChanged(state, incomingNumber, subId);
    }
    }


     public void notifyServiceState(ServiceState state) {
    public void notifyServiceStateForPhoneId(int phoneId, long subId, ServiceState state) {
         notifyServiceStateForSubscriber(mDefaultSubId, state);
     }

    public void notifyServiceStateForSubscriber(long subId, ServiceState state) {
        if (!checkNotifyPermission("notifyServiceState()")){
        if (!checkNotifyPermission("notifyServiceState()")){
            return;
            return;
        }
        }
        if (subId == SubscriptionManager.DEFAULT_SUB_ID) {

            subId = mDefaultSubId;
            if (VDBG) log("notifyServiceStateForSubscriber: using mDefaultSubId=" + mDefaultSubId);
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
            int phoneId = SubscriptionManager.getPhoneId(subId);
            if (VDBG) {
            if (VDBG) {
                log("notifyServiceStateForSubscriber: subId=" + subId + " phoneId=" + phoneId
                log("notifyServiceStateForSubscriber: subId=" + subId + " phoneId=" + phoneId
                    + " state=" + state);
                    + " state=" + state);
@@ -601,7 +560,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                                + " 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.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            if (DBG) {
                            if (DBG) {
                                log("notifyServiceStateForSubscriber: callback.onSSC r=" + r
                                log("notifyServiceStateForSubscriber: callback.onSSC r=" + r
@@ -623,7 +583,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifySignalStrength(SignalStrength signalStrength) {
    public void notifySignalStrength(SignalStrength signalStrength) {
        notifySignalStrengthForSubscriber(mDefaultSubId, signalStrength);
        notifySignalStrengthForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, signalStrength);
    }
    }


    public void notifySignalStrengthForSubscriber(long subId, SignalStrength signalStrength) {
    public void notifySignalStrengthForSubscriber(long subId, SignalStrength signalStrength) {
@@ -646,7 +606,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                                + " 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.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            if (DBG) {
                            if (DBG) {
                                log("notifySignalStrengthForSubscriber: callback.onSsS r=" + r
                                log("notifySignalStrengthForSubscriber: callback.onSsS r=" + r
@@ -659,7 +620,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                        }
                        }
                    }
                    }
                    if (((r.events & PhoneStateListener.LISTEN_SIGNAL_STRENGTH) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_SIGNAL_STRENGTH) != 0) &&
                        (r.phoneId == phoneId)) {
                            ((r.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            int gsmSignalStrength = signalStrength.getGsmSignalStrength();
                            int gsmSignalStrength = signalStrength.getGsmSignalStrength();
                            int ss = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength);
                            int ss = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength);
@@ -683,7 +645,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


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


    public void notifyCellInfoForSubscriber(long subId, List<CellInfo> cellInfo) {
    public void notifyCellInfoForSubscriber(long subId, List<CellInfo> cellInfo) {
@@ -700,8 +662,9 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
            if (validatePhoneId(phoneId)) {
            if (validatePhoneId(phoneId)) {
                mCellInfo.set(phoneId, cellInfo);
                mCellInfo.set(phoneId, cellInfo);
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_INFO)
                    if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_INFO) &&
                            && r.subId == subId) {
                            ((r.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            if (DBG_LOC) {
                            if (DBG_LOC) {
                                log("notifyCellInfo: mCellInfo=" + cellInfo + " r=" + r);
                                log("notifyCellInfo: mCellInfo=" + cellInfo + " r=" + r);
@@ -742,25 +705,22 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
        }
    }
    }


    public void notifyMessageWaitingChanged(boolean mwi) {
    @Override
        notifyMessageWaitingChangedForSubscriber(mDefaultSubId, mwi);
    public void notifyMessageWaitingChangedForPhoneId(int phoneId, long subId, boolean mwi) {
    }

    public void notifyMessageWaitingChangedForSubscriber(long subId, boolean mwi) {
        if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
        if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
            return;
            return;
        }
        }
        if (VDBG) {
        if (VDBG) {
            log("notifyMessageWaitingChangedForSubscriber: subId=" + subId
            log("notifyMessageWaitingChangedForSubscriberPhoneID: subId=" + phoneId
                + " mwi=" + mwi);
                + " mwi=" + mwi);
        }
        }
        synchronized (mRecords) {
        synchronized (mRecords) {
            int phoneId = SubscriptionManager.getPhoneId(subId);
            if (validatePhoneId(phoneId)) {
            if (validatePhoneId(phoneId)) {
                mMessageWaiting[phoneId] = mwi;
                mMessageWaiting[phoneId] = mwi;
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (((r.events & PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR) != 0) &&
                        (r.phoneId == phoneId)) {
                            ((r.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            r.callback.onMessageWaitingIndicatorChanged(mwi);
                            r.callback.onMessageWaitingIndicatorChanged(mwi);
                        } catch (RemoteException ex) {
                        } catch (RemoteException ex) {
@@ -774,7 +734,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyCallForwardingChanged(boolean cfi) {
    public void notifyCallForwardingChanged(boolean cfi) {
        notifyCallForwardingChangedForSubscriber(mDefaultSubId, cfi);
        notifyCallForwardingChangedForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, cfi);
    }
    }


    public void notifyCallForwardingChangedForSubscriber(long subId, boolean cfi) {
    public void notifyCallForwardingChangedForSubscriber(long subId, boolean cfi) {
@@ -791,7 +751,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                mCallForwarding[phoneId] = cfi;
                mCallForwarding[phoneId] = cfi;
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (((r.events & PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR) != 0) &&
                        (r.phoneId == phoneId)) {
                            ((r.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            r.callback.onCallForwardingIndicatorChanged(cfi);
                            r.callback.onCallForwardingIndicatorChanged(cfi);
                        } catch (RemoteException ex) {
                        } catch (RemoteException ex) {
@@ -805,7 +766,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyDataActivity(int state) {
    public void notifyDataActivity(int state) {
        notifyDataActivityForSubscriber(mDefaultSubId, state);
        notifyDataActivityForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, state);
    }
    }


    public void notifyDataActivityForSubscriber(long subId, int state) {
    public void notifyDataActivityForSubscriber(long subId, int state) {
@@ -831,8 +792,8 @@ 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) {
        notifyDataConnectionForSubscriber(mDefaultSubId, state, isDataConnectivityPossible,
        notifyDataConnectionForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, state,
            reason, apn, apnType, linkProperties,
            isDataConnectivityPossible,reason, apn, apnType, linkProperties,
            networkCapabilities, networkType, roaming);
            networkCapabilities, networkType, roaming);
    }
    }


@@ -888,7 +849,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                }
                }
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (((r.events & PhoneStateListener.LISTEN_DATA_CONNECTION_STATE) != 0) &&
                    if (((r.events & PhoneStateListener.LISTEN_DATA_CONNECTION_STATE) != 0) &&
                            (r.phoneId == phoneId)) {
                            ((r.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            log("Notify data connection state changed on sub: " +
                            log("Notify data connection state changed on sub: " +
                                    subId);
                                    subId);
@@ -921,7 +883,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyDataConnectionFailed(String reason, String apnType) {
    public void notifyDataConnectionFailed(String reason, String apnType) {
         notifyDataConnectionFailedForSubscriber(mDefaultSubId, reason, apnType);
         notifyDataConnectionFailedForSubscriber(SubscriptionManager.DEFAULT_SUB_ID,
                 reason, apnType);
    }
    }


    public void notifyDataConnectionFailedForSubscriber(long subId,
    public void notifyDataConnectionFailedForSubscriber(long subId,
@@ -954,7 +917,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }
    }


    public void notifyCellLocation(Bundle cellLocation) {
    public void notifyCellLocation(Bundle cellLocation) {
         notifyCellLocationForSubscriber(mDefaultSubId, cellLocation);
         notifyCellLocationForSubscriber(SubscriptionManager.DEFAULT_SUB_ID, cellLocation);
    }
    }


    public void notifyCellLocationForSubscriber(long subId, Bundle cellLocation) {
    public void notifyCellLocationForSubscriber(long subId, Bundle cellLocation) {
@@ -972,8 +935,9 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
            if (validatePhoneId(phoneId)) {
            if (validatePhoneId(phoneId)) {
                mCellLocation[phoneId] = cellLocation;
                mCellLocation[phoneId] = cellLocation;
                for (Record r : mRecords) {
                for (Record r : mRecords) {
                    if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_LOCATION)
                    if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_LOCATION) &&
                            && r.subId == subId) {
                            ((r.subId == subId) ||
                            (r.subId == SubscriptionManager.DEFAULT_SUB_ID))) {
                        try {
                        try {
                            if (DBG_LOC) {
                            if (DBG_LOC) {
                                log("notifyCellLocation: cellLocation=" + cellLocation
                                log("notifyCellLocation: cellLocation=" + cellLocation
@@ -1134,7 +1098,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
                pw.println("  mCellLocation=" + mCellLocation[i]);
                pw.println("  mCellLocation=" + mCellLocation[i]);
                pw.println("  mCellInfo=" + mCellInfo.get(i));
                pw.println("  mCellInfo=" + mCellInfo.get(i));
            }
            }
            pw.println("  mDefaultSubId=" + mDefaultSubId);
            pw.println("  mDcRtInfo=" + mDcRtInfo);
            pw.println("  mDcRtInfo=" + mDcRtInfo);
            pw.println("registrations: count=" + recordCount);
            pw.println("registrations: count=" + recordCount);
            for (Record r : mRecords) {
            for (Record r : mRecords) {
+2 −4
Original line number Original line Diff line number Diff line
@@ -34,12 +34,10 @@ interface ITelephonyRegistry {
            boolean notifyNow);
            boolean notifyNow);
    void notifyCallState(int state, String incomingNumber);
    void notifyCallState(int state, String incomingNumber);
    void notifyCallStateForSubscriber(in long subId, int state, String incomingNumber);
    void notifyCallStateForSubscriber(in long subId, int state, String incomingNumber);
    void notifyServiceState(in ServiceState state);
    void notifyServiceStateForPhoneId(in int phoneId, in long subId, in ServiceState state);
    void notifyServiceStateForSubscriber(in long subId, in ServiceState state);
    void notifySignalStrength(in SignalStrength signalStrength);
    void notifySignalStrength(in SignalStrength signalStrength);
    void notifySignalStrengthForSubscriber(in long subId, in SignalStrength signalStrength);
    void notifySignalStrengthForSubscriber(in long subId, in SignalStrength signalStrength);
    void notifyMessageWaitingChanged(boolean mwi);
    void notifyMessageWaitingChangedForPhoneId(in int phoneId, in long subId, in boolean mwi);
    void notifyMessageWaitingChangedForSubscriber(in long subId, boolean mwi);
    void notifyCallForwardingChanged(boolean cfi);
    void notifyCallForwardingChanged(boolean cfi);
    void notifyCallForwardingChangedForSubscriber(in long subId, boolean cfi);
    void notifyCallForwardingChangedForSubscriber(in long subId, boolean cfi);
    void notifyDataActivity(int state);
    void notifyDataActivity(int state);