Introduce multiple displays with DisplayContent.
Fix a couple of bugs that turned up. Remove touch/focus from display. Add iterators for access. Respond to comments. Remove TODOs, and some deviceId parameters. Change-Id: Idcdb4f1979aa7b14634d450fd0333d6eff26994d
This commit is contained in:
@@ -38,6 +38,7 @@ import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.SystemProperties;
|
||||
import android.util.AndroidException;
|
||||
import android.view.Display;
|
||||
import android.view.IWindowManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -1117,9 +1118,10 @@ public class Am {
|
||||
|
||||
try {
|
||||
if (m >= 0 && n >= 0) {
|
||||
wm.setForcedDisplaySize(m, n);
|
||||
// TODO(multidisplay): For now Configuration only applies to main screen.
|
||||
wm.setForcedDisplaySize(Display.DEFAULT_DISPLAY, m, n);
|
||||
} else {
|
||||
wm.clearForcedDisplaySize();
|
||||
wm.clearForcedDisplaySize(Display.DEFAULT_DISPLAY);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ interface IWindowManager
|
||||
in IInputContext inputContext);
|
||||
boolean inputMethodClientHasFocus(IInputMethodClient client);
|
||||
|
||||
void setForcedDisplaySize(int longDimen, int shortDimen);
|
||||
void clearForcedDisplaySize();
|
||||
void setForcedDisplaySize(int displayId, int longDimen, int shortDimen);
|
||||
void clearForcedDisplaySize(int displayId);
|
||||
|
||||
// Is the device configured to have a full system bar for larger screens?
|
||||
boolean hasSystemNavBar();
|
||||
@@ -184,7 +184,7 @@ interface IWindowManager
|
||||
/**
|
||||
* Create a screenshot of the applications currently displayed.
|
||||
*/
|
||||
Bitmap screenshotApplications(IBinder appToken, int maxWidth, int maxHeight);
|
||||
Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight);
|
||||
|
||||
/**
|
||||
* Called by the status bar to notify Views of changes to System UI visiblity.
|
||||
|
||||
@@ -42,6 +42,7 @@ import android.util.DisplayMetrics;
|
||||
import android.util.EventLog;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.android.internal.os.BinderInternal;
|
||||
|
||||
@@ -59,6 +59,7 @@ import android.os.UserId;
|
||||
import android.util.EventLog;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManagerPolicy;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -902,7 +903,7 @@ final class ActivityStack {
|
||||
mService.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public final Bitmap screenshotActivities(ActivityRecord who) {
|
||||
if (who.noDisplay) {
|
||||
return null;
|
||||
@@ -919,7 +920,8 @@ final class ActivityStack {
|
||||
}
|
||||
|
||||
if (w > 0) {
|
||||
return mService.mWindowManager.screenshotApplications(who.appToken, w, h);
|
||||
return mService.mWindowManager.screenshotApplications(who.appToken,
|
||||
Display.DEFAULT_DISPLAY, w, h);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.android.server.wm.WindowManagerService;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.util.Slog;
|
||||
import android.view.Display;
|
||||
|
||||
/**
|
||||
* Activity manager code dealing with processes.
|
||||
@@ -146,7 +147,7 @@ class ProcessList {
|
||||
void applyDisplaySize(WindowManagerService wm) {
|
||||
if (!mHaveDisplaySize) {
|
||||
Point p = new Point();
|
||||
wm.getInitialDisplaySize(p);
|
||||
wm.getInitialDisplaySize(Display.DEFAULT_DISPLAY, p);
|
||||
if (p.x != 0 && p.y != 0) {
|
||||
updateOomLevels(p.x, p.y, true);
|
||||
mHaveDisplaySize = true;
|
||||
|
||||
@@ -87,12 +87,16 @@ public final class InputWindowHandle {
|
||||
// Window input features.
|
||||
public int inputFeatures;
|
||||
|
||||
// Display this input is on.
|
||||
public final int displayId;
|
||||
|
||||
private native void nativeDispose();
|
||||
|
||||
public InputWindowHandle(InputApplicationHandle inputApplicationHandle,
|
||||
Object windowState) {
|
||||
Object windowState, int displayId) {
|
||||
this.inputApplicationHandle = inputApplicationHandle;
|
||||
this.windowState = windowState;
|
||||
this.displayId = displayId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
103
services/java/com/android/server/wm/DisplayContent.java
Normal file
103
services/java/com/android/server/wm/DisplayContent.java
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.server.wm;
|
||||
|
||||
import android.view.DisplayInfo;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class DisplayContentList extends ArrayList<DisplayContent> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility class for keeping track of the WindowStates and other pertinent contents of a
|
||||
* particular Display.
|
||||
*
|
||||
* IMPORTANT: No method from this class should ever be used without holding
|
||||
* WindowManagerService.mWindowMap.
|
||||
*/
|
||||
class DisplayContent {
|
||||
|
||||
/** Unique identifier of this stack. */
|
||||
private final int mDisplayId;
|
||||
|
||||
/** Z-ordered (bottom-most first) list of all Window objects. Assigned to an element
|
||||
* from mDisplayWindows; */
|
||||
private WindowList mWindows = new WindowList();
|
||||
|
||||
|
||||
// This protects the following display size properties, so that
|
||||
// getDisplaySize() doesn't need to acquire the global lock. This is
|
||||
// needed because the window manager sometimes needs to use ActivityThread
|
||||
// while it has its global state locked (for example to load animation
|
||||
// resources), but the ActivityThread also needs get the current display
|
||||
// size sometimes when it has its package lock held.
|
||||
//
|
||||
// These will only be modified with both mWindowMap and mDisplaySizeLock
|
||||
// held (in that order) so the window manager doesn't need to acquire this
|
||||
// lock when needing these values in its normal operation.
|
||||
final Object mDisplaySizeLock = new Object();
|
||||
int mInitialDisplayWidth = 0;
|
||||
int mInitialDisplayHeight = 0;
|
||||
int mBaseDisplayWidth = 0;
|
||||
int mBaseDisplayHeight = 0;
|
||||
final DisplayInfo mDisplayInfo = new DisplayInfo();
|
||||
|
||||
DisplayContent(final int displayId) {
|
||||
mDisplayId = displayId;
|
||||
}
|
||||
|
||||
int getDisplayId() {
|
||||
return mDisplayId;
|
||||
}
|
||||
|
||||
WindowList getWindowList() {
|
||||
return mWindows;
|
||||
}
|
||||
|
||||
DisplayInfo getDisplayInfo() {
|
||||
return mDisplayInfo;
|
||||
}
|
||||
|
||||
public void dump(PrintWriter pw) {
|
||||
pw.print(" Display: mDisplayId="); pw.println(mDisplayId);
|
||||
pw.print(" init="); pw.print(mInitialDisplayWidth); pw.print("x");
|
||||
pw.print(mInitialDisplayHeight);
|
||||
if (mInitialDisplayWidth != mBaseDisplayWidth
|
||||
|| mInitialDisplayHeight != mBaseDisplayHeight) {
|
||||
pw.print(" base=");
|
||||
pw.print(mBaseDisplayWidth); pw.print("x"); pw.print(mBaseDisplayHeight);
|
||||
}
|
||||
if (mInitialDisplayWidth != mDisplayInfo.logicalWidth
|
||||
|| mInitialDisplayHeight != mDisplayInfo.logicalHeight) {
|
||||
pw.print(" init="); pw.print(mInitialDisplayWidth);
|
||||
pw.print("x"); pw.print(mInitialDisplayHeight);
|
||||
}
|
||||
pw.print(" cur=");
|
||||
pw.print(mDisplayInfo.logicalWidth);
|
||||
pw.print("x"); pw.print(mDisplayInfo.logicalHeight);
|
||||
pw.print(" app=");
|
||||
pw.print(mDisplayInfo.appWidth);
|
||||
pw.print("x"); pw.print(mDisplayInfo.appHeight);
|
||||
pw.print(" rng="); pw.print(mDisplayInfo.smallestNominalAppWidth);
|
||||
pw.print("x"); pw.print(mDisplayInfo.smallestNominalAppHeight);
|
||||
pw.print("-"); pw.print(mDisplayInfo.largestNominalAppWidth);
|
||||
pw.print("x"); pw.println(mDisplayInfo.largestNominalAppHeight);
|
||||
pw.println();
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import android.os.Message;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Slog;
|
||||
import android.view.DisplayInfo;
|
||||
import android.view.DragEvent;
|
||||
import android.view.InputChannel;
|
||||
import android.view.Surface;
|
||||
@@ -58,6 +59,7 @@ class DragState {
|
||||
WindowState mTargetWindow;
|
||||
ArrayList<WindowState> mNotifiedWindows;
|
||||
boolean mDragInProgress;
|
||||
DisplayContent mDisplayContent;
|
||||
|
||||
private final Region mTmpRegion = new Region();
|
||||
|
||||
@@ -69,6 +71,12 @@ class DragState {
|
||||
mFlags = flags;
|
||||
mLocalWin = localWin;
|
||||
mNotifiedWindows = new ArrayList<WindowState>();
|
||||
WindowState win = service.mWindowMap.get(token);
|
||||
if (win != null) {
|
||||
mDisplayContent = win.mDisplayContent;
|
||||
} else {
|
||||
Slog.e(WindowManagerService.TAG, "No window associated with token");
|
||||
}
|
||||
}
|
||||
|
||||
void reset() {
|
||||
@@ -101,7 +109,8 @@ class DragState {
|
||||
mDragApplicationHandle.dispatchingTimeoutNanos =
|
||||
WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
|
||||
|
||||
mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null);
|
||||
mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null,
|
||||
mDisplayContent.getDisplayId());
|
||||
mDragWindowHandle.name = "drag";
|
||||
mDragWindowHandle.inputChannel = mServerChannel;
|
||||
mDragWindowHandle.layer = getDragLayerLw();
|
||||
@@ -125,8 +134,9 @@ class DragState {
|
||||
// The drag window covers the entire display
|
||||
mDragWindowHandle.frameLeft = 0;
|
||||
mDragWindowHandle.frameTop = 0;
|
||||
mDragWindowHandle.frameRight = mService.mDisplayInfo.logicalWidth;
|
||||
mDragWindowHandle.frameBottom = mService.mDisplayInfo.logicalHeight;
|
||||
DisplayInfo displayInfo = mDisplayContent.getDisplayInfo();
|
||||
mDragWindowHandle.frameRight = displayInfo.logicalWidth;
|
||||
mDragWindowHandle.frameBottom = displayInfo.logicalHeight;
|
||||
|
||||
// Pause rotations before a drag.
|
||||
if (WindowManagerService.DEBUG_ORIENTATION) {
|
||||
@@ -179,9 +189,10 @@ class DragState {
|
||||
Slog.d(WindowManagerService.TAG, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")");
|
||||
}
|
||||
|
||||
final int N = mService.mWindows.size();
|
||||
final WindowList windows = mDisplayContent.getWindowList();
|
||||
final int N = windows.size();
|
||||
for (int i = 0; i < N; i++) {
|
||||
sendDragStartedLw(mService.mWindows.get(i), touchX, touchY, mDataDescription);
|
||||
sendDragStartedLw(windows.get(i), touchX, touchY, mDataDescription);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +391,8 @@ class DragState {
|
||||
WindowState touchedWin = null;
|
||||
final int x = (int) xf;
|
||||
final int y = (int) yf;
|
||||
final ArrayList<WindowState> windows = mService.mWindows;
|
||||
|
||||
final WindowList windows = mDisplayContent.getWindowList();
|
||||
final int N = windows.size();
|
||||
for (int i = N - 1; i >= 0; i--) {
|
||||
WindowState child = windows.get(i);
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.android.server.input.InputWindowHandle;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
import android.util.Slog;
|
||||
import android.view.Display;
|
||||
import android.view.InputChannel;
|
||||
import android.view.InputEventReceiver;
|
||||
import android.view.InputQueue;
|
||||
@@ -56,7 +57,7 @@ public final class FakeWindowImpl implements WindowManagerPolicy.FakeWindow {
|
||||
mApplicationHandle.dispatchingTimeoutNanos =
|
||||
WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
|
||||
|
||||
mWindowHandle = new InputWindowHandle(mApplicationHandle, null);
|
||||
mWindowHandle = new InputWindowHandle(mApplicationHandle, null, Display.DEFAULT_DISPLAY);
|
||||
mWindowHandle.name = name;
|
||||
mWindowHandle.inputChannel = mServerChannel;
|
||||
mWindowLayer = getLayerLw(windowType);
|
||||
|
||||
@@ -201,7 +201,6 @@ final class InputMonitor implements InputManagerService.Callbacks {
|
||||
// As an optimization, we could try to prune the list of windows but this turns
|
||||
// out to be difficult because only the native code knows for sure which window
|
||||
// currently has touch focus.
|
||||
final ArrayList<WindowState> windows = mService.mWindows;
|
||||
final WindowStateAnimator universeBackground = mService.mAnimator.mUniverseBackground;
|
||||
final int aboveUniverseLayer = mService.mAnimator.mAboveUniverseLayer;
|
||||
boolean addedUniverse = false;
|
||||
@@ -226,8 +225,9 @@ final class InputMonitor implements InputManagerService.Callbacks {
|
||||
addInputWindowHandleLw(mService.mFakeWindows.get(i).mWindowHandle);
|
||||
}
|
||||
|
||||
final int N = windows.size();
|
||||
for (int i = N - 1; i >= 0; i--) {
|
||||
// TODO(multidisplay): Input only occurs on the default display.
|
||||
final WindowList windows = mService.getDefaultWindowList();
|
||||
for (int i = windows.size() - 1; i >= 0; i--) {
|
||||
final WindowState child = windows.get(i);
|
||||
final InputChannel inputChannel = child.mInputChannel;
|
||||
final InputWindowHandle inputWindowHandle = child.mInputWindowHandle;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class WindowAnimator {
|
||||
final Context mContext;
|
||||
final WindowManagerPolicy mPolicy;
|
||||
|
||||
ArrayList<WindowStateAnimator> mWinAnimators = new ArrayList<WindowStateAnimator>();
|
||||
ArrayList<WinAnimatorList> mWinAnimatorLists = new ArrayList<WinAnimatorList>();
|
||||
|
||||
boolean mAnimating;
|
||||
|
||||
@@ -158,7 +158,8 @@ public class WindowAnimator {
|
||||
mWallpaperTokens = new ArrayList<WindowToken>(layoutToAnim.mWallpaperTokens);
|
||||
}
|
||||
|
||||
mWinAnimators = new ArrayList<WindowStateAnimator>(layoutToAnim.mWinAnimators);
|
||||
mWinAnimatorLists =
|
||||
new ArrayList<WinAnimatorList>(layoutToAnim.mWinAnimatorLists);
|
||||
mWallpaperTarget = layoutToAnim.mWallpaperTarget;
|
||||
mWpAppAnimator = mWallpaperTarget == null
|
||||
? null : mWallpaperTarget.mAppToken == null
|
||||
@@ -267,7 +268,7 @@ public class WindowAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWindowsLocked() {
|
||||
private void updateWindowsLocked(final WinAnimatorList winAnimatorList) {
|
||||
++mAnimTransactionSequence;
|
||||
|
||||
ArrayList<WindowStateAnimator> unForceHiding = null;
|
||||
@@ -280,8 +281,8 @@ public class WindowAnimator {
|
||||
final int KEYGUARD_ANIMATING_OUT = 3;
|
||||
int forceHiding = KEYGUARD_NOT_SHOWN;
|
||||
|
||||
for (int i = mWinAnimators.size() - 1; i >= 0; i--) {
|
||||
WindowStateAnimator winAnimator = mWinAnimators.get(i);
|
||||
for (int i = winAnimatorList.size() - 1; i >= 0; i--) {
|
||||
WindowStateAnimator winAnimator = winAnimatorList.get(i);
|
||||
WindowState win = winAnimator.mWin;
|
||||
final int flags = winAnimator.mAttrFlags;
|
||||
|
||||
@@ -418,13 +419,13 @@ public class WindowAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWallpaperLocked() {
|
||||
private void updateWallpaperLocked(final WinAnimatorList winAnimatorList) {
|
||||
WindowStateAnimator windowAnimationBackground = null;
|
||||
int windowAnimationBackgroundColor = 0;
|
||||
WindowState detachedWallpaper = null;
|
||||
|
||||
for (int i = mWinAnimators.size() - 1; i >= 0; i--) {
|
||||
WindowStateAnimator winAnimator = mWinAnimators.get(i);
|
||||
for (int i = winAnimatorList.size() - 1; i >= 0; i--) {
|
||||
WindowStateAnimator winAnimator = winAnimatorList.get(i);
|
||||
if (winAnimator.mSurface == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -489,11 +490,11 @@ public class WindowAnimator {
|
||||
// don't cause the wallpaper to suddenly disappear.
|
||||
int animLayer = windowAnimationBackground.mAnimLayer;
|
||||
WindowState win = windowAnimationBackground.mWin;
|
||||
if (windowAnimationBackground != null && mWallpaperTarget == win
|
||||
if (mWallpaperTarget == win
|
||||
|| mLowerWallpaperTarget == win || mUpperWallpaperTarget == win) {
|
||||
final int N = mWinAnimators.size();
|
||||
final int N = winAnimatorList.size();
|
||||
for (int i = 0; i < N; i++) {
|
||||
WindowStateAnimator winAnimator = mWinAnimators.get(i);
|
||||
WindowStateAnimator winAnimator = winAnimatorList.get(i);
|
||||
if (winAnimator.mIsWallpaper) {
|
||||
animLayer = winAnimator.mAnimLayer;
|
||||
break;
|
||||
@@ -548,9 +549,9 @@ public class WindowAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
private void performAnimationsLocked() {
|
||||
updateWindowsLocked();
|
||||
updateWallpaperLocked();
|
||||
private void performAnimationsLocked(final WinAnimatorList winAnimatorList) {
|
||||
updateWindowsLocked(winAnimatorList);
|
||||
updateWallpaperLocked(winAnimatorList);
|
||||
|
||||
if ((mPendingLayoutChanges & WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0) {
|
||||
mPendingActions |= WALLPAPER_ACTION_PENDING;
|
||||
@@ -562,6 +563,12 @@ public class WindowAnimator {
|
||||
// TODO(cmautner): Change the following comment when no longer locked on mWindowMap */
|
||||
/** Locked on mService.mWindowMap and this. */
|
||||
private void animateLocked() {
|
||||
for (int i = mWinAnimatorLists.size() - 1; i >= 0; i--) {
|
||||
animateLocked(mWinAnimatorLists.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
private void animateLocked(final WinAnimatorList winAnimatorList) {
|
||||
mPendingLayoutChanges = 0;
|
||||
mCurrentTime = SystemClock.uptimeMillis();
|
||||
mBulkUpdateParams = SET_ORIENTATION_CHANGE_COMPLETE;
|
||||
@@ -577,7 +584,7 @@ public class WindowAnimator {
|
||||
|
||||
try {
|
||||
updateWindowsAppsAndRotationAnimationsLocked();
|
||||
performAnimationsLocked();
|
||||
performAnimationsLocked(winAnimatorList);
|
||||
|
||||
// THIRD LOOP: Update the surfaces of all windows.
|
||||
|
||||
@@ -585,9 +592,9 @@ public class WindowAnimator {
|
||||
mScreenRotationAnimation.updateSurfaces();
|
||||
}
|
||||
|
||||
final int N = mWinAnimators.size();
|
||||
final int N = winAnimatorList.size();
|
||||
for (int i = 0; i < N; i++) {
|
||||
mWinAnimators.get(i).prepareSurfaceLocked(true);
|
||||
winAnimatorList.get(i).prepareSurfaceLocked(true);
|
||||
}
|
||||
|
||||
if (mDimParams != null) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,7 @@ import android.graphics.Region;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Slog;
|
||||
import android.view.DisplayInfo;
|
||||
import android.view.Gravity;
|
||||
import android.view.IApplicationToken;
|
||||
import android.view.IWindow;
|
||||
@@ -47,6 +48,9 @@ import android.view.WindowManagerPolicy;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class WindowList extends ArrayList<WindowState> {
|
||||
}
|
||||
|
||||
/**
|
||||
* A window in the window manager.
|
||||
*/
|
||||
@@ -251,18 +255,18 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
|
||||
boolean mHasSurface = false;
|
||||
|
||||
int mDisplayId;
|
||||
DisplayContent mDisplayContent;
|
||||
|
||||
WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token,
|
||||
WindowState attachedWindow, int seq, WindowManager.LayoutParams a,
|
||||
int viewVisibility, int displayId) {
|
||||
int viewVisibility, final DisplayContent displayContent) {
|
||||
mService = service;
|
||||
mSession = s;
|
||||
mClient = c;
|
||||
mToken = token;
|
||||
mAttrs.copyFrom(a);
|
||||
mViewVisibility = viewVisibility;
|
||||
mDisplayId = displayId;
|
||||
mDisplayContent = displayContent;
|
||||
mPolicy = mService.mPolicy;
|
||||
mContext = mService.mContext;
|
||||
DeathRecipient deathRecipient = new DeathRecipient();
|
||||
@@ -346,7 +350,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
mYOffset = 0;
|
||||
mLayer = 0;
|
||||
mInputWindowHandle = new InputWindowHandle(
|
||||
mAppToken != null ? mAppToken.mInputApplicationHandle : null, this);
|
||||
mAppToken != null ? mAppToken.mInputApplicationHandle : null, this,
|
||||
displayContent.getDisplayId());
|
||||
}
|
||||
|
||||
void attach() {
|
||||
@@ -482,8 +487,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
}
|
||||
|
||||
if (mIsWallpaper && (fw != frame.width() || fh != frame.height())) {
|
||||
mService.updateWallpaperOffsetLocked(this,
|
||||
mService.mDisplayInfo.appWidth, mService.mDisplayInfo.appHeight, false);
|
||||
final DisplayInfo displayInfo = mDisplayContent.getDisplayInfo();
|
||||
mService.updateWallpaperOffsetLocked(this, displayInfo.appWidth, displayInfo.appHeight,
|
||||
false);
|
||||
}
|
||||
|
||||
if (WindowManagerService.localLOGV) {
|
||||
@@ -547,6 +553,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
public boolean getNeedsMenuLw(WindowManagerPolicy.WindowState bottom) {
|
||||
int index = -1;
|
||||
WindowState ws = this;
|
||||
WindowList windows = getWindowList();
|
||||
while (true) {
|
||||
if ((ws.mAttrs.privateFlags
|
||||
& WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEEDS_MENU_KEY) != 0) {
|
||||
@@ -561,13 +568,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
// look behind it.
|
||||
// First, we may need to determine the starting position.
|
||||
if (index < 0) {
|
||||
index = mService.mWindows.indexOf(ws);
|
||||
index = windows.indexOf(ws);
|
||||
}
|
||||
index--;
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
ws = mService.mWindows.get(index);
|
||||
ws = windows.get(index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -991,8 +998,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
}
|
||||
}
|
||||
|
||||
WindowList getWindowList() {
|
||||
return mDisplayContent.getWindowList();
|
||||
}
|
||||
|
||||
void dump(PrintWriter pw, String prefix, boolean dumpAll) {
|
||||
pw.print(prefix); pw.print("mSession="); pw.print(mSession);
|
||||
pw.print(prefix); pw.print("mDisplayId="); pw.print(mDisplayContent.getDisplayId());
|
||||
pw.print(" mSession="); pw.print(mSession);
|
||||
pw.print(" mClient="); pw.println(mClient.asBinder());
|
||||
pw.print(prefix); pw.print("mAttrs="); pw.println(mAttrs);
|
||||
pw.print(prefix); pw.print("Requested w="); pw.print(mRequestedWidth);
|
||||
|
||||
@@ -16,6 +16,7 @@ import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.os.Debug;
|
||||
import android.util.Slog;
|
||||
import android.view.DisplayInfo;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceSession;
|
||||
import android.view.WindowManager;
|
||||
@@ -30,6 +31,9 @@ import com.android.server.wm.WindowManagerService.H;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class WinAnimatorList extends ArrayList<WindowStateAnimator> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep track of animations and surface operations for a single WindowState.
|
||||
**/
|
||||
@@ -151,8 +155,9 @@ class WindowStateAnimator {
|
||||
mAnimator = service.mAnimator;
|
||||
mPolicy = service.mPolicy;
|
||||
mContext = service.mContext;
|
||||
mAnimDw = service.mDisplayInfo.appWidth;
|
||||
mAnimDh = service.mDisplayInfo.appHeight;
|
||||
final DisplayInfo displayInfo = win.mDisplayContent.getDisplayInfo();
|
||||
mAnimDw = displayInfo.appWidth;
|
||||
mAnimDh = displayInfo.appHeight;
|
||||
|
||||
mWin = win;
|
||||
mAttachedWinAnimator = win.mAttachedWindow == null
|
||||
@@ -248,8 +253,9 @@ class WindowStateAnimator {
|
||||
" scale=" + mService.mWindowAnimationScale);
|
||||
mAnimation.initialize(mWin.mFrame.width(), mWin.mFrame.height(),
|
||||
mAnimDw, mAnimDh);
|
||||
mAnimDw = mService.mDisplayInfo.appWidth;
|
||||
mAnimDh = mService.mDisplayInfo.appHeight;
|
||||
final DisplayInfo displayInfo = mWin.mDisplayContent.getDisplayInfo();
|
||||
mAnimDw = displayInfo.appWidth;
|
||||
mAnimDh = displayInfo.appHeight;
|
||||
mAnimation.setStartTime(currentTime);
|
||||
mLocalAnimating = true;
|
||||
mAnimating = true;
|
||||
@@ -646,12 +652,12 @@ class WindowStateAnimator {
|
||||
mSurface = new SurfaceTrace(
|
||||
mSession.mSurfaceSession, mSession.mPid,
|
||||
attrs.getTitle().toString(),
|
||||
mWin.mDisplayId, w, h, format, flags);
|
||||
mWin.mDisplayContent.getDisplayId(), w, h, format, flags);
|
||||
} else {
|
||||
mSurface = new Surface(
|
||||
mSession.mSurfaceSession, mSession.mPid,
|
||||
attrs.getTitle().toString(),
|
||||
mWin.mDisplayId, w, h, format, flags);
|
||||
mWin.mDisplayContent.getDisplayId(), w, h, format, flags);
|
||||
}
|
||||
mWin.mHasSurface = true;
|
||||
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG,
|
||||
@@ -1101,8 +1107,9 @@ class WindowStateAnimator {
|
||||
mAnimator.mPendingLayoutChanges |=
|
||||
WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
if ((w.mAttrs.flags & LayoutParams.FLAG_DIM_BEHIND) != 0) {
|
||||
final DisplayInfo displayInfo = mWin.mDisplayContent.getDisplayInfo();
|
||||
mService.startDimming(this, w.mExiting ? 0 : w.mAttrs.dimAmount,
|
||||
mService.mDisplayInfo.appWidth, mService.mDisplayInfo.appHeight);
|
||||
displayInfo.appWidth, displayInfo.appHeight);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
// If something goes wrong with the surface (such
|
||||
|
||||
@@ -92,7 +92,7 @@ public class BridgeWindowManager implements IWindowManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearForcedDisplaySize() throws RemoteException {
|
||||
public void clearForcedDisplaySize(int displayId) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@@ -262,7 +262,8 @@ public class BridgeWindowManager implements IWindowManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bitmap screenshotApplications(IBinder arg0, int arg1, int arg2) throws RemoteException {
|
||||
public Bitmap screenshotApplications(IBinder arg0, int displayId, int arg1, int arg2)
|
||||
throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
@@ -324,7 +325,7 @@ public class BridgeWindowManager implements IWindowManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForcedDisplaySize(int arg0, int arg1) throws RemoteException {
|
||||
public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user