From 7c29701451eaf2688cbbb64cf46cda6be05dfdb1 Mon Sep 17 00:00:00 2001 From: Corina Grigoras Date: Fri, 15 Oct 2021 12:51:45 +0000 Subject: [PATCH] Revert "WallpaperManagerService - avoid leaking whether a package is installed" This reverts commit 5451c68cf02d4f3fa9ff169fcc1916930d60eb2b. Reason for revert: b/202757443 Change-Id: Iebf8e6f6dd9892764d2df2594a82caf426dab874 --- .../server/wallpaper/WallpaperManagerService.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index c968570221ddb..e190b1e931ed9 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -2260,17 +2260,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub IWallpaperManagerCallback cb, final int which, Bundle outParams, int wallpaperUserId) { final boolean hasPrivilege = hasPermission(READ_WALLPAPER_INTERNAL); if (!hasPrivilege) { - try { - mContext.getSystemService(StorageManager.class).checkPermissionReadImages(true, - Binder.getCallingPid(), Binder.getCallingUid(), callingPkg, - callingFeatureId); - } catch (Exception e) { - // If the calling package name does not match a package installed on the system, - // an exception is thrown. Don't allow that exception to be thrown, otherwise, - // there is a difference in control flow that allows calling apps to determine - // if a package is installed on the device. - return null; - } + mContext.getSystemService(StorageManager.class).checkPermissionReadImages(true, + Binder.getCallingPid(), Binder.getCallingUid(), callingPkg, callingFeatureId); } wallpaperUserId = ActivityManager.handleIncomingUser(Binder.getCallingPid(),