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

Commit 1b17c8ac authored by Arun kumar Voddu's avatar Arun kumar Voddu Committed by Android (Google) Code Review
Browse files

Merge "IMPI system API implementation"

parents f37cb530 e11231df
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -6000,6 +6000,7 @@ public class TelephonyManager {
     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
     * @return the IMPI, or null if not present or not loaded
     * @hide
     * @deprecated use {@link #getImsPrivateUserIdentity()}
     */
    @UnsupportedAppUsage
    public String getIsimImpi() {
@@ -6017,6 +6018,35 @@ public class TelephonyManager {
        }
    }
    /**
     * Returns the IMS private user identity (IMPI) of the subscription that was loaded from the
     * ISIM records {@link #APPTYPE_ISIM}. This value is fetched from the Elementary file EF_IMPI.
     * The contents of the file is a <b>Ip Multimedia Service Private User Identity</b> of the user
     * as defined in the section 4.2.2 of 3GPP TS 131 103.
     *
     * @return IMPI (IMS private user identity) of type string.
     * @throws IllegalStateException in case the ISIM has’t been loaded
     * @throws SecurityException if the caller does not have the required permission/privileges
     * @hide
     */
    @NonNull
    @RequiresPermission(android.Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER)
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION)
    public String getImsPrivateUserIdentity() {
        try {
            IPhoneSubInfo info = getSubscriberInfoService();
            if (info == null) {
                Rlog.e(TAG, "getImsPrivateUserIdentity(): IPhoneSubInfo instance is NULL");
                throw new RuntimeException("IMPI error: Subscriber Info is null");
            }
            return info.getImsPrivateUserIdentity(getSubId(), getOpPackageName(),
                    getAttributionTag());
        } catch (RemoteException | NullPointerException | IllegalArgumentException ex) {
            Rlog.e(TAG, "getImsPrivateUserIdentity() Exception = " + ex);
            throw new RuntimeException(ex.getMessage());
        }
    }
    /**
     * Returns the IMS home network domain name that was loaded from the ISIM {@see #APPTYPE_ISIM}.
     * @return the IMS domain name. Returns {@code null} if ISIM hasn't been loaded or IMS domain
+13 −0
Original line number Diff line number Diff line
@@ -179,6 +179,19 @@ interface IPhoneSubInfo {
     */
    String getIsimImpi(int subId);

    /**
     * Fetches the ISIM PrivateUserIdentity (EF_IMPI) based on subId
     *
     * @param subId subscriptionId
     * @return IMPI (IMS private user identity) of type string or null if EF_IMPI is not available.
     * @throws IllegalArgumentException if the subscriptionId is not valid
     * @throws IllegalStateException in case the ISIM hasn’t been loaded.
     * @throws SecurityException if the caller does not have the required permission
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
            + "android.Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER)")
    String getImsPrivateUserIdentity(int subId, String callingPackage, String callingFeatureId);

    /**
     * Returns the IMS home network domain name that was loaded from the ISIM.
     * @return the IMS domain name, or null if not present or not loaded