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

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

Snap for 5567188 from 43dd8b00 to qt-release

Change-Id: I75ef5c649692446b8bfb03f9a980fd7a0f411d2f
parents 06ae7ce2 43dd8b00
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
    }

    public String getDeviceIdForPhone(int phoneId, String callingPackage) {
        return callPhoneMethodForPhoneIdWithReadDeviceIdentifierCheck(phoneId, callingPackage,
        return callPhoneMethodForPhoneIdWithReadDeviceIdentifiersCheck(phoneId, callingPackage,
                "getDeviceId", (phone)-> phone.getDeviceId());
    }

@@ -73,8 +73,8 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
    }

    public String getImeiForSubscriber(int subId, String callingPackage) {
        return callPhoneMethodForSubIdWithReadCheck(subId, callingPackage, "getImei",
                (phone)-> phone.getImei());
        return callPhoneMethodForSubIdWithReadDeviceIdentifiersCheck(subId, callingPackage,
                "getImei", (phone)-> phone.getImei());
    }

    public ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int subId, int keyType,
@@ -397,6 +397,14 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
                                aContext, aSubId, aCallingPackage, aMessage));
    }

    private <T> T callPhoneMethodForSubIdWithReadDeviceIdentifiersCheck(int subId,
            String callingPackage, String message, CallPhoneMethodHelper<T> callMethodHelper) {
        return callPhoneMethodWithPermissionCheck(subId, callingPackage, message, callMethodHelper,
                (aContext, aSubId, aCallingPackage, aMessage)->
                        TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(
                                aContext, aSubId, aCallingPackage, aMessage));
    }

    private <T> T callPhoneMethodForSubIdWithReadSubscriberIdentifiersCheck(int subId,
            String callingPackage, String message, CallPhoneMethodHelper<T> callMethodHelper) {
        return callPhoneMethodWithPermissionCheck(subId, callingPackage, message, callMethodHelper,
@@ -432,7 +440,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
                                aContext, aSubId, aCallingPackage, aMessage));
    }

    private <T> T callPhoneMethodForPhoneIdWithReadDeviceIdentifierCheck(int phoneId,
    private <T> T callPhoneMethodForPhoneIdWithReadDeviceIdentifiersCheck(int phoneId,
            String callingPackage, String message, CallPhoneMethodHelper<T> callMethodHelper) {
        // Getting subId before doing permission check.
        if (!SubscriptionManager.isValidPhoneId(phoneId)) {
+7 −95
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import static com.android.internal.telephony.CarrierActionAgent.CARRIER_ACTION_S
import static com.android.internal.telephony.uicc.IccRecords.CARRIER_NAME_DISPLAY_CONDITION_BITMASK_PLMN;
import static com.android.internal.telephony.uicc.IccRecords.CARRIER_NAME_DISPLAY_CONDITION_BITMASK_SPN;

import android.Manifest.permission;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.UnsupportedAppUsage;
@@ -216,10 +215,6 @@ public class ServiceStateTracker extends Handler {
    private boolean mPendingRadioPowerOffAfterDataOff = false;
    private int mPendingRadioPowerOffAfterDataOffTag = 0;

    // This is a flag for debug purposes only. It it set once the RUIM_RECORDS_LOADED event is
    // received and RUIM is provisioned while the phone type is CDMA-LTE.
    private boolean mRuimProvisionedRecordsLoaded = false;

    /** Signal strength poll rate. */
    private static final int POLL_PERIOD_MILLIS = 20 * 1000;

@@ -345,7 +340,6 @@ public class ServiceStateTracker extends Handler {
    private final LocalLog mPhoneTypeLog = new LocalLog(10);
    private final LocalLog mRatLog = new LocalLog(20);
    private final LocalLog mRadioPowerLog = new LocalLog(20);
    private final LocalLog mMdnLog = new LocalLog(20);

    private Pattern mOperatorNameStringPattern;

@@ -704,14 +698,12 @@ public class ServiceStateTracker extends Handler {
        mStartedGprsRegCheck = false;
        mReportedGprsNoReg = false;
        mMdn = null;
        logMdnChange("updatePhoneType: setting mMdn to null");
        mMin = null;
        mPrlVersion = null;
        mIsMinInfoReady = false;
        mNitzState.handleNetworkCountryCodeUnavailable();
        mCellIdentity = null;
        mNewCellIdentity = null;
        mRuimProvisionedRecordsLoaded = false;

        //cancel any pending pollstate request on voice tech switching
        cancelPollState();
@@ -1082,8 +1074,6 @@ public class ServiceStateTracker extends Handler {
                    cancelAllNotifications();
                    // clear cached values on SIM removal
                    mMdn = null;
                    mRuimProvisionedRecordsLoaded = false;
                    logMdnChange("EVENT_ICC_CHANGED: setting mMdn to null");
                    mMin = null;
                    mIsMinInfoReady = false;

@@ -1440,8 +1430,6 @@ public class ServiceStateTracker extends Handler {
                        String cdmaSubscription[] = (String[]) ar.result;
                        if (cdmaSubscription != null && cdmaSubscription.length >= 5) {
                            mMdn = cdmaSubscription[0];
                            logMdnChange("EVENT_POLL_STATE_CDMA_SUBSCRIPTION: setting mMdn to "
                                    + mMdn);
                            parseSidNid(cdmaSubscription[1], cdmaSubscription[2]);

                            mMin = cdmaSubscription[3];
@@ -1485,24 +1473,21 @@ public class ServiceStateTracker extends Handler {
                    } else {
                        RuimRecords ruim = (RuimRecords) mIccRecords;
                        if (ruim != null) {
                            if (ruim.isProvisioned()) {
                                mRuimProvisionedRecordsLoaded = true;
                            // Do not wait for RUIM to be provisioned before using mdn. Line1Number
                            // can be queried before that and mdn may still be available.
                            // Also note that any special casing is not done in getMdnNumber() as it
                            // may be called on another thread, so simply doing a read operation
                            // there.
                            mMdn = ruim.getMdn();
                                logMdnChange("EVENT_RUIM_RECORDS_LOADED: setting mMdn to " + mMdn);
                            if (ruim.isProvisioned()) {
                                mMin = ruim.getMin();
                                parseSidNid(ruim.getSid(), ruim.getNid());
                                mPrlVersion = ruim.getPrlVersion();
                                mIsMinInfoReady = true;
                            } else {
                                logMdnChange("EVENT_RUIM_RECORDS_LOADED: ruim not provisioned; "
                                        + "not updating mMdn " + mMdn);
                            }
                            updateOtaspState();
                            // Notify apps subscription info is ready
                            notifyCdmaSubscriptionInfoReady();
                        } else {
                            logMdnChange("EVENT_RUIM_RECORDS_LOADED: ruim is null; "
                                    + "not updating mMdn " + mMdn);
                        }
                        // SID/NID/PRL is loaded. Poll service state
                        // again to update to the roaming state with
@@ -1644,29 +1629,7 @@ public class ServiceStateTracker extends Handler {
    }

    public String getMdnNumber() {
        String mdn = mMdn;
        // if for CDMA-LTE phone MDN is null, return the value from RuimRecords
        if (mMdn == null && mPhone.isPhoneTypeCdmaLte()) {
            RuimRecords ruim = (RuimRecords) mIccRecords;
            if (ruim != null && ruim.getMdn() != null) {
                logeMdnChange("getMdnNumber: mMdn is null when RuimRecords.getMdn() is not");
                mdn = ruim.getMdn();

                // if mRuimProvisionedRecordsLoaded is true, then mMdn should not have been null and
                // we should not have reached here. Update mMdn and catch the error scenario.
                if (mRuimProvisionedRecordsLoaded) {
                    // broadcast intent to indicate an error related to Line1Number has been
                    // detected
                    Intent intent = new Intent(TelephonyIntents.ACTION_LINE1_NUMBER_ERROR_DETECTED);
                    intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
                    mPhone.getContext().sendBroadcast(intent,
                            permission.READ_PRIVILEGED_PHONE_STATE);

                    mMdn = mdn;
                }
            }
        }
        return mdn;
        return mMdn;
    }

    public String getCdmaMin() {
@@ -2718,42 +2681,6 @@ public class ServiceStateTracker extends Handler {
                spn = null;
                showSpn = false;
            }

            int subId = mPhone.getSubId();

            // Update SPN_STRINGS_UPDATED_ACTION IFF any value changes
            if (mSubId != subId ||
                    showPlmn != mCurShowPlmn
                    || showSpn != mCurShowSpn
                    || !TextUtils.equals(spn, mCurSpn)
                    || !TextUtils.equals(dataSpn, mCurDataSpn)
                    || !TextUtils.equals(plmn, mCurPlmn)) {
                if (DBG) {
                    log(String.format("updateSpnDisplay: changed sending intent rule=" + rule +
                            " showPlmn='%b' plmn='%s' showSpn='%b' spn='%s' dataSpn='%s' " +
                            "subId='%d'", showPlmn, plmn, showSpn, spn, dataSpn, subId));
                }
                Intent intent = new Intent(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION);
                intent.putExtra(TelephonyIntents.EXTRA_SHOW_SPN, showSpn);
                intent.putExtra(TelephonyIntents.EXTRA_SPN, spn);
                intent.putExtra(TelephonyIntents.EXTRA_DATA_SPN, dataSpn);
                intent.putExtra(TelephonyIntents.EXTRA_SHOW_PLMN, showPlmn);
                intent.putExtra(TelephonyIntents.EXTRA_PLMN, plmn);
                SubscriptionManager.putPhoneIdAndSubIdExtra(intent, mPhone.getPhoneId());
                mPhone.getContext().sendStickyBroadcastAsUser(intent, UserHandle.ALL);

                if (!mSubscriptionController.setPlmnSpn(mPhone.getPhoneId(),
                        showPlmn, plmn, showSpn, spn)) {
                    mSpnUpdatePending = true;
                }
            }

            mSubId = subId;
            mCurShowSpn = showSpn;
            mCurShowPlmn = showPlmn;
            mCurSpn = spn;
            mCurDataSpn = dataSpn;
            mCurPlmn = plmn;
        } else {
            String eriText = getOperatorNameFromEri();
            if (eriText != null) mSS.setOperatorAlphaLong(eriText);
@@ -2912,16 +2839,6 @@ public class ServiceStateTracker extends Handler {
        mRatLog.log(mSS.toString());
    }

    private void logMdnChange(String msg) {
        mMdnLog.log(msg);
        log(msg);
    }

    private void logeMdnChange(String msg) {
        mMdnLog.log(msg);
        loge(msg);
    }

    @UnsupportedAppUsage
    protected final void log(String s) {
        Rlog.d(LOG_TAG, "[" + mPhone.getPhoneId() + "] " + s);
@@ -5059,11 +4976,6 @@ public class ServiceStateTracker extends Handler {
        mRadioPowerLog.dump(fd, ipw, args);
        ipw.decreaseIndent();

        ipw.println(" mMdn Log:");
        ipw.increaseIndent();
        mMdnLog.dump(fd, ipw, args);
        ipw.decreaseIndent();

        mNitzState.dumpLogs(fd, ipw, args);

        ipw.flush();
+88 −16
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.internal.telephony.uicc.IccUtils;
import com.android.internal.telephony.uicc.UiccCard;
import com.android.internal.telephony.uicc.UiccController;
import com.android.internal.util.ArrayUtils;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -388,6 +389,8 @@ public class SubscriptionController extends ISub.Stub {
                SubscriptionManager.PROFILE_CLASS));
        int subType = cursor.getInt(cursor.getColumnIndexOrThrow(
                SubscriptionManager.SUBSCRIPTION_TYPE));
        String groupOwner = getOptionalStringFromCursor(cursor, SubscriptionManager.GROUP_OWNER,
                /*defaultVal*/ null);

        if (VDBG) {
            String iccIdToPrint = SubscriptionInfo.givePrintableIccid(iccId);
@@ -411,11 +414,18 @@ public class SubscriptionController extends ISub.Stub {
        SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName,
                carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc,
                countryIso, isEmbedded, accessRules, cardId, publicCardId, isOpportunistic,
                groupUUID, false /* isGroupDisabled */, carrierId, profileClass, subType);
                groupUUID, false /* isGroupDisabled */, carrierId, profileClass, subType,
                groupOwner);
        info.setAssociatedPlmns(ehplmns, hplmns);
        return info;
    }

    private String getOptionalStringFromCursor(Cursor cursor, String column, String defaultVal) {
        // Return defaultVal if the column doesn't exist.
        int columnIndex = cursor.getColumnIndex(column);
        return (columnIndex == -1) ? defaultVal : cursor.getString(columnIndex);
    }

    /**
     * Query SubInfoRecord(s) from subinfo database
     * @param selection A filter declaring which rows to return
@@ -2088,6 +2098,7 @@ public class SubscriptionController extends ISub.Stub {
        int previousSetting = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.MULTI_SIM_VOICE_CALL_SUBSCRIPTION,
                SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
        int previousDefaultSub = getDefaultSubId();

        Settings.Global.putInt(mContext.getContentResolver(),
                Settings.Global.MULTI_SIM_VOICE_CALL_SUBSCRIPTION, subId);
@@ -2109,6 +2120,10 @@ public class SubscriptionController extends ISub.Stub {
                logd("[setDefaultVoiceSubId] default phone account not changed");
            }
        }

        if (previousDefaultSub != getDefaultSubId()) {
            sendDefaultChangedBroadcast(getDefaultSubId());
        }
    }

    /**
@@ -2192,10 +2207,14 @@ public class SubscriptionController extends ISub.Stub {
            // FIXME is this still needed?
            updateAllDataConnectionTrackers();

            int previousDefaultSub = getDefaultSubId();
            Settings.Global.putInt(mContext.getContentResolver(),
                    Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId);
            MultiSimSettingController.getInstance().notifyDefaultDataSubChanged();
            broadcastDefaultDataSubIdChanged(subId);
            if (previousDefaultSub != getDefaultSubId()) {
                sendDefaultChangedBroadcast(getDefaultSubId());
            }
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
@@ -2237,6 +2256,7 @@ public class SubscriptionController extends ISub.Stub {
            logdl("[setDefaultFallbackSubId] subId=" + subId + ", subscriptionType="
                    + subscriptionType);
        }
        int previousDefaultSub = getDefaultSubId();
        if (isSubscriptionForRemoteSim(subscriptionType)) {
            mDefaultFallbackSubId = subId;
            return;
@@ -2250,7 +2270,6 @@ public class SubscriptionController extends ISub.Stub {
                // Update MCC MNC device configuration information
                String defaultMccMnc = mTelephonyManager.getSimOperatorNumericForPhone(phoneId);
                MccTable.updateMccMncConfiguration(mContext, defaultMccMnc);
                sendDefaultChangedBroadcast(phoneId, subId);
            } else {
                if (DBG) {
                    logdl("[setDefaultFallbackSubId] not set invalid phoneId=" + phoneId
@@ -2258,10 +2277,14 @@ public class SubscriptionController extends ISub.Stub {
                }
            }
        }
        if (previousDefaultSub != getDefaultSubId()) {
            sendDefaultChangedBroadcast(getDefaultSubId());
        }
    }

    private void sendDefaultChangedBroadcast(int phoneId, int subId) {
    public void sendDefaultChangedBroadcast(int subId) {
        // Broadcast an Intent for default sub change
        int phoneId = SubscriptionManager.getPhoneId(subId);
        Intent intent = new Intent(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING
                | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
@@ -2855,6 +2878,7 @@ public class SubscriptionController extends ISub.Stub {

            ContentValues value = new ContentValues();
            value.put(SubscriptionManager.GROUP_UUID, groupUUID.toString());
            value.put(SubscriptionManager.GROUP_OWNER, callingPackage);
            int result = mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI,
                    value, getSelectionForSubIdList(subIdList), null);

@@ -2872,14 +2896,31 @@ public class SubscriptionController extends ISub.Stub {
        }
    }

    // TODO: when having a group owner or packageName for subscription, use that to check.
    // Currently for this method to return false, all subscriptions in the group needs to have
    // carrier privilege rules loaded, which means active or available.
    private boolean canPackageManageGroup(ParcelUuid groupUuid, String callingPackage) {
    private String getOwnerPackageOfSubGroup(ParcelUuid groupUuid) {
        if (groupUuid == null) return null;

        List<SubscriptionInfo> infoList = getSubInfo(SubscriptionManager.GROUP_UUID
                + "=\'" + groupUuid.toString() + "\'", null);

        return ArrayUtils.isEmpty(infoList) ? null : infoList.get(0).getGroupOwner();
    }

    /**
     *
     * @param groupUuid a UUID assigned to the subscription group.
     * @param callingPackage the package making the IPC.
     * @return if callingPackage has carrier privilege on sublist.
     *
     */
    public boolean canPackageManageGroup(ParcelUuid groupUuid, String callingPackage) {
        if (groupUuid == null) {
            throw new IllegalArgumentException("Invalid groupUuid");
        }

        if (TextUtils.isEmpty(callingPackage)) {
            throw new IllegalArgumentException("Empty callingPackage");
        }

        List<SubscriptionInfo> infoList;

        // Getting all subscriptions in the group.
@@ -2891,13 +2932,36 @@ public class SubscriptionController extends ISub.Stub {
            Binder.restoreCallingIdentity(identity);
        }

        if (infoList == null || infoList.isEmpty()) {
        if (ArrayUtils.isEmpty(infoList)) {
            throw new IllegalArgumentException("No subscription in group " + groupUuid);
        }

        // If the calling package is the group owner, skip carrier permission check and return
        // true as it was done before.
        if (callingPackage.equals(infoList.get(0).getGroupOwner())) return true;

        // Check carrier privilege for all subscriptions in the group.
        int[] subIdArray = infoList.stream().mapToInt(info -> info.getSubscriptionId()).toArray();
        return checkCarrierPrivilegeOnSubList(subIdArray, callingPackage);
        int[] subIdArray = infoList.stream().mapToInt(info -> info.getSubscriptionId())
                .toArray();
        return (checkCarrierPrivilegeOnSubList(subIdArray, callingPackage));
    }

    private int updateGroupOwner(ParcelUuid groupUuid, String groupOwner) {
        // If the existing group owner is different from current caller, make caller the new
        // owner of all subscriptions in group.
        // This is for use-case of:
        // 1) Both package1 and package2 has permission (MODIFY_PHONE_STATE or carrier
        // privilege permission) of all related subscriptions.
        // 2) Package 1 created a group.
        // 3) Package 2 wants to add a subscription into it.
        // Step 3 should be granted as all operations are permission based. Which means as
        // long as the package passes the permission check, it can modify the subscription
        // and the group. And package 2 becomes the new group owner as it's the last to pass
        // permission checks on all members.
        ContentValues value = new ContentValues(1);
        value.put(SubscriptionManager.GROUP_OWNER, groupOwner);
        return mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI,
                value, SubscriptionManager.GROUP_UUID + "=\"" + groupUuid + "\"", null);
    }

    @Override
@@ -2911,6 +2975,8 @@ public class SubscriptionController extends ISub.Stub {
            throw new IllegalArgumentException("Invalid groupUuid");
        }

        // Makes sure calling package matches caller UID.
        mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
        // If it doesn't have modify phone state permission, or carrier privilege permission,
        // a SecurityException will be thrown.
        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@@ -2936,11 +3002,11 @@ public class SubscriptionController extends ISub.Stub {
            if (DBG) logdl("addSubscriptionsIntoGroup update DB result: " + result);

            if (result > 0) {
                updateGroupOwner(groupUuid, callingPackage);
                refreshCachedActiveSubscriptionInfoList();
                notifySubscriptionInfoChanged();
                MultiSimSettingController.getInstance().notifySubscriptionGroupChanged(groupUuid);
            }

        } finally {
            Binder.restoreCallingIdentity(identity);
        }
@@ -2968,12 +3034,15 @@ public class SubscriptionController extends ISub.Stub {
        if (subIdList == null || subIdList.length == 0) {
            return;
        }

        // Makes sure calling package matches caller UID.
        mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
        // If it doesn't have modify phone state permission, or carrier privilege permission,
        // a SecurityException will be thrown. If it's due to invalid parameter or internal state,
        // it will return null.
        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
                != PERMISSION_GRANTED && !checkCarrierPrivilegeOnSubList(
                subIdList, callingPackage)) {
                != PERMISSION_GRANTED && !(checkCarrierPrivilegeOnSubList(subIdList, callingPackage)
                && canPackageManageGroup(groupUuid, callingPackage))) {
            throw new SecurityException("removeSubscriptionsFromGroup needs MODIFY_PHONE_STATE or"
                    + " carrier privilege permission on all specified subscriptions");
        }
@@ -2991,14 +3060,17 @@ public class SubscriptionController extends ISub.Stub {
            }
            ContentValues value = new ContentValues();
            value.put(SubscriptionManager.GROUP_UUID, (String) null);
            value.put(SubscriptionManager.GROUP_OWNER, (String) null);
            int result = mContext.getContentResolver().update(SubscriptionManager.CONTENT_URI,
                    value, getSelectionForSubIdList(subIdList), null);

            if (DBG) logdl("removeSubscriptionsFromGroup update DB result: " + result);

            if (result > 0) {
                updateGroupOwner(groupUuid, callingPackage);
                refreshCachedActiveSubscriptionInfoList();

                notifySubscriptionInfoChanged();
            }
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
+12 −5
Original line number Diff line number Diff line
@@ -631,6 +631,9 @@ public class SubscriptionInfoUpdater extends Handler {
            }
            // update default subId
            MultiSimSettingController.getInstance().notifyAllSubscriptionLoaded();
            // broadcast default subId
            SubscriptionController.getInstance().sendDefaultChangedBroadcast(
                    SubscriptionManager.getDefaultSubscriptionId());
        }

        SubscriptionController.getInstance().notifySubscriptionInfoChanged();
@@ -855,19 +858,23 @@ public class SubscriptionInfoUpdater extends Handler {

        String groupUuidString =
                config.getString(CarrierConfigManager.KEY_SUBSCRIPTION_GROUP_UUID_STRING, "");
        ParcelUuid groupId = null;
        ParcelUuid groupUuid = null;
        if (!TextUtils.isEmpty(groupUuidString)) {
            try {
                // Update via a UUID Structure to ensure consistent formatting
                ParcelUuid groupUuid = ParcelUuid.fromString(groupUuidString);
                groupUuid = ParcelUuid.fromString(groupUuidString);
                if (groupUuid.equals(REMOVE_GROUP_UUID)
                            && currentSubInfo.getGroupUuid() != null) {
                    cv.put(SubscriptionManager.GROUP_UUID, (String) null);
                    if (DBG) logd("Group Removed for" + currentSubId);
                } else {
                    // TODO: validate and update group owner information once feasible.
                } else if (SubscriptionController.getInstance().canPackageManageGroup(groupUuid,
                        configPackageName)) {
                    cv.put(SubscriptionManager.GROUP_UUID, groupUuid.toString());
                    cv.put(SubscriptionManager.GROUP_OWNER, configPackageName);
                    if (DBG) logd("Group Added for" + currentSubId);
                } else {
                    loge("configPackageName " + configPackageName + " doesn't own grouUuid "
                            + groupUuid);
                }
            } catch (IllegalArgumentException e) {
                loge("Invalid Group UUID=" + groupUuidString);
@@ -877,7 +884,7 @@ public class SubscriptionInfoUpdater extends Handler {
                    .getUriForSubscriptionId(currentSubId), cv, null, null) > 0) {
            sc.refreshCachedActiveSubscriptionInfoList();
            sc.notifySubscriptionInfoChanged();
            MultiSimSettingController.getInstance().notifySubscriptionGroupChanged(groupId);
            MultiSimSettingController.getInstance().onSubscriptionGroupChanged(groupUuid);
        }
    }

+14 −30

File changed.

Preview size limit exceeded, changes collapsed.

Loading