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

Commit 06ad0f5a authored by Jackal Guo's avatar Jackal Guo
Browse files

Fix shell command 'list staged-sessions'

After applying visibility to get session info APIs, ROOT_UID should
still be able to list staged-sessions via adb shell.

Bug: 204141763
Test: manually test 'pm list staged-sessions' via adb shell with and
      without root to verify if the result is the same.
Change-Id: I09a8a146be82deba10d3b11deea7a0b344a36c56
parent 4adb5658
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8914,7 +8914,8 @@ public class PackageManagerService extends IPackageManager.Stub
     * return {@code true} if any one application belongs to the shared user ID meets the criteria.
     */
    boolean canQueryPackage(int callingUid, @Nullable String targetPackageName) {
        if (targetPackageName == null) {
        // Since getSettingLPr returns null for ROOT_UID, add an extra check for it here.
        if (callingUid == Process.ROOT_UID || targetPackageName == null) {
            return true;
        }
        synchronized (mLock) {