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

Commit 3350a7f3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topics "KEY_DATA_SWITCH_VALIDATION_MIN_GAP_MILLIS_LONG",...

Merge changes from topics "KEY_DATA_SWITCH_VALIDATION_MIN_GAP_MILLIS_LONG", "smsvc_bootup" am: 0cf4b000

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/2519538



Change-Id: I1cd3ceb7b4b39c0cc33f9ec10fc14e6021462d55
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5b766b89 0cf4b000
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -212,9 +212,14 @@ public class PhoneFactory {
                    TelephonyComponentFactory.getInstance().inject(SubscriptionController.class
                            .getName()).initSubscriptionController(context);
                }

                SubscriptionController sc = null;
                if (!isSubscriptionManagerServiceEnabled()) {
                    sc = SubscriptionController.getInstance();
                }

                TelephonyComponentFactory.getInstance().inject(MultiSimSettingController.class.
                        getName()).initMultiSimSettingController(context,
                        SubscriptionController.getInstance());
                        getName()).initMultiSimSettingController(context, sc);

                if (context.getPackageManager().hasSystemFeature(
                        PackageManager.FEATURE_TELEPHONY_EUICC)) {
+2 −2
Original line number Diff line number Diff line
@@ -2769,8 +2769,8 @@ public class ServiceStateTracker extends Handler {

            if (mPhone.isSubscriptionManagerServiceEnabled()) {
                mSubscriptionManagerService.setCarrierName(mPhone.getSubId(),
                        getCarrierName(data.shouldShowPlmn(), data.getPlmn(),
                                data.shouldShowSpn(), data.getSpn()));
                        TextUtils.emptyIfNull(getCarrierName(data.shouldShowPlmn(), data.getPlmn(),
                                data.shouldShowSpn(), data.getSpn())));
            } else {
                if (!mSubscriptionController.setPlmnSpn(mPhone.getPhoneId(),
                        data.shouldShowPlmn(), data.getPlmn(), data.shouldShowSpn(),
+4 −1
Original line number Diff line number Diff line
@@ -329,6 +329,9 @@ public class SubscriptionController extends ISub.Stub {

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public static SubscriptionController getInstance() {
        if (PhoneFactory.isSubscriptionManagerServiceEnabled()) {
            throw new RuntimeException("getInstance should not be called.");
        }
        if (sInstance == null) {
            Log.wtf(LOG_TAG, "getInstance null");
        }
+8 −2
Original line number Diff line number Diff line
@@ -531,8 +531,14 @@ public class PhoneSwitcher extends Handler {
        mMaxDataAttachModemCount = maxActivePhones;
        mLocalLog = new LocalLog(MAX_LOCAL_LOG_LINES);

        mSubscriptionController = SubscriptionController.getInstance();
        if (PhoneFactory.isSubscriptionManagerServiceEnabled()) {
            mSubscriptionManagerService = SubscriptionManagerService.getInstance();
            mSubscriptionController = null;
        } else {
            mSubscriptionController = SubscriptionController.getInstance();
            mSubscriptionManagerService = null;
        }

        mRadioConfig = RadioConfig.getInstance();
        mValidator = CellularNetworkValidator.getInstance();

+49 −12
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.telephony.SubscriptionManager.SimDisplayNameSource;
import android.telephony.SubscriptionManager.SubscriptionType;
import android.telephony.SubscriptionManager.UsageSetting;
import android.telephony.TelephonyManager;
import android.telephony.UiccAccessRule;
import android.telephony.ims.ImsMmTelManager;
import android.text.TextUtils;
import android.util.Base64;
@@ -568,6 +569,7 @@ public class SubscriptionDatabaseManager extends Handler {
    public SubscriptionDatabaseManager(@NonNull Context context, @NonNull Looper looper,
            @NonNull SubscriptionDatabaseManagerCallback callback) {
        super(looper);
        log("Created SubscriptionDatabaseManager.");
        mContext = context;
        mCallback = callback;
        mUiccController = UiccController.getInstance();
@@ -690,6 +692,8 @@ public class SubscriptionDatabaseManager extends Handler {

        for (String columnName : Telephony.SimInfo.getAllColumns()) {
            if (DEPRECATED_DATABASE_COLUMNS.contains(columnName)) continue;
            // subId is generated by the database. Cannot be updated.
            if (columnName.equals(SimInfo.COLUMN_UNIQUE_KEY_SUBSCRIPTION_ID)) continue;
            Object newValue = getSubscriptionInfoFieldByColumnName(newSubInfo, columnName);
            if (newValue != null) {
                Object oldValue = null;
@@ -718,13 +722,16 @@ public class SubscriptionDatabaseManager extends Handler {
        Objects.requireNonNull(contentValues);
        Uri uri = mContext.getContentResolver().insert(SimInfo.CONTENT_URI, contentValues);
        if (uri != null && uri.getLastPathSegment() != null) {
            int subId = Integer.parseInt(uri.getLastPathSegment());
            if (SubscriptionManager.isValidSubscriptionId(subId)) {
                logl("insertNewRecordIntoDatabaseSync: Successfully added subscription. subId="
                        + uri.getLastPathSegment());
            return Integer.parseInt(uri.getLastPathSegment());
        } else {
                return subId;
            }
        }

        logel("insertNewRecordIntoDatabaseSync: Failed to insert subscription into database. "
                + "contentValues=" + contentValues);
        }
        return INVALID_ROW_INDEX;
    }

@@ -881,6 +888,8 @@ public class SubscriptionDatabaseManager extends Handler {
                    // Check if the new value is different from the old value in the cache.
                    if (!Objects.equals(getSubscriptionInfoFieldByColumnName(subInfo, columnName),
                            newValue)) {
                        logv("writeDatabaseAndCacheHelper: subId=" + subId + ",columnName="
                                + columnName + ", newValue=" + newValue);
                        // If the value is different, then we need to update the cache. Since all
                        // fields in SubscriptionInfo are final, we need to create a new
                        // SubscriptionInfo.
@@ -1216,6 +1225,24 @@ public class SubscriptionDatabaseManager extends Handler {
                SubscriptionInfoInternal.Builder::setCarrierConfigAccessRules);
    }

    /**
     * Set the carrier certificates for this subscription that are saved in carrier configs.
     * This does not include access rules from the Uicc, whether embedded or non-embedded.
     *
     * @param subId Subscription id.
     * @param carrierConfigAccessRules The carrier certificates for this subscription.
     *
     * @throws IllegalArgumentException if the subscription does not exist.
     */
    public void setCarrierConfigAccessRules(int subId,
            @NonNull UiccAccessRule[] carrierConfigAccessRules) {
        Objects.requireNonNull(carrierConfigAccessRules);
        byte[] carrierConfigAccessRulesBytes = UiccAccessRule.encodeRules(carrierConfigAccessRules);
        writeDatabaseAndCacheHelper(subId, SimInfo.COLUMN_ACCESS_RULES_FROM_CARRIER_CONFIGS,
                carrierConfigAccessRulesBytes,
                SubscriptionInfoInternal.Builder::setCarrierConfigAccessRules);
    }

    /**
     * Set whether an embedded subscription is on a removable card. Such subscriptions are
     * marked inaccessible as soon as the current card is removed. Otherwise, they will remain
@@ -1781,11 +1808,23 @@ public class SubscriptionDatabaseManager extends Handler {
        // publicCardId is the publicly exposed int card ID
        int publicCardId = mUiccController.convertToPublicCardId(cardString);

        byte[] rules = cursor.getBlob(cursor.getColumnIndexOrThrow(SimInfo.COLUMN_ACCESS_RULES));
        if (rules != null) {
            builder.setNativeAccessRules(rules);
        }

        rules = cursor.getBlob(cursor.getColumnIndexOrThrow(
                SimInfo.COLUMN_ACCESS_RULES_FROM_CARRIER_CONFIGS));
        if (rules != null) {
            builder.setCarrierConfigAccessRules(rules);
        }

        byte[] config = cursor.getBlob(cursor.getColumnIndexOrThrow(SimInfo.COLUMN_RCS_CONFIG));
        if (config != null) {
            builder.setRcsConfig(config);
        }

        builder.setCardId(publicCardId)
                .setNativeAccessRules(cursor.getBlob(cursor.getColumnIndexOrThrow(
                        SimInfo.COLUMN_ACCESS_RULES)))
                .setCarrierConfigAccessRules(cursor.getBlob(cursor.getColumnIndexOrThrow(
                        SimInfo.COLUMN_ACCESS_RULES_FROM_CARRIER_CONFIGS)))
                .setRemovableEmbedded(cursor.getInt(cursor.getColumnIndexOrThrow(
                        SimInfo.COLUMN_IS_REMOVABLE)))
                .setEnhanced4GModeEnabled(cursor.getInt(cursor.getColumnIndexOrThrow(
@@ -1825,8 +1864,6 @@ public class SubscriptionDatabaseManager extends Handler {
                        SimInfo.COLUMN_IMS_RCS_UCE_ENABLED)))
                .setCrossSimCallingEnabled(cursor.getInt(cursor.getColumnIndexOrThrow(
                        SimInfo.COLUMN_CROSS_SIM_CALLING_ENABLED)))
                .setRcsConfig(cursor.getBlob(cursor.getColumnIndexOrThrow(
                        SimInfo.COLUMN_RCS_CONFIG)))
                .setAllowedNetworkTypesForReasons(TextUtils.emptyIfNull(
                        cursor.getString(cursor.getColumnIndexOrThrow(
                                SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS))))
Loading