Merge "Fix Rescue Party observability criteria" into rvc-qpr-dev am: a4d6ee2b00

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12684684

Change-Id: I5efd0e350a015c0dffe0170dff16195b5a753a5a
This commit is contained in:
Gavin Corkery
2020-09-24 15:54:40 +00:00
committed by Automerger Merge Worker

View File

@@ -454,10 +454,14 @@ public class RescueParty {
public boolean mayObservePackage(String packageName) {
PackageManager pm = mContext.getPackageManager();
try {
// A package is a Mainline module if this is non-null
// A package is a module if this is non-null
if (pm.getModuleInfo(packageName, 0) != null) {
return true;
}
} catch (PackageManager.NameNotFoundException ignore) {
}
try {
ApplicationInfo info = pm.getApplicationInfo(packageName, 0);
return (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK;
} catch (PackageManager.NameNotFoundException e) {