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

Commit 9ea2d7cc authored by Jackal Guo's avatar Jackal Guo
Browse files

Use userId to query the package uid instead of 0.

The target package may not be always installed on the user 0. Since
getPacakgeUid would check the package installed state now, we should
use the valid userId to query the package uid.

Bug: 186180067
Test: atest -p services/core/java/com/android/server/am
Change-Id: Iaac8e56f3dcc97145d4c21fb092aac892fa59231
parent c0a44448
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4136,7 +4136,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        if (appId < 0 && packageName != null) {
            try {
                appId = UserHandle.getAppId(AppGlobals.getPackageManager()
                        .getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, 0));
                        .getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, userId));
            } catch (RemoteException e) {
            }
        }