Merge "Allows to launch only authenticator owned activities" into rvc-dev am: dfb3f561ea am: e9a5de28af

Change-Id: I15a1e15d9be1629674cc990b7425d9af112eb6ca
This commit is contained in:
TreeHugger Robot
2020-05-13 05:40:50 +00:00
committed by Automerger Merge Worker

View File

@@ -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) {