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

Commit f6d5e705 authored by Holly Jiuyu Sun's avatar Holly Jiuyu Sun
Browse files

Update nickname on eUICC chip.

When the caller calls SubMan#setDisplayName, should also update the
nickname on the chip. Otherwise, the nickname will be disappeared
after FDR. EuiccManager will handle the case if eSIM is not active.

Bug: 37355373
Test: test on phone
Change-Id: I4b2b5d0fcfc551140d92f0bd031a9a1e0cc58c2e
parent 95b7757b
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1596,9 +1596,18 @@ public class SubscriptionController extends ISub.Stub {
                value.put(SubscriptionManager.NAME_SOURCE, nameSource);
            }
            if (DBG) logd("[setDisplayName]- mDisplayName:" + nameToSet + " set");
            // TODO(b/33075886): If this is an embedded subscription, we must also save the new name
            // to the eSIM itself. Currently it will be blown away the next time the subscription
            // list is updated.

            // Update the nickname on the eUICC chip if it's an embedded subscription.
            SubscriptionInfo sub = getSubscriptionInfo(subId);
            if (sub != null && sub.isEmbedded()) {
                // Ignore the result.
                if (DBG) logd("Updating embedded sub nickname.");
                EuiccManager euiccManager = (EuiccManager)
                        mContext.getSystemService(Context.EUICC_SERVICE);
                euiccManager.updateSubscriptionNickname(subId, displayName,
                        PendingIntent.getService(
                            mContext, 0 /* requestCode */, new Intent(), 0 /* flags */));
            }

            int result = mContext.getContentResolver().update(
                    SubscriptionManager.getUriForSubscriptionId(subId), value, null, null);