From 98365d7663cbd82979a5700faf0050220b01084d Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Sun, 19 Aug 2012 20:30:52 -0700 Subject: Refactor for multi-display support. Split WindowManagerImpl into two parts, the WindowManager interface implementation remains where it is but the global communications with the window manager are now handled by the WindowManagerGlobal class. This change greatly simplifies the challenge of having separate WindowManager instances for each Context. Removed WindowManagerImpl.getDefault(). This represents the bulk of this change. Most of the usages of this method were either to perform global functions (now handled by WindowManagerGlobal) or to obtain the default display (now handled by DisplayManager). Explicitly associate each new window with a display and make the Display object available to the View hierarchy. Add stubs for some new display manager API features. Start to split apart the concepts of display id and layer stack. since they operate at different layers of abstraction. While it's true that each logical display uniquely corresponds to a surface flinger layer stack, it is not necessarily the case that they must use the same ids. Added Display.getLayerStack() and started using it in places where it was relatively easy to do. Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61 --- tools/layoutlib/bridge/src/android/view/AttachInfo_Accessor.java | 7 ++++++- .../src/com/android/layoutlib/bridge/android/BridgeContext.java | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'tools/layoutlib/bridge') diff --git a/tools/layoutlib/bridge/src/android/view/AttachInfo_Accessor.java b/tools/layoutlib/bridge/src/android/view/AttachInfo_Accessor.java index 97d9969..4901f72 100644 --- a/tools/layoutlib/bridge/src/android/view/AttachInfo_Accessor.java +++ b/tools/layoutlib/bridge/src/android/view/AttachInfo_Accessor.java @@ -19,6 +19,7 @@ package android.view; import com.android.layoutlib.bridge.android.BridgeWindow; import com.android.layoutlib.bridge.android.BridgeWindowSession; +import android.content.Context; import android.os.Handler; import android.view.View.AttachInfo; @@ -28,8 +29,12 @@ import android.view.View.AttachInfo; public class AttachInfo_Accessor { public static void setAttachInfo(View view) { + Context context = view.getContext(); + WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); + Display display = wm.getDefaultDisplay(); + ViewRootImpl root = new ViewRootImpl(context, display); AttachInfo info = new AttachInfo(new BridgeWindowSession(), new BridgeWindow(), - new ViewRootImpl(view.getContext()), new Handler(), null); + display, root, new Handler(), null); info.mHasWindowFocus = true; info.mWindowVisibility = View.VISIBLE; info.mInTouchMode = false; // this is so that we can display selections. diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java index 943357a..3d45bff 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java @@ -66,6 +66,7 @@ import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.TypedValue; import android.view.BridgeInflater; +import android.view.CompatibilityInfoHolder; import android.view.Surface; import android.view.View; import android.view.ViewGroup; @@ -1318,4 +1319,10 @@ public final class BridgeContext extends Context { Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED, "OBB not supported", null); return null; } + + @Override + public CompatibilityInfoHolder getCompatibilityInfo() { + // pass + return null; + } } -- cgit v1.1