Pass along the user id to AttributeCache requests
Bug: 9759331
Change-Id: Ib96ba6a89c58edc207021aa43a2b67b4f6c50117
diff --git a/services/java/com/android/server/AttributeCache.java b/services/java/com/android/server/AttributeCache.java
index 81378dc..427dbc0 100644
--- a/services/java/com/android/server/AttributeCache.java
+++ b/services/java/com/android/server/AttributeCache.java
@@ -23,6 +23,7 @@
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
+import android.os.UserHandle;
import android.util.SparseArray;
import java.util.HashMap;
@@ -94,7 +95,7 @@
}
}
- public Entry get(String packageName, int resId, int[] styleable) {
+ public Entry get(String packageName, int resId, int[] styleable, int userId) {
synchronized (this) {
Package pkg = mPackages.get(packageName);
HashMap<int[], Entry> map = null;
@@ -110,7 +111,8 @@
} else {
Context context;
try {
- context = mContext.createPackageContext(packageName, 0);
+ context = mContext.createPackageContextAsUser(packageName, 0,
+ new UserHandle(userId));
if (context == null) {
return null;
}