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

Commit d9f8e96c authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "[Mainline] Make canManageSubscription(SubscriptionInfo, String) System...

Merge "[Mainline] Make canManageSubscription(SubscriptionInfo, String) System API." am: 5b879d5b am: 4e07be1f

Change-Id: I2a1b24ca0c20046855b26c324f0208ace3e7b47e
parents 5eeb96eb 4e07be1f
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -8914,6 +8914,7 @@ package android.telephony {
  public class SubscriptionManager {
  public class SubscriptionManager {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean canDisablePhysicalSubscription();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean canDisablePhysicalSubscription();
    method public boolean canManageSubscription(@Nullable android.telephony.SubscriptionInfo, @Nullable String);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForIcc(@NonNull String);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForIcc(@NonNull String);
    method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
    method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
+5 −6
Original line number Original line Diff line number Diff line
@@ -2650,8 +2650,7 @@ public class SubscriptionManager {


    /**
    /**
     * Checks whether the app with the given context is authorized to manage the given subscription
     * Checks whether the app with the given context is authorized to manage the given subscription
     * according to its metadata. Only supported for embedded subscriptions (if
     * according to its metadata.
     * {@code SubscriptionInfo#isEmbedded} returns true).
     *
     *
     * @param info The subscription to check.
     * @param info The subscription to check.
     * @return whether the app is authorized to manage this subscription per its metadata.
     * @return whether the app is authorized to manage this subscription per its metadata.
@@ -2664,16 +2663,16 @@ public class SubscriptionManager {
     * Checks whether the given app is authorized to manage the given subscription. An app can only
     * Checks whether the given app is authorized to manage the given subscription. An app can only
     * be authorized if it is included in the {@link android.telephony.UiccAccessRule} of the
     * be authorized if it is included in the {@link android.telephony.UiccAccessRule} of the
     * {@link android.telephony.SubscriptionInfo} with the access status.
     * {@link android.telephony.SubscriptionInfo} with the access status.
     * Only supported for embedded subscriptions (if {@link SubscriptionInfo#isEmbedded}
     * returns true).
     *
     *
     * @param info The subscription to check.
     * @param info The subscription to check.
     * @param packageName Package name of the app to check.
     * @param packageName Package name of the app to check.
     * @return whether the app is authorized to manage this subscription per its access rules.
     * @return whether the app is authorized to manage this subscription per its access rules.
     * @hide
     * @hide
     */
     */
    public boolean canManageSubscription(SubscriptionInfo info, String packageName) {
    @SystemApi
        if (info == null || info.getAllAccessRules() == null) {
    public boolean canManageSubscription(@Nullable SubscriptionInfo info,
            @Nullable String packageName) {
        if (info == null || info.getAllAccessRules() == null || packageName == null) {
            return false;
            return false;
        }
        }
        PackageManager packageManager = mContext.getPackageManager();
        PackageManager packageManager = mContext.getPackageManager();