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

Commit e8302ea6 authored by Peter Wang's avatar Peter Wang Committed by Automerger Merge Worker
Browse files

Merge "Restrict access to the resolution PendingIntent created by...

Merge "Restrict access to the resolution PendingIntent created by EuiccController to EuiccResolutionUiDispatcherActivity" into oc-mr1-dev am: cbb3efd8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/11440587

Change-Id: I7cf6d29f2423a262473c1ca50ff70bf32f53a627
parents ecaa7e3a cbb3efd8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.Manifest.permission;
import android.annotation.Nullable;
import android.app.AppOpsManager;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ComponentInfo;
@@ -73,6 +74,11 @@ public class EuiccController extends IEuiccController.Stub {
    private static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION =
            EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION;

    /** Restrictions limiting access to the PendingIntent */
    private static final String RESOLUTION_ACTIVITY_PACKAGE_NAME = "com.android.phone";
    private static final String RESOLUTION_ACTIVITY_CLASS_NAME =
            "com.android.phone.euicc.EuiccResolutionUiDispatcherActivity";

    private static EuiccController sInstance;

    private final Context mContext;
@@ -955,6 +961,9 @@ public class EuiccController extends IEuiccController.Stub {
    public void addResolutionIntent(Intent extrasIntent, String resolutionAction,
            String callingPackage, boolean confirmationCodeRetried, EuiccOperation op) {
        Intent intent = new Intent(EuiccManager.ACTION_RESOLVE_ERROR);
        intent.setPackage(RESOLUTION_ACTIVITY_PACKAGE_NAME);
        intent.setComponent(new ComponentName(
                        RESOLUTION_ACTIVITY_PACKAGE_NAME, RESOLUTION_ACTIVITY_CLASS_NAME));
        intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_RESOLUTION_ACTION,
                resolutionAction);
        intent.putExtra(EuiccService.EXTRA_RESOLUTION_CALLING_PACKAGE, callingPackage);