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

Commit 2ca88ac6 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Allow renaming inactive subscriptions.

Test: manual
Bug: 132922483
Merged-in: Ic50ceaa094fd592dd25c97ef0bd81f189aa80eeb
Change-Id: Ic50ceaa094fd592dd25c97ef0bd81f189aa80eeb
(cherry picked from commit 5018baa1)
parent 44006817
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1559,10 +1559,14 @@ public class SubscriptionController extends ISub.Stub {
        final long identity = Binder.clearCallingIdentity();
        try {
            validateSubId(subId);
            for (SubscriptionInfo subInfo : mCacheActiveSubInfoList) {
            List<SubscriptionInfo> allSubInfo = getSubInfo(null, null);
            // if there is no sub in the db, return 0 since subId does not exist in db
            if (allSubInfo == null || allSubInfo.isEmpty()) return 0;
            for (SubscriptionInfo subInfo : allSubInfo) {
                if (subInfo.getSubscriptionId() == subId
                        && getNameSourcePriority(subInfo.getNameSource())
                                > getNameSourcePriority(nameSource)) {
                        && (getNameSourcePriority(subInfo.getNameSource())
                                > getNameSourcePriority(nameSource)
                        || (displayName != null && displayName.equals(subInfo.getDisplayName())))) {
                    return 0;
                }
            }