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

Commit ef7748ef authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5674532 from 8d594afd to qt-c2f2-release

Change-Id: I65de7de6b3fd1c7603ffdc0b752c97f48c6cc9bb
parents 714b9b01 8d594afd
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -125,9 +125,8 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
    }

    public String getSubscriberIdForSubscriber(int subId, String callingPackage) {
        Phone thePhone = getPhone(subId);
        String message = "getSubscriberId";
        if (thePhone != null) {
        if (SubscriptionController.getInstance().isActiveSubId(subId, callingPackage)) {
            return callPhoneMethodForSubIdWithReadSubscriberIdentifiersCheck(subId, callingPackage,
                    message, (phone) -> phone.getSubscriberId());
        } else {
@@ -137,7 +136,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
            }
            final long identity = Binder.clearCallingIdentity();
            try {
                return SubscriptionController.getInstance().getImsi(subId);
                return SubscriptionController.getInstance().getImsiPrivileged(subId);
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
+1 −1
Original line number Diff line number Diff line
@@ -5900,7 +5900,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        List<CellSignalStrengthGsm> gsmList = signalStrength.getCellSignalStrengths(
                CellSignalStrengthGsm.class);
        // If GSM is not the primary type, then bail out; no fixup needed.
        if (gsmList == null || gsmList.get(0) == null || !gsmList.get(0).isValid()) {
        if (gsmList.isEmpty() || !gsmList.get(0).isValid()) {
            return signalStrength;
        }

+15 −12
Original line number Diff line number Diff line
@@ -1893,29 +1893,32 @@ public class SubscriptionController extends ISub.Stub {

    /**
     * Get IMSI by subscription ID
     * For active subIds, this will always return the corresponding imsi
     * For inactive subIds, once they are activated once, even if they are deactivated at the time
     *   of calling this function, the corresponding imsi will be returned
     * When calling this method, the permission check should have already been done to allow
     *   only privileged read
     *
     * @return imsi
     */
    public String getImsi(int subId) {
        Cursor cursor = mContext.getContentResolver().query(
                SubscriptionManager.getUriForSubscriptionId(subId), null,
    public String getImsiPrivileged(int subId) {
        try (Cursor cursor = mContext.getContentResolver().query(
                SubscriptionManager.CONTENT_URI, null,
                SubscriptionManager.UNIQUE_KEY_SUBSCRIPTION_ID + "=?",
                new String[]{String.valueOf(subId)}, null);

                new String[] {String.valueOf(subId)}, null)) {
            String imsi = null;
        try {
            if (cursor != null) {
                if (cursor.moveToNext()) {
                    imsi = getOptionalStringFromCursor(cursor, SubscriptionManager.IMSI,
                            /*defaultVal*/ null);
                }
            } else {
                logd("getImsiPrivileged: failed to retrieve imsi.");
            }
        } finally {
            if (cursor != null) {
                cursor.close();
            }
        }

            return imsi;
        }
    }

    /**
     * Set ISO country code by subscription ID
+8 −1
Original line number Diff line number Diff line
@@ -1768,6 +1768,14 @@ public class DataConnection extends StateMachine {
                    mApnSetting != null
                        ? mApnSetting.canHandleType(ApnSetting.TYPE_DEFAULT) : false);
            setHandoverState(HANDOVER_STATE_IDLE);
            // restricted evaluation depends on network requests from apnContext. The evaluation
            // should happen once entering connecting state rather than active state because it's
            // possible that restricted network request can be released during the connecting window
            // and if we wait for connection established, then we might mistakenly
            // consider it as un-restricted. ConnectivityService then will immediately
            // tear down the connection through networkAgent unwanted callback if all requests for
            // this connection are going away.
            mRestrictedNetworkOverride = shouldRestrictNetwork();
        }
        @Override
        public boolean processMessage(Message msg) {
@@ -1916,7 +1924,6 @@ public class DataConnection extends StateMachine {
            // set skip464xlat if it is not default otherwise
            misc.skip464xlat = shouldSkip464Xlat();

            mRestrictedNetworkOverride = shouldRestrictNetwork();
            mUnmeteredUseOnly = isUnmeteredUseOnly();

            if (DBG) {
+9 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.uicc.IccRecords;

import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -1550,8 +1551,14 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
                sb.append(getErrorMessage(ar));
            }
        } else {
            List<ImsSsInfo> infos = (List<ImsSsInfo>) ar.result;
            if (infos.size() == 0) {
            List<ImsSsInfo> infos = null;
            try {
                infos = (List<ImsSsInfo>) ar.result;
            } catch (ClassCastException cce) {
                // TODO in R: #157# still has ImsSsInfo[] type, fix the type in IImsUtListener.aidl.
                infos = Arrays.asList((ImsSsInfo[]) ar.result);
            }
            if (infos == null || infos.size() == 0) {
                sb.append(mContext.getText(com.android.internal.R.string.serviceDisabled));
            } else {
                ImsSsInfo info;
Loading