diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-12-10 18:56:40 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-12-10 18:56:40 +0000 |
| commit | a5a81d2458bd76eca493232df279603dbdc1e8bb (patch) | |
| tree | da222c438c27a2f2a90e61bba6708497a87a1f35 /core/java/android/app/ContextImpl.java | |
| parent | 13f94032c77d4ded10dd90ca766945f0400a654d (diff) | |
| parent | 0b05f9e49dc6e2a418479f432e8728346ebaaf54 (diff) | |
Merge "Add IMMS#showInputMethodPickerFromSystem."
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index c7a9d99fe927..92cdb20c7f4f 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -2407,16 +2407,28 @@ class ContextImpl extends Context { /** * 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. + * @param systemContext The system context which created by + * {@link #createSystemContext(ActivityThread)}. + * @param displayId The ID of the display where the UI is shown. */ - static ContextImpl createSystemUiContext(ContextImpl systemContext) { + static ContextImpl createSystemUiContext(ContextImpl systemContext, int displayId) { final LoadedApk packageInfo = systemContext.mPackageInfo; ContextImpl context = new ContextImpl(null, systemContext.mMainThread, packageInfo, null, null, null, 0, null); - context.setResources(createResources(null, packageInfo, null, Display.DEFAULT_DISPLAY, null, + context.setResources(createResources(null, packageInfo, null, displayId, null, packageInfo.getCompatibilityInfo())); + context.updateDisplay(displayId); return context; } + /** + * The overloaded method of {@link #createSystemUiContext(ContextImpl, int)}. + * Uses {@Code Display.DEFAULT_DISPLAY} as the target display. + */ + static ContextImpl createSystemUiContext(ContextImpl systemContext) { + return createSystemUiContext(systemContext, Display.DEFAULT_DISPLAY); + } + @UnsupportedAppUsage static ContextImpl createAppContext(ActivityThread mainThread, LoadedApk packageInfo) { if (packageInfo == null) throw new IllegalArgumentException("packageInfo"); |
