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

Change-Id: Ie8950c1eb2675895968cd02229043cdf6bce471b
This commit is contained in:
TreeHugger Robot
2020-05-13 05:40:48 +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) {