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

Commit 0f27b315 authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Fixed CTS EuiccManagerTest on HSUM devices" into main

parents e7d94363 02b70189
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
@@ -19426,4 +19426,48 @@ public class TelephonyManager {
                return "UNKNOWN(" + state + ")";
        }
    }
    /**
     * This API can be used by only CTS to override the Euicc UI component.
     *
     * @param componentName ui component to be launched for testing. {@code null} to reset.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public void setTestEuiccUiComponent(@Nullable ComponentName componentName) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony == null) {
                Rlog.e(TAG, "setTestEuiccUiComponent(): ITelephony instance is NULL");
                throw new IllegalStateException("Telephony service not available.");
            }
            telephony.setTestEuiccUiComponent(componentName);
        } catch (RemoteException ex) {
            Rlog.e(TAG, "setTestEuiccUiComponent() RemoteException : " + ex);
            throw ex.rethrowAsRuntimeException();
        }
    }
    /**
     * This API can be used by only CTS to retrieve the Euicc UI component.
     *
     * @return The Euicc UI component for testing. {@code null} if not available.
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @Nullable
    public ComponentName getTestEuiccUiComponent() {
        try {
            ITelephony telephony = getITelephony();
            if (telephony == null) {
                Rlog.e(TAG, "getTestEuiccUiComponent(): ITelephony instance is NULL");
                throw new IllegalStateException("Telephony service not available.");
            }
            return telephony.getTestEuiccUiComponent();
        } catch (RemoteException ex) {
            Rlog.e(TAG, "getTestEuiccUiComponent() RemoteException : " + ex);
            throw ex.rethrowAsRuntimeException();
        }
    }
}
+16 −0
Original line number Diff line number Diff line
@@ -3409,4 +3409,20 @@ interface ITelephony {
     * @hide
     */
    boolean setSatelliteSubscriberIdListChangedIntentComponent(in String name);

    /**
     * This API can be used by only CTS to override the Euicc UI component.
     *
     * @param componentName ui component to be launched for testing
     * @hide
     */
    void setTestEuiccUiComponent(in ComponentName componentName);

    /**
     * This API can be used by only CTS to retrieve the Euicc UI component.
     *
     * @return The Euicc UI component for testing.
     * @hide
     */
    ComponentName getTestEuiccUiComponent();
}