More encryption-aware triaging.
Most of these callers are okay having results omitted when a package
is uninstalled or encryption unaware. For example, jobs and
notifications can only be enqueued by already running apps.
When clearing zen rules, keep around rules inserted by apps on
ejected external storage devices.
Make ServiceWatcher stricter by requiring that the matching package
be in the system image.
Bug: 26471205, 27105254
Change-Id: Ie41ea8042ac1a54e9cbe0c35cec89e70521e9bed
diff --git a/services/core/java/com/android/server/ServiceWatcher.java b/services/core/java/com/android/server/ServiceWatcher.java
index 9a773f2..383e25a 100644
--- a/services/core/java/com/android/server/ServiceWatcher.java
+++ b/services/core/java/com/android/server/ServiceWatcher.java
@@ -92,9 +92,8 @@
String pkg = initialPackageNames.get(i);
try {
HashSet<Signature> set = new HashSet<Signature>();
- Signature[] sigs = pm.getPackageInfo(pkg,
- PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE
- | PackageManager.GET_SIGNATURES).signatures;
+ Signature[] sigs = pm.getPackageInfo(pkg, PackageManager.MATCH_SYSTEM_ONLY
+ | PackageManager.GET_SIGNATURES).signatures;
set.addAll(Arrays.asList(sigs));
sigSets.add(set);
} catch (NameNotFoundException e) {