From 5fbf6b2a0f6d156dc5b3d0687833782fd161db55 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Fri, 12 Apr 2024 18:23:31 +0000 Subject: IPackageManagerNative: Add getPackageUid Bug: 330360505 Test: manual Change-Id: I669976dde4c53932745a98df7165593969e0c436 --- .../aidl/android/content/pm/IPackageManagerNative.aidl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl b/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl index f8a8843309..3ddfefa311 100644 --- a/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl +++ b/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl @@ -42,6 +42,18 @@ interface IPackageManagerNative { */ @utf8InCpp String[] getNamesForUids(in int[] uids); + /** + * Return the UID associated with the given package name. + * Note that the same package will have different UIDs under different UserHandle on + * the same device. + * @param packageName The full name (i.e. com.google.apps.contacts) of the desired package. + * @param flags Additional option flags to modify the data returned. + * @param userId The user handle identifier to look up the package under. + * @return Returns an integer UID who owns the given package name, or -1 if no such package is + * available to the caller. + */ + int getPackageUid(in @utf8InCpp String packageName, in long flags, in int userId); + /** * Returns the name of the installer (a package) which installed the named * package. Preloaded packages return the string "preload". Sideloaded packages -- cgit v1.2.3-59-g8ed1b