Merge "Make sure system UI context has the same LoadedApk as system context" into oc-dev
am: fa7b34395c
Change-Id: I971b67d5e73b3a45e629212e6a9161c74cff5c72
This commit is contained in:
@@ -2199,7 +2199,7 @@ public final class ActivityThread {
|
|||||||
public ContextImpl getSystemUiContext() {
|
public ContextImpl getSystemUiContext() {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (mSystemUiContext == null) {
|
if (mSystemUiContext == null) {
|
||||||
mSystemUiContext = ContextImpl.createSystemUiContext(this);
|
mSystemUiContext = ContextImpl.createSystemUiContext(getSystemContext());
|
||||||
}
|
}
|
||||||
return mSystemUiContext;
|
return mSystemUiContext;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2220,11 +2220,12 @@ class ContextImpl extends Context {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* System Context to be used for UI. This Context has resources that can be themed.
|
* System Context to be used for UI. This Context has resources that can be themed.
|
||||||
|
* Make sure that the created system UI context shares the same LoadedApk as the system context.
|
||||||
*/
|
*/
|
||||||
static ContextImpl createSystemUiContext(ActivityThread mainThread) {
|
static ContextImpl createSystemUiContext(ContextImpl systemContext) {
|
||||||
LoadedApk packageInfo = new LoadedApk(mainThread);
|
final LoadedApk packageInfo = systemContext.mPackageInfo;
|
||||||
ContextImpl context = new ContextImpl(null, mainThread, packageInfo, null, null, null, 0,
|
ContextImpl context = new ContextImpl(null, systemContext.mMainThread, packageInfo, null,
|
||||||
null);
|
null, null, 0, null);
|
||||||
context.setResources(createResources(null, packageInfo, null, Display.DEFAULT_DISPLAY, null,
|
context.setResources(createResources(null, packageInfo, null, Display.DEFAULT_DISPLAY, null,
|
||||||
packageInfo.getCompatibilityInfo()));
|
packageInfo.getCompatibilityInfo()));
|
||||||
return context;
|
return context;
|
||||||
|
|||||||
Reference in New Issue
Block a user