Merge "Cache OverContext to prevent deadlock" into tm-dev
This commit is contained in:
@@ -76,6 +76,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
|
||||
|
||||
private final boolean mIsBootDisplayModeSupported;
|
||||
|
||||
private Context mOverlayContext;
|
||||
|
||||
// Called with SyncRoot lock held.
|
||||
public LocalDisplayAdapter(DisplayManagerService.SyncRoot syncRoot,
|
||||
Context context, Handler handler, Listener listener) {
|
||||
@@ -1222,7 +1224,10 @@ final class LocalDisplayAdapter extends DisplayAdapter {
|
||||
|
||||
/** Supplies a context whose Resources apply runtime-overlays */
|
||||
Context getOverlayContext() {
|
||||
return ActivityThread.currentActivityThread().getSystemUiContext();
|
||||
if (mOverlayContext == null) {
|
||||
mOverlayContext = ActivityThread.currentActivityThread().getSystemUiContext();
|
||||
}
|
||||
return mOverlayContext;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user