diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-08-23 19:48:44 -0700 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2012-08-31 15:42:45 -0700 |
| commit | a492c3a7b2c18426fd0cb4d017eacbc368195dc5 (patch) | |
| tree | 67744a8d91519d997cb761a697600041d74165fa /core/java/android/view/WindowManagerImpl.java | |
| parent | 00453e7a0182b50cf01e65c97650b526284fe084 (diff) | |
Initial draft of high-level multi-display APIs.
This patch introduces the ability to create a Context that
is bound to a Display. The context gets its configuration and
metrics from that display and is able to provide a WindowManager
that is bound to the display.
To make it easier to use, we also add a new kind of Dialog
called a Presentation. Presentation takes care of setting
up the context as needed and watches for significant changes
in the display configuration. If the display is removed,
then the presentation simply dismisses itself.
Change-Id: Idc54b4ec84b1ff91505cfb78910cf8cd09696d7d
Diffstat (limited to 'core/java/android/view/WindowManagerImpl.java')
| -rw-r--r-- | core/java/android/view/WindowManagerImpl.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java index aa9179f6309b..52d79f84f9a1 100644 --- a/core/java/android/view/WindowManagerImpl.java +++ b/core/java/android/view/WindowManagerImpl.java @@ -16,9 +16,6 @@ package android.view; -import android.content.Context; -import android.hardware.display.DisplayManager; - /** * Provides low-level communication with the system window manager for * operations that are bound to a particular context, display or parent window. @@ -47,25 +44,24 @@ import android.hardware.display.DisplayManager; */ public final class WindowManagerImpl implements WindowManager { private final WindowManagerGlobal mGlobal = WindowManagerGlobal.getInstance(); - private final Context mContext; private final Display mDisplay; private final Window mParentWindow; - public WindowManagerImpl(Context context, int displayId) { - DisplayManager dm = (DisplayManager)context.getSystemService(Context.DISPLAY_SERVICE); - mContext = context; - mDisplay = dm.getDisplay(displayId); - mParentWindow = null; + public WindowManagerImpl(Display display) { + this(display, null); } - private WindowManagerImpl(Context context, Display display, Window parentWindow) { - mContext = context; + private WindowManagerImpl(Display display, Window parentWindow) { mDisplay = display; mParentWindow = parentWindow; } public WindowManagerImpl createLocalWindowManager(Window parentWindow) { - return new WindowManagerImpl(mContext, mDisplay, parentWindow); + return new WindowManagerImpl(mDisplay, parentWindow); + } + + public WindowManagerImpl createPresentationWindowManager(Display display) { + return new WindowManagerImpl(display, mParentWindow); } @Override |
