From a74079a2424454f20dedee8f1b29fe8bc1522d63 Mon Sep 17 00:00:00 2001 From: Holly Jiuyu Sun Date: Wed, 9 Jan 2019 13:33:14 -0800 Subject: Allow privileged carrier app to update subscription nickname. Make EuiccManager#updateSubscriptionNickname as public API to allow carrier app to call it. Only a privileged app of the given subscription can update the subscription nickname. Refresh cached subscription list after the nickname is successfully updated. Bug: 122597547 Test: test on phone Change-Id: I63c5ec4366f32735a54adf40b9cc0b47af681736 Merged-In: I63c5ec4366f32735a54adf40b9cc0b47af681736 --- api/current.txt | 1 + telephony/java/android/telephony/euicc/EuiccManager.java | 9 ++++----- .../com/android/internal/telephony/euicc/IEuiccController.aidl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/current.txt b/api/current.txt index 548bc6a26a80..be9163e6cd18 100755 --- a/api/current.txt +++ b/api/current.txt @@ -43396,6 +43396,7 @@ package android.telephony.euicc { method public boolean isEnabled(); method public void startResolutionActivity(android.app.Activity, int, android.content.Intent, android.app.PendingIntent) throws android.content.IntentSender.SendIntentException; method public void switchToSubscription(int, android.app.PendingIntent); + method public void updateSubscriptionNickname(int, java.lang.String, android.app.PendingIntent); field public static final java.lang.String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.telephony.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS"; field public static final java.lang.String ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE = "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE"; field public static final int EMBEDDED_SUBSCRIPTION_RESULT_ERROR = 2; // 0x2 diff --git a/telephony/java/android/telephony/euicc/EuiccManager.java b/telephony/java/android/telephony/euicc/EuiccManager.java index b732d4d92127..53cd689a4971 100644 --- a/telephony/java/android/telephony/euicc/EuiccManager.java +++ b/telephony/java/android/telephony/euicc/EuiccManager.java @@ -546,14 +546,13 @@ public class EuiccManager { /** * Update the nickname for the given subscription. * - *

Requires that the calling app has the - * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. This is for - * internal system use only. + *

Requires that the calling app has carrier privileges according to the metadata of the + * profile to be updated, or the + * {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission. * * @param subscriptionId the ID of the subscription to update. * @param nickname the new nickname to apply. * @param callbackIntent a PendingIntent to launch when the operation completes. - * @hide */ @RequiresPermission(Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void updateSubscriptionNickname( @@ -564,7 +563,7 @@ public class EuiccManager { } try { getIEuiccController().updateSubscriptionNickname( - subscriptionId, nickname, callbackIntent); + subscriptionId, nickname, mContext.getOpPackageName(), callbackIntent); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } diff --git a/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl b/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl index 0a0ad90b5954..549263e9c565 100644 --- a/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl +++ b/telephony/java/com/android/internal/telephony/euicc/IEuiccController.aidl @@ -39,7 +39,7 @@ interface IEuiccController { oneway void switchToSubscription(int subscriptionId, String callingPackage, in PendingIntent callbackIntent); oneway void updateSubscriptionNickname(int subscriptionId, String nickname, - in PendingIntent callbackIntent); + String callingPackage, in PendingIntent callbackIntent); oneway void eraseSubscriptions(in PendingIntent callbackIntent); oneway void retainSubscriptionsForFactoryReset(in PendingIntent callbackIntent); } \ No newline at end of file -- cgit v1.2.3-59-g8ed1b