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

Commit fefc85a4 authored by Alireza Forouzan's avatar Alireza Forouzan Committed by Android (Google) Code Review
Browse files

Merge "Add an API to getPhoneAccountHandle for a TelephonyManager" into sc-dev

parents ed21f7f9 32d484c8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -42364,6 +42364,7 @@ package android.telephony {
    method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public void getNetworkSlicingConfiguration(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.telephony.data.SlicingConfig,android.telephony.TelephonyManager.SlicingException>);
    method public String getNetworkSpecifier();
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType();
    method @Nullable @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method @Deprecated public int getPhoneCount();
    method public int getPhoneType();
    method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription();
+19 −0
Original line number Diff line number Diff line
@@ -11036,6 +11036,25 @@ public class TelephonyManager {
        return retval;
    }
    /**
     * Determines the {@link PhoneAccountHandle} associated with this TelephonyManager.
     *
     * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
     * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
     *
     * <p>Requires Permission android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE or that the
     * calling app has carrier privileges (see {@link #hasCarrierPrivileges})
     *
     * @return The {@link PhoneAccountHandle} associated with the TelphonyManager, or {@code null}
     * if there is no associated {@link PhoneAccountHandle}; this can happen if the subscription is
     * data-only or an opportunistic subscription.
     */
    @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    public @Nullable PhoneAccountHandle getPhoneAccountHandle() {
        return getPhoneAccountHandleForSubscriptionId(getSubId());
    }
    /**
     * Determines the {@link PhoneAccountHandle} associated with a subscription Id.
     *