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

Commit 9c6ab4cb authored by Sunny Shao's avatar Sunny Shao Committed by Automerger Merge Worker
Browse files

Allows to launch only authenticator owned activities am: 818fef48

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11802014

Change-Id: I931654780a07f5e8f52dc875854545771d99bcde
parents f2754332 818fef48
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -196,14 +196,7 @@ public class AccountTypePreferenceLoader {
        ActivityInfo resolvedActivityInfo = resolveInfo.activityInfo;
        ApplicationInfo resolvedAppInfo = resolvedActivityInfo.applicationInfo;
        try {
            if (resolvedActivityInfo.exported) {
                if (resolvedActivityInfo.permission == null) {
                    return true; // exported activity without permission.
                } else if (pm.checkPermission(resolvedActivityInfo.permission,
                    authDesc.packageName) == PackageManager.PERMISSION_GRANTED) {
                    return true;
                }
            }
            // Allows to launch only authenticator owned activities.
            ApplicationInfo authenticatorAppInf = pm.getApplicationInfo(authDesc.packageName, 0);
            return resolvedAppInfo.uid == authenticatorAppInf.uid;
        } catch (NameNotFoundException e) {