From 3051caac52729c8c059eb538805f4d274a9945a5 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Tue, 23 May 2017 15:54:18 -0700 Subject: System installed launcher can see instant apps Change-Id: I97f791b61f9b4f7ed33305345bf3d92394b40ae4 Fixes: 38202759 Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest Test: Manual. Create sample app that replaces the launcher to test ability to see ephemeral apps. --- .../usage/java/com/android/server/usage/UsageStatsService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'services/usage/java') diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 0de3c7c75016..5211fd6af744 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -411,8 +411,8 @@ public class UsageStatsService extends SystemService implements } } - private boolean shouldObfuscateInstantAppsForCaller(int callingUid) { - return !mPackageManagerInternal.canAccessInstantApps(callingUid); + private boolean shouldObfuscateInstantAppsForCaller(int callingUid, int userId) { + return !mPackageManagerInternal.canAccessInstantApps(callingUid, userId); } void clearAppIdleForPackage(String packageName, int userId) { @@ -1387,7 +1387,7 @@ public class UsageStatsService extends SystemService implements } final boolean obfuscateInstantApps = shouldObfuscateInstantAppsForCaller( - Binder.getCallingUid()); + Binder.getCallingUid(), UserHandle.getCallingUserId()); final int userId = UserHandle.getCallingUserId(); final long token = Binder.clearCallingIdentity(); @@ -1432,7 +1432,7 @@ public class UsageStatsService extends SystemService implements } final boolean obfuscateInstantApps = shouldObfuscateInstantAppsForCaller( - Binder.getCallingUid()); + Binder.getCallingUid(), UserHandle.getCallingUserId()); final int userId = UserHandle.getCallingUserId(); final long token = Binder.clearCallingIdentity(); @@ -1453,7 +1453,7 @@ public class UsageStatsService extends SystemService implements throw re.rethrowFromSystemServer(); } final boolean obfuscateInstantApps = shouldObfuscateInstantAppsForCaller( - Binder.getCallingUid()); + Binder.getCallingUid(), userId); final long token = Binder.clearCallingIdentity(); try { return UsageStatsService.this.isAppIdleFilteredOrParoled(packageName, userId, -- cgit v1.2.3-59-g8ed1b