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

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

Merge "Fetches sim service table from the EF_SST elementary file of the sim"

parents 72588ae7 9cb5462a
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -8416,6 +8416,51 @@ public class TelephonyManager {
        return -1;
    }
    /**
     * Fetches the sim service table from the EFUST/EFIST based on the application type
     * {@link #APPTYPE_USIM} or {@link #APPTYPE_ISIM}. The return value is hexaString format
     * representing X bytes (x >= 1). Each bit of every byte indicates which optional services
     * are available for the given application type.
     * The USIM service table EF is described in as per Section 4.2.8 of 3GPP TS 31.102.
     * The ISIM service table EF is described in as per Section 4.2.7 of 3GPP TS 31.103.
     * The list of services mapped to the exact nth byte of response as mentioned in Section 4.2
     * .7 of 3GPP TS 31.103. Eg. Service n°1: Local Phone Book, Service n°2: Fixed Dialling
     * Numbers (FDN) - Bit 1 and 2 of the 1st Byte represent service Local Phone Book and Fixed
     * Dialling Numbers (FDN)respectively. The coding format for each service type  should be
     * interpreted as bit = 1: service available;bit = 0:service not available.
     *
     * @param appType of type int of either {@link #APPTYPE_USIM} or {@link #APPTYPE_ISIM}.
     * @return HexString represents sim service table else null.
     * @throws SecurityException if the caller does not have the required permission/privileges
     * @hide
     */
    @Nullable
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION)
    public String getSimServiceTable(int appType) {
        try {
            IPhoneSubInfo info = getSubscriberInfoService();
            if (info == null) {
                Rlog.e(TAG, "getSimServiceTable(): IPhoneSubInfo is null");
                return null;
            }
            //Fetches the sim service table based on subId and appType
            if (appType == APPTYPE_ISIM) {
                return info.getIsimIst(getSubId());
            } else if ((appType == APPTYPE_USIM)) {
                return info.getSimServiceTable(getSubId(), APPTYPE_USIM);
            } else {
                return null;
            }
        } catch (RemoteException ex) {
            Rlog.e(TAG, "getSimServiceTable(): RemoteException=" + ex.getMessage());
        } catch (NullPointerException ex) {
            Rlog.e(TAG, "getSimServiceTable(): NullPointerException=" + ex.getMessage());
        }
        return null;
    }
    /**
     * Resets the {@link android.telephony.ims.ImsService} associated with the specified sim slot.
     * Used by diagnostic apps to force the IMS stack to be disabled and re-enabled in an effort to
@@ -15920,6 +15965,17 @@ public class TelephonyManager {
        sITelephony = telephony;
    }
    /**
     * Setup sIPhoneSubInfo for testing.
     * @hide
     */
    @VisibleForTesting
    public static void setupIPhoneSubInfoForTest(IPhoneSubInfo iPhoneSubInfo) {
        synchronized (sCacheLock) {
            sIPhoneSubInfo = iPhoneSubInfo;
        }
    }
    /**
     * Whether device can connect to 5G network when two SIMs are active.
     * @hide
+22 −0
Original line number Diff line number Diff line
@@ -232,4 +232,26 @@ interface IPhoneSubInfo {
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
    String getSmscIdentity(int subId, int appType);

    /**
     * Fetches the sim service table from the EFUST/EFIST based on the application type
     * {@link #APPTYPE_USIM} or {@link #APPTYPE_ISIM}. The return value is hexaString format
     * representing X bytes (x >= 1). Each bit of every byte indicates which optional services
     * are available for the given application type.
     * The USIM service table EF is described in as per Section 4.2.8 of 3GPP TS 31.102.
     * The ISIM service table EF is described in as per Section 4.2.7 of 3GPP TS 31.103.
     * The list of services mapped to the exact nth byte of response as mentioned in Section 4.2
     * .7 of 3GPP TS 31.103. Eg. Service n°1: Local Phone Book, Service n°2: Fixed Dialling
     * Numbers (FDN) - Bit 1 and 2 of the 1st Byte represent service Local Phone Book and Fixed
     * Dialling Numbers (FDN)respectively. The coding format for each service type  should be
     * interpreted as bit = 1: service available;bit = 0:service not available.
     *
     * @param appType of type int of either {@link #APPTYPE_USIM} or {@link #APPTYPE_ISIM}.
     * @return HexString represents sim service table else null.
     * @throws SecurityException if the caller does not have the required permission/privileges
     * @hide
     */

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
    String getSimServiceTable(int subId, int appType);
}