Merge "Set Assistant UID of the current user."
am: 19a2507ea5
Change-Id: I122144d2c9df8e6679435b9afd860353e3f11296
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 24569a6..1f1e8a5 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -1461,10 +1461,13 @@
}
if (!TextUtils.isEmpty(packageName)) {
PackageManager pm = mContext.getPackageManager();
+ ActivityManager am =
+ (ActivityManager) mContext.getSystemService(mContext.ACTIVITY_SERVICE);
+
if (pm.checkPermission(Manifest.permission.CAPTURE_AUDIO_HOTWORD, packageName)
== PackageManager.PERMISSION_GRANTED) {
try {
- assistantUid = pm.getPackageUid(packageName, 0);
+ assistantUid = pm.getPackageUidAsUser(packageName, am.getCurrentUser());
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG,
"updateAssistantUId() could not find UID for package: " + packageName);