Loading core/java/android/content/pm/LauncherApps.java +1 −1 Original line number Diff line number Diff line Loading @@ -792,7 +792,7 @@ public class LauncherApps { * * @return an {@link AppUsageLimit} object describing the app time limit containing * the given package with the smallest time remaining, or {@code null} if none exist. * @throws SecurityException when the caller is not the active launcher. * @throws SecurityException when the caller is not the recents app. */ @Nullable public LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String packageName, Loading services/core/java/com/android/server/pm/LauncherAppsService.java +2 −6 Original line number Diff line number Diff line Loading @@ -744,12 +744,8 @@ public class LauncherAppsService extends SystemService { if (!canAccessProfile(user.getIdentifier(), "Cannot access usage limit")) { return null; } final PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class); final ComponentName cn = pmi.getDefaultHomeActivity(user.getIdentifier()); if (!cn.getPackageName().equals(callingPackage)) { throw new SecurityException("Caller is not the active launcher"); if (!mActivityTaskManagerInternal.isCallerRecents(Binder.getCallingUid())) { throw new SecurityException("Caller is not the recents app"); } final UsageStatsManagerInternal.AppUsageLimitData data = Loading Loading
core/java/android/content/pm/LauncherApps.java +1 −1 Original line number Diff line number Diff line Loading @@ -792,7 +792,7 @@ public class LauncherApps { * * @return an {@link AppUsageLimit} object describing the app time limit containing * the given package with the smallest time remaining, or {@code null} if none exist. * @throws SecurityException when the caller is not the active launcher. * @throws SecurityException when the caller is not the recents app. */ @Nullable public LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String packageName, Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +2 −6 Original line number Diff line number Diff line Loading @@ -744,12 +744,8 @@ public class LauncherAppsService extends SystemService { if (!canAccessProfile(user.getIdentifier(), "Cannot access usage limit")) { return null; } final PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class); final ComponentName cn = pmi.getDefaultHomeActivity(user.getIdentifier()); if (!cn.getPackageName().equals(callingPackage)) { throw new SecurityException("Caller is not the active launcher"); if (!mActivityTaskManagerInternal.isCallerRecents(Binder.getCallingUid())) { throw new SecurityException("Caller is not the recents app"); } final UsageStatsManagerInternal.AppUsageLimitData data = Loading