Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24b62eb6 authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Use IPackageManager.getServiceInfo

The legacy check isn't correct in the HSUM case.

Flag: EXEMPT bugfix
Test: manually verified the fix
Test: presubmit
Bug: 360068787
Change-Id: I613507e8250ffb7ad58c433f4ba4511414f58de6
parent 5508c034
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1513,11 +1513,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            }
            if (wallpaper.getComponent() != null
                    && isPackageModified(wallpaper.getComponent().getPackageName())) {
                ServiceInfo serviceInfo = null;
                try {
                    mContext.getPackageManager().getServiceInfo(wallpaper.getComponent(),
                            PackageManager.MATCH_DIRECT_BOOT_AWARE
                                    | PackageManager.MATCH_DIRECT_BOOT_UNAWARE);
                } catch (NameNotFoundException e) {
                    serviceInfo = mIPackageManager.getServiceInfo(
                            wallpaper.getComponent(), PackageManager.MATCH_DIRECT_BOOT_AWARE
                                    | PackageManager.MATCH_DIRECT_BOOT_UNAWARE, wallpaper.userId);
                } catch (RemoteException e) {
                    Slog.w(TAG, "Failed to call IPackageManager.getServiceInfo", e);
                }
                if (serviceInfo == null) {
                    Slog.e(TAG, "Wallpaper component gone, removing: "
                            + wallpaper.getComponent());
                    clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, false, null);