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

Commit dfb3f561 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allows to launch only authenticator owned activities" into rvc-dev

parents 6d2ad68e d6d8f988
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -197,14 +197,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) {