From 21c5c6fb0a00d1a90b464cf4b145de4579b05431 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Wed, 12 Oct 2016 14:21:51 -0700 Subject: [PATCH] Secure MATCH_UNINSTALLED_PACKAGES across users Introduce a new internal flag MATCH_ANY_USER for genuine uses of searching through all apps on the device. Some temporary accommodations for Launchers that reach across to the work profile until we have a new LauncherApps API to do that officially. Bug: 31000380 Test: CTS tests added Change-Id: I2e43dc49d6c2e11814a8f8d1eb07ef557f31af34 --- .../core/java/com/android/server/net/NetworkStatsService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java index 4658c0463f..8ca608693b 100644 --- a/services/core/java/com/android/server/net/NetworkStatsService.java +++ b/services/core/java/com/android/server/net/NetworkStatsService.java @@ -1212,7 +1212,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub { // Build list of UIDs that we should clean up int[] uids = new int[0]; final List apps = mContext.getPackageManager().getInstalledApplications( - PackageManager.GET_UNINSTALLED_PACKAGES | PackageManager.GET_DISABLED_COMPONENTS); + PackageManager.MATCH_ANY_USER + | PackageManager.MATCH_DISABLED_COMPONENTS); for (ApplicationInfo app : apps) { final int uid = UserHandle.getUid(userId, app.uid); uids = ArrayUtils.appendInt(uids, uid);