summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server')
-rw-r--r--services/java/com/android/server/MountService.java8
-rw-r--r--services/java/com/android/server/accessibility/ScreenMagnifier.java1
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java2
-rw-r--r--services/java/com/android/server/am/ActivityStack.java7
-rw-r--r--services/java/com/android/server/am/AppErrorDialog.java6
-rw-r--r--services/java/com/android/server/am/AppNotRespondingDialog.java6
-rw-r--r--services/java/com/android/server/am/StrictModeViolationDialog.java2
-rw-r--r--services/java/com/android/server/input/InputWindowHandle.java1
-rw-r--r--services/java/com/android/server/power/PowerManagerService.java6
-rw-r--r--services/java/com/android/server/wm/DimLayer.java43
-rw-r--r--services/java/com/android/server/wm/DragState.java1
-rw-r--r--services/java/com/android/server/wm/FakeWindowImpl.java5
-rw-r--r--services/java/com/android/server/wm/InputMonitor.java9
-rw-r--r--services/java/com/android/server/wm/TaskStack.java4
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java31
-rw-r--r--services/java/com/android/server/wm/WindowState.java8
-rw-r--r--services/java/com/android/server/wm/WindowStateAnimator.java8
17 files changed, 91 insertions, 57 deletions
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index 6ab86f5..59ec777 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -2145,6 +2145,10 @@ class MountService extends IMountService.Stub
return -1;
}
+ if (!appPath.endsWith("/")) {
+ appPath = appPath + "/";
+ }
+
// Try translating the app path into a vold path, but require that it
// belong to the calling package.
String voldPath = maybeTranslatePathForVold(appPath,
@@ -2194,9 +2198,9 @@ class MountService extends IMountService.Stub
}
for (int i = 0; i < appPaths.length; i++) {
- final String appPath = appPaths[i].getAbsolutePath();
+ final String appPath = appPaths[i].getAbsolutePath() + "/";
if (path.startsWith(appPath)) {
- path = new File(voldPaths[i], path.substring(appPath.length() + 1))
+ path = new File(voldPaths[i], path.substring(appPath.length()))
.getAbsolutePath();
if (!path.endsWith("/")) {
path = path + "/";
diff --git a/services/java/com/android/server/accessibility/ScreenMagnifier.java b/services/java/com/android/server/accessibility/ScreenMagnifier.java
index 1bf2c42..5f12cf4 100644
--- a/services/java/com/android/server/accessibility/ScreenMagnifier.java
+++ b/services/java/com/android/server/accessibility/ScreenMagnifier.java
@@ -502,6 +502,7 @@ public final class ScreenMagnifier extends IMagnificationCallbacks.Stub
public MagnifiedContentInteractonStateHandler(Context context) {
mScaleGestureDetector = new ScaleGestureDetector(context, this);
+ mScaleGestureDetector.setQuickScaleEnabled(false);
mGestureDetector = new GestureDetector(context, this);
}
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index f2ff9ca..f23bcba 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -254,7 +254,7 @@ public final class ActivityManagerService extends ActivityManagerNative
static final boolean IS_USER_BUILD = "user".equals(Build.TYPE);
// Maximum number of recent tasks that we can remember.
- static final int MAX_RECENT_TASKS = 20;
+ static final int MAX_RECENT_TASKS = ActivityManager.isLowRamDeviceStatic() ? 10 : 20;
// Amount of time after a call to stopAppSwitches() during which we will
// prevent further untrusted switches from happening.
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 28c87d1..45b30f1 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -121,6 +121,9 @@ final class ActivityStack {
// convertToTranslucent().
static final long TRANSLUCENT_CONVERSION_TIMEOUT = 2000;
+ static final boolean SCREENSHOT_FORCE_565 = ActivityManager
+ .isLowRamDeviceStatic() ? true : false;
+
enum ActivityState {
INITIALIZING,
RESUMED,
@@ -691,10 +694,10 @@ final class ActivityStack {
|| mLastScreenshotBitmap.getHeight() != h) {
mLastScreenshotActivity = who;
mLastScreenshotBitmap = mWindowManager.screenshotApplications(
- who.appToken, Display.DEFAULT_DISPLAY, w, h);
+ who.appToken, Display.DEFAULT_DISPLAY, w, h, SCREENSHOT_FORCE_565);
}
if (mLastScreenshotBitmap != null) {
- return mLastScreenshotBitmap.copy(Config.ARGB_8888, true);
+ return mLastScreenshotBitmap.copy(mLastScreenshotBitmap.getConfig(), true);
}
}
return null;
diff --git a/services/java/com/android/server/am/AppErrorDialog.java b/services/java/com/android/server/am/AppErrorDialog.java
index fffa75e..0ba62c5 100644
--- a/services/java/com/android/server/am/AppErrorDialog.java
+++ b/services/java/com/android/server/am/AppErrorDialog.java
@@ -16,8 +16,6 @@
package com.android.server.am;
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR;
-
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
@@ -72,10 +70,10 @@ final class AppErrorDialog extends BaseErrorDialog {
}
setTitle(res.getText(com.android.internal.R.string.aerr_title));
- getWindow().addFlags(PRIVATE_FLAG_SYSTEM_ERROR);
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.setTitle("Application Error: " + app.info.processName);
- attrs.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
+ attrs.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR
+ | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
getWindow().setAttributes(attrs);
if (app.persistent) {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
diff --git a/services/java/com/android/server/am/AppNotRespondingDialog.java b/services/java/com/android/server/am/AppNotRespondingDialog.java
index 4de272d..f4c1664 100644
--- a/services/java/com/android/server/am/AppNotRespondingDialog.java
+++ b/services/java/com/android/server/am/AppNotRespondingDialog.java
@@ -16,8 +16,6 @@
package com.android.server.am;
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR;
-
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
@@ -94,10 +92,10 @@ final class AppNotRespondingDialog extends BaseErrorDialog {
if (aboveSystem) {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
}
- getWindow().addFlags(PRIVATE_FLAG_SYSTEM_ERROR);
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.setTitle("Application Not Responding: " + app.info.processName);
- attrs.privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
+ attrs.privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR |
+ WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
getWindow().setAttributes(attrs);
}
diff --git a/services/java/com/android/server/am/StrictModeViolationDialog.java b/services/java/com/android/server/am/StrictModeViolationDialog.java
index 5fee0d3..fda1ec1 100644
--- a/services/java/com/android/server/am/StrictModeViolationDialog.java
+++ b/services/java/com/android/server/am/StrictModeViolationDialog.java
@@ -74,7 +74,7 @@ final class StrictModeViolationDialog extends BaseErrorDialog {
}
setTitle(res.getText(com.android.internal.R.string.aerr_title));
- getWindow().addFlags(PRIVATE_FLAG_SYSTEM_ERROR);
+ getWindow().addPrivateFlags(PRIVATE_FLAG_SYSTEM_ERROR);
getWindow().setTitle("Strict Mode Violation: " + app.info.processName);
// After the timeout, pretend the user clicked the quit button
diff --git a/services/java/com/android/server/input/InputWindowHandle.java b/services/java/com/android/server/input/InputWindowHandle.java
index ad4fdd1..9eb9a33 100644
--- a/services/java/com/android/server/input/InputWindowHandle.java
+++ b/services/java/com/android/server/input/InputWindowHandle.java
@@ -44,6 +44,7 @@ public final class InputWindowHandle {
// Window layout params attributes. (WindowManager.LayoutParams)
public int layoutParamsFlags;
+ public int layoutParamsPrivateFlags;
public int layoutParamsType;
// Dispatching timeout.
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java
index 2ccd21c..8fbde14 100644
--- a/services/java/com/android/server/power/PowerManagerService.java
+++ b/services/java/com/android/server/power/PowerManagerService.java
@@ -580,6 +580,12 @@ public final class PowerManagerService extends IPowerManager.Stub
}
@Override // Binder call
+ public void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName,
+ int uid) {
+ acquireWakeLock(lock, flags, tag, packageName, new WorkSource(uid));
+ }
+
+ @Override // Binder call
public void acquireWakeLock(IBinder lock, int flags, String tag, String packageName,
WorkSource ws) {
if (lock == null) {
diff --git a/services/java/com/android/server/wm/DimLayer.java b/services/java/com/android/server/wm/DimLayer.java
index 39e664f..c189ddd 100644
--- a/services/java/com/android/server/wm/DimLayer.java
+++ b/services/java/com/android/server/wm/DimLayer.java
@@ -48,9 +48,13 @@ public class DimLayer {
/** Time in milliseconds to take to transition from mStartAlpha to mTargetAlpha */
long mDuration;
- DimLayer(WindowManagerService service, DisplayContent displayContent) {
- mDisplayContent = displayContent;
- final int displayId = displayContent.getDisplayId();
+ /** Owning stack */
+ final TaskStack mStack;
+
+ DimLayer(WindowManagerService service, TaskStack stack) {
+ mStack = stack;
+ mDisplayContent = stack.getDisplayContent();
+ final int displayId = mDisplayContent.getDisplayId();
if (DEBUG) Slog.v(TAG, "Ctor: displayId=" + displayId);
SurfaceControl.openTransaction();
try {
@@ -160,22 +164,29 @@ public class DimLayer {
return;
}
- /*
- // Set surface size to screen size.
- final DisplayInfo info = mDisplayContent.getDisplayInfo();
- // Multiply by 1.5 so that rotating a frozen surface that includes this does not expose a
- // corner.
- final int dw = (int) (info.logicalWidth * 1.5);
- final int dh = (int) (info.logicalHeight * 1.5);
- // back off position so 1/4 of Surface is before and 1/4 is after.
- final float xPos = -1 * dw / 6;
- final float yPos = -1 * dh / 6;
- */
+ final int dw, dh;
+ final float xPos, yPos;
+ if (mStack.hasSibling()) {
+ dw = mBounds.width();
+ dh = mBounds.height();
+ xPos = mBounds.left;
+ yPos = mBounds.right;
+ } else {
+ // Set surface size to screen size.
+ final DisplayInfo info = mDisplayContent.getDisplayInfo();
+ // Multiply by 1.5 so that rotating a frozen surface that includes this does not expose a
+ // corner.
+ dw = (int) (info.logicalWidth * 1.5);
+ dh = (int) (info.logicalHeight * 1.5);
+ // back off position so 1/4 of Surface is before and 1/4 is after.
+ xPos = -1 * dw / 6;
+ yPos = -1 * dh / 6;
+ }
if (!mLastBounds.equals(mBounds) || mLayer != layer) {
try {
- mDimSurface.setPosition(mBounds.left, mBounds.top);
- mDimSurface.setSize(mBounds.width(), mBounds.height());
+ mDimSurface.setPosition(xPos, yPos);
+ mDimSurface.setSize(dw, dh);
mDimSurface.setLayer(layer);
} catch (RuntimeException e) {
Slog.w(TAG, "Failure setting size or layer", e);
diff --git a/services/java/com/android/server/wm/DragState.java b/services/java/com/android/server/wm/DragState.java
index 745b886..a737939 100644
--- a/services/java/com/android/server/wm/DragState.java
+++ b/services/java/com/android/server/wm/DragState.java
@@ -115,6 +115,7 @@ class DragState {
mDragWindowHandle.inputChannel = mServerChannel;
mDragWindowHandle.layer = getDragLayerLw();
mDragWindowHandle.layoutParamsFlags = 0;
+ mDragWindowHandle.layoutParamsPrivateFlags = 0;
mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG;
mDragWindowHandle.dispatchingTimeoutNanos =
WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
diff --git a/services/java/com/android/server/wm/FakeWindowImpl.java b/services/java/com/android/server/wm/FakeWindowImpl.java
index 5ec72cc..5a3471b 100644
--- a/services/java/com/android/server/wm/FakeWindowImpl.java
+++ b/services/java/com/android/server/wm/FakeWindowImpl.java
@@ -40,8 +40,8 @@ public final class FakeWindowImpl implements WindowManagerPolicy.FakeWindow {
public FakeWindowImpl(WindowManagerService service,
Looper looper, InputEventReceiver.Factory inputEventReceiverFactory,
- String name, int windowType, int layoutParamsFlags, boolean canReceiveKeys,
- boolean hasFocus, boolean touchFullscreen) {
+ String name, int windowType, int layoutParamsFlags, int layoutParamsPrivateFlags,
+ boolean canReceiveKeys, boolean hasFocus, boolean touchFullscreen) {
mService = service;
InputChannel[] channels = InputChannel.openInputChannelPair(name);
@@ -63,6 +63,7 @@ public final class FakeWindowImpl implements WindowManagerPolicy.FakeWindow {
mWindowLayer = getLayerLw(windowType);
mWindowHandle.layer = mWindowLayer;
mWindowHandle.layoutParamsFlags = layoutParamsFlags;
+ mWindowHandle.layoutParamsPrivateFlags = layoutParamsPrivateFlags;
mWindowHandle.layoutParamsType = windowType;
mWindowHandle.dispatchingTimeoutNanos =
WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
diff --git a/services/java/com/android/server/wm/InputMonitor.java b/services/java/com/android/server/wm/InputMonitor.java
index 2e13fe2..3d2ec45 100644
--- a/services/java/com/android/server/wm/InputMonitor.java
+++ b/services/java/com/android/server/wm/InputMonitor.java
@@ -166,7 +166,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
}
private void addInputWindowHandleLw(final InputWindowHandle inputWindowHandle,
- final WindowState child, int flags, final int type,
+ final WindowState child, int flags, int privateFlags, final int type,
final boolean isVisible, final boolean hasFocus, final boolean hasWallpaper) {
// Add a window to our list of input windows.
inputWindowHandle.name = child.toString();
@@ -181,6 +181,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
child.getTouchableRegion(inputWindowHandle.touchableRegion);
}
inputWindowHandle.layoutParamsFlags = flags;
+ inputWindowHandle.layoutParamsPrivateFlags = privateFlags;
inputWindowHandle.layoutParamsType = type;
inputWindowHandle.dispatchingTimeoutNanos = child.getInputDispatchingTimeoutNanos();
inputWindowHandle.visible = isVisible;
@@ -274,6 +275,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
}
final int flags = child.mAttrs.flags;
+ final int privateFlags = child.mAttrs.privateFlags;
final int type = child.mAttrs.type;
final boolean hasFocus = (child == mInputFocus);
@@ -293,13 +295,14 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
final WindowState u = universeBackground.mWin;
if (u.mInputChannel != null && u.mInputWindowHandle != null) {
addInputWindowHandleLw(u.mInputWindowHandle, u, u.mAttrs.flags,
- u.mAttrs.type, true, u == mInputFocus, false);
+ u.mAttrs.privateFlags, u.mAttrs.type,
+ true, u == mInputFocus, false);
}
addedUniverse = true;
}
if (child.mWinAnimator != universeBackground) {
- addInputWindowHandleLw(inputWindowHandle, child, flags, type,
+ addInputWindowHandleLw(inputWindowHandle, child, flags, privateFlags, type,
isVisible, hasFocus, hasWallpaper);
}
}
diff --git a/services/java/com/android/server/wm/TaskStack.java b/services/java/com/android/server/wm/TaskStack.java
index 7bb6734..2347a19 100644
--- a/services/java/com/android/server/wm/TaskStack.java
+++ b/services/java/com/android/server/wm/TaskStack.java
@@ -71,8 +71,8 @@ public class TaskStack {
mStackId = stackId;
mDisplayContent = displayContent;
final int displayId = displayContent.getDisplayId();
- mDimLayer = new DimLayer(service, displayContent);
- mAnimationBackgroundSurface = new DimLayer(service, displayContent);
+ mDimLayer = new DimLayer(service, this);
+ mAnimationBackgroundSurface = new DimLayer(service, this);
}
DisplayContent getDisplayContent() {
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 713aeee..2e91e03 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -60,6 +60,7 @@ import android.content.pm.PackageManager;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.Bitmap;
+import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
@@ -440,7 +441,6 @@ public class WindowManagerService extends IWindowManager.Stub
= new ArrayList<IRotationWatcher>();
int mDeferredRotationPauseCount;
- final Rect mSystemDecorRect = new Rect();
int mSystemDecorLayer = 0;
final Rect mScreenRect = new Rect();
@@ -2793,7 +2793,8 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility
+ " req=" + requestedWidth + "x" + requestedHeight + " " + win.mAttrs);
- win.mEnforceSizeCompat = (win.mAttrs.flags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0;
+ win.mEnforceSizeCompat =
+ (win.mAttrs.privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0;
if ((attrChanges & WindowManager.LayoutParams.ALPHA_CHANGED) != 0) {
winAnimator.mAlpha = attrs.alpha;
@@ -5513,9 +5514,12 @@ public class WindowManagerService extends IWindowManager.Stub
* @param displayId the Display to take a screenshot of.
* @param width the width of the target bitmap
* @param height the height of the target bitmap
+ * @param force565 if true the returned bitmap will be RGB_565, otherwise it
+ * will be the same config as the surface
*/
@Override
- public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height) {
+ public Bitmap screenshotApplications(IBinder appToken, int displayId, int width,
+ int height, boolean force565) {
if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER,
"screenshotApplications()")) {
throw new SecurityException("Requires READ_FRAME_BUFFER permission");
@@ -5718,7 +5722,7 @@ public class WindowManagerService extends IWindowManager.Stub
return null;
}
- Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig());
+ Bitmap bm = Bitmap.createBitmap(width, height, force565 ? Config.RGB_565 : rawss.getConfig());
frame.scale(scale);
Matrix matrix = new Matrix();
ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix);
@@ -7923,11 +7927,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
final void rebuildAppWindowListLocked() {
- final int numDisplays = mDisplayContents.size();
- for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
- final DisplayContent displayContent = mDisplayContents.valueAt(displayNdx);
- rebuildAppWindowListLocked(displayContent);
- }
+ // TODO: Multidisplay, when ActivityStacks and tasks exist on more than one display.
+ rebuildAppWindowListLocked(getDefaultDisplayContentLocked());
}
private void rebuildAppWindowListLocked(final DisplayContent displayContent) {
@@ -8202,7 +8203,7 @@ public class WindowManagerService extends IWindowManager.Stub
mPolicy.beginLayoutLw(isDefaultDisplay, dw, dh, mRotation);
if (isDefaultDisplay) {
// Not needed on non-default displays.
- mSystemDecorLayer = mPolicy.getSystemDecorRectLw(mSystemDecorRect);
+ mSystemDecorLayer = mPolicy.getSystemDecorLayerLw();
mScreenRect.set(0, 0, dw, dh);
}
@@ -10122,12 +10123,13 @@ public class WindowManagerService extends IWindowManager.Stub
@Override
public FakeWindow addFakeWindow(Looper looper,
InputEventReceiver.Factory inputEventReceiverFactory,
- String name, int windowType, int layoutParamsFlags, boolean canReceiveKeys,
- boolean hasFocus, boolean touchFullscreen) {
+ String name, int windowType, int layoutParamsFlags, int layoutParamsPrivateFlags,
+ boolean canReceiveKeys, boolean hasFocus, boolean touchFullscreen) {
synchronized (mWindowMap) {
FakeWindowImpl fw = new FakeWindowImpl(this, looper, inputEventReceiverFactory,
name, windowType,
- layoutParamsFlags, canReceiveKeys, hasFocus, touchFullscreen);
+ layoutParamsFlags, layoutParamsPrivateFlags, canReceiveKeys,
+ hasFocus, touchFullscreen);
int i=0;
while (i<mFakeWindows.size()) {
if (mFakeWindows.get(i).mWindowLayer <= fw.mWindowLayer) {
@@ -10410,8 +10412,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
pw.println();
if (dumpAll) {
- pw.print(" mSystemDecorRect="); pw.print(mSystemDecorRect.toShortString());
- pw.print(" mSystemDecorLayer="); pw.print(mSystemDecorLayer);
+ pw.print(" mSystemDecorLayer="); pw.print(mSystemDecorLayer);
pw.print(" mScreenRect="); pw.println(mScreenRect.toShortString());
if (mLastStatusBarVisibility != 0) {
pw.print(" mLastStatusBarVisibility=0x");
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index d56e225..2d08792 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -218,6 +218,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
final Rect mContentFrame = new Rect();
final Rect mParentFrame = new Rect();
final Rect mVisibleFrame = new Rect();
+ final Rect mDecorFrame = new Rect();
boolean mContentChanged;
@@ -332,7 +333,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mContext = mService.mContext;
DeathRecipient deathRecipient = new DeathRecipient();
mSeq = seq;
- mEnforceSizeCompat = (mAttrs.flags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0;
+ mEnforceSizeCompat = (mAttrs.privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0;
if (WindowManagerService.localLOGV) Slog.v(
TAG, "Window " + this + " client=" + c.asBinder()
+ " token=" + token + " (" + mAttrs.token + ")" + " params=" + a);
@@ -458,7 +459,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
@Override
- public void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf) {
+ public void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf, Rect dcf) {
mHaveFrame = true;
TaskStack stack = mAppToken != null ? getStack() : null;
@@ -524,6 +525,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mOverscanFrame.set(of);
mContentFrame.set(cf);
mVisibleFrame.set(vf);
+ mDecorFrame.set(dcf);
final int fw = mFrame.width();
final int fh = mFrame.height();
@@ -1404,6 +1406,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
pw.print(prefix); pw.print(" content="); mContentFrame.printShortString(pw);
pw.print(" visible="); mVisibleFrame.printShortString(pw);
pw.println();
+ pw.print(prefix); pw.print(" decor="); mDecorFrame.printShortString(pw);
+ pw.println();
pw.print(prefix); pw.print("Cur insets: overscan=");
mOverscanInsets.printShortString(pw);
pw.print(" content="); mContentInsets.printShortString(pw);
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 533f626..e2fae89 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -1100,12 +1100,14 @@ class WindowStateAnimator {
} else {
applyDecorRect(mService.mScreenRect);
}
- } else if (w.mAttrs.type == WindowManager.LayoutParams.TYPE_UNIVERSE_BACKGROUND) {
- // The universe background isn't cropped.
+ } else if (w.mAttrs.type == WindowManager.LayoutParams.TYPE_UNIVERSE_BACKGROUND
+ || w.mDecorFrame.isEmpty()) {
+ // The universe background isn't cropped, nor windows without policy decor.
w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(),
w.mCompatFrame.height());
} else {
- applyDecorRect(mService.mSystemDecorRect);
+ // Crop to the system decor specified by policy.
+ applyDecorRect(w.mDecorFrame);
}
if (!w.mSystemDecorRect.equals(w.mLastSystemDecorRect)) {