Use my uid to filter application info

Passing the user is a mistake and would result in using 0, 10, 11 as the
filtering uids.

The calling code already checks that the caller has requisite
permissions to report the change.

Test: atest PlatformCompatGating

Bug: 184390547
Change-Id: I351db5c222c24348b8f98db618c959348842b956
This commit is contained in:
Suprabh Shukla
2021-06-23 18:14:12 -07:00
parent a7807022fe
commit 528308d4f6

View File

@@ -36,6 +36,7 @@ import android.content.pm.PackageManagerInternal;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Slog;
@@ -359,7 +360,7 @@ public class PlatformCompat extends IPlatformCompat.Stub {
private ApplicationInfo getApplicationInfo(String packageName, int userId) {
return LocalServices.getService(PackageManagerInternal.class).getApplicationInfo(
packageName, 0, userId, userId);
packageName, 0, Process.myUid(), userId);
}
private void killPackage(String packageName) {