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

Commit ed89969a authored by Junho Yoon's avatar Junho Yoon Committed by Android (Google) Code Review
Browse files

Merge "Add interface to provide IARI values and SET UP EVENT LIST" into main

parents 97d8da20 6ee2c421
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16491,6 +16491,7 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestModemActivityInfo(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.telephony.ModemActivityInfo,android.telephony.TelephonyManager.ModemActivityInfoException>);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestRadioPowerOffForReason(int);
    method @FlaggedApi("com.android.internal.telephony.flags.support_ims_registration_event_download") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void requestUiccIari(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.util.Set<java.lang.String>,java.lang.Exception>);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetAllCarrierActions();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetCarrierKeysForImsiEncryption();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void resetIms(int);
@@ -16554,6 +16555,7 @@ package android.telephony {
    field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
    field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
    field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
    field @FlaggedApi("com.android.internal.telephony.flags.support_ims_registration_event_download") @RequiresPermission("android.permission.RECEIVE_STK_COMMANDS") public static final String ACTION_STK_SETUP_EVENT_LIST = "android.telephony.action.STK_SETUP_EVENT_LIST";
    field public static final int ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G = 3; // 0x3
    field public static final int ALLOWED_NETWORK_TYPES_REASON_POWER = 1; // 0x1
    field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
@@ -16588,6 +16590,7 @@ package android.telephony {
    field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID";
    field public static final String EXTRA_PHONE_IN_ECM_STATE = "android.telephony.extra.PHONE_IN_ECM_STATE";
    field public static final String EXTRA_PHONE_IN_EMERGENCY_CALL = "android.telephony.extra.PHONE_IN_EMERGENCY_CALL";
    field @FlaggedApi("com.android.internal.telephony.flags.support_ims_registration_event_download") public static final String EXTRA_SETUP_EVENT_LIST = "android.telephony.extra.SETUP_EVENT_LIST";
    field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
    field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
    field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
+2 −0
Original line number Diff line number Diff line
@@ -858,6 +858,8 @@
    <!-- Added in 25Q4 -->
    <protected-broadcast android:name="android.intent.action.STOP_VOICE_COMMAND" />
    <!-- Added in 26Q2 -->
    <protected-broadcast android:name="android.telephony.action.STK_SETUP_EVENT_LIST" />
    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
+117 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static com.android.internal.util.Preconditions.checkNotNull;
import android.Manifest;
import android.annotation.BoolRes;
import android.annotation.BroadcastBehavior;
import android.annotation.BytesLong;
import android.annotation.CallbackExecutor;
import android.annotation.CurrentTimeMillisLong;
@@ -71,6 +72,7 @@ import android.os.OutcomeReceiver;
import android.os.ParcelFileDescriptor;
import android.os.ParcelUuid;
import android.os.Parcelable;
import android.os.ParcelableException;
import android.os.PersistableBundle;
import android.os.RemoteException;
import android.os.ResultReceiver;
@@ -2181,6 +2183,42 @@ public class TelephonyManager {
    public static final String ACTION_RESET_MOBILE_NETWORK_SETTINGS =
            "android.telephony.action.RESET_MOBILE_NETWORK_SETTINGS";
    /**
     * Broadcast intent action indicating the SET UP EVENT LIST received from the UICC has
     * changed.
     *
     * <p> The intent will have the following extra values:</p>
     * <ul>
     *   <li>{@link #EXTRA_SUBSCRIPTION_ID}</li>
     *   <li>{@link #EXTRA_SETUP_EVENT_LIST}</li>
     * </ul>
     * <p class="note">Requires the STK_PERMISSION.</p>
     * <p class="note">This is a protected intent that can only be sent by the system.</p>
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_IMS_REGISTRATION_EVENT_DOWNLOAD)
    @RequiresPermission(android.Manifest.permission.RECEIVE_STK_COMMANDS)
    @SystemApi
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @BroadcastBehavior(explicitOnly = true)
    public static final String ACTION_STK_SETUP_EVENT_LIST =
            "android.telephony.action.STK_SETUP_EVENT_LIST";
    /**
     * Extra included in {@link #ACTION_STK_SETUP_EVENT_LIST}.
     * It indicates changed list of SET UP EVENT LIST. UICC supplies this list of events
     * which it wants the terminal to provide details of when these events happen.
     * Each event in the list shall be coded with one of the values in 8.25 of TS 102.223
     * (e.g. IMS Registration = 0x17)
     *
     * <p class="note"> Retrieve with
     * {@link android.content.Intent#getIntArrayExtra(String)}.</p>
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_IMS_REGISTRATION_EVENT_DOWNLOAD)
    @SystemApi
    public static final String EXTRA_SETUP_EVENT_LIST = "android.telephony.extra.SETUP_EVENT_LIST";
    //
    //
    // Device Info
@@ -8978,6 +9016,85 @@ public class TelephonyManager {
        return Collections.EMPTY_LIST;
    }
    /**
     * The key to indicate the result of the ResultReceiver in the {@link #requestUiccIari}.
     * @hide
     */
    public static final String KEY_UICC_IARI_LIST = "uicc_iari_list";
    /**
     * The key to indicate the exception of the ResultReceiver in the {@link #requestUiccIari}.
     * @hide
     */
    public static final String KEY_UICC_IARI_EXCEPTION = "uicc_iari_exception";
    /**
     * Fetches the IMS Application Reference Identifier(IARI) that was loaded from the UICC.
     * If an error occurs internally during the process of fetching IARI,
     * an exception is passed through the onError callback.
     * <ul>
     *   <li>IllegalArgumentException : if the subscriptionId is not valid</li>
     *   <li>SecurityException : if the caller does not have the required permission</li>
     *   <li>UnsupportedOperationException : if the device does not have
     *   {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}</li>
     * </ul>
     *
     * @param executor executor to run the callback on.
     * @param callback callback object to which the result will be delivered.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_IMS_REGISTRATION_EVENT_DOWNLOAD)
    @SystemApi
    @RequiresPermission(value = Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @RequiresFeature(PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION)
    public void requestUiccIari(@NonNull Executor executor,
            @NonNull OutcomeReceiver<Set<String>, Exception> callback) {
        Objects.requireNonNull(executor);
        Objects.requireNonNull(callback);
        IPhoneSubInfo info = getSubscriberInfoService();
        if (info == null) {
            executor.execute(() -> callback.onError(
                    new RuntimeException("requestUiccIari : Subscriber Info is null")));
            return;
        }
        ResultReceiver wrappedCallback = new ResultReceiver(null) {
            @Override
            protected void onReceiveResult(int resultCode, Bundle result) {
                ParcelableException e = result.getParcelable(
                        KEY_UICC_IARI_EXCEPTION, android.os.ParcelableException.class);
                if (e != null) {
                    Throwable t = e.getCause();
                    if (t instanceof IllegalArgumentException || t instanceof SecurityException
                            || t instanceof UnsupportedOperationException) {
                        executor.execute(() -> callback.onError((Exception) t));
                    } else {
                        executor.execute(() -> callback.onError(
                                new RuntimeException("requestUiccIari : " + t.getMessage())));
                    }
                } else {
                    List<String> iaris = result.getStringArrayList(KEY_UICC_IARI_LIST);
                    Set<String> iariSet = (iaris != null) ? new HashSet<>(iaris) : new HashSet<>();
                    Rlog.e(TAG, "requestUiccIari onReceiveResult: " + iariSet);
                    executor.execute(() -> callback.onResult(iariSet));
                }
            }
        };
        try {
            if (isApplicationOnUicc(APPTYPE_ISIM)) {
                info.getUiccIari(getSubId(), APPTYPE_ISIM, getOpPackageName(), wrappedCallback);
            } else if (isApplicationOnUicc(APPTYPE_USIM)) {
                info.getUiccIari(getSubId(), APPTYPE_USIM, getOpPackageName(), wrappedCallback);
            } else {
                executor.execute(() -> callback.onError(new RuntimeException(
                        "requestUiccIari : ISIM or USIM application is not exist in UICC")));
            }
        } catch (Exception ex) {
            executor.execute(() -> callback.onError(ex));
        }
    }
    /** UICC application type is unknown or not specified */
    public static final int APPTYPE_UNKNOWN = PhoneConstants.APPTYPE_UNKNOWN;
    /** UICC application type is SIM */
+15 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony;

import android.os.ResultReceiver;
import android.telephony.ImsiEncryptionInfo;
import android.net.Uri;

@@ -294,4 +295,18 @@ interface IPhoneSubInfo {
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
    String getSimServiceTable(int subId, int appType);

    /**
     * Fetches the IMS Application Reference Identifier(IAIR) based on the subscription.
     *
     * @param subId subscriptionId
     * @param appType the uicc app type
     * @param callingPackage package name of the caller
     * @param callback result receiver to get the iist of IARI strings. The result code is ignored.
     * @throws IllegalArgumentException if the subscriptionId is not valid
     * @throws SecurityException if the caller does not have the required permission
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
    oneway void getUiccIari(int subId, int appType, String callingPackage,
        in ResultReceiver callback);
}