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

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

Allows to launch only authenticator owned activities am: 4b6e82fd

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

Change-Id: I6947d37693042f278aba9774ca5e3a3e954ed845
parents 5045f120 4b6e82fd
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -194,14 +194,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) {