Merge "Set the new SurfaceControl opaque flag." into klp-modular-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fd8a8ccbb7
@ -1233,8 +1233,9 @@ final class ActivityStack {
|
|||||||
mUndrawnActivitiesBelowTopTranslucent.clear();
|
mUndrawnActivitiesBelowTopTranslucent.clear();
|
||||||
mHandler.removeMessages(TRANSLUCENT_TIMEOUT_MSG);
|
mHandler.removeMessages(TRANSLUCENT_TIMEOUT_MSG);
|
||||||
|
|
||||||
if (waitingActivity != null && waitingActivity.app != null &&
|
if (waitingActivity != null) {
|
||||||
waitingActivity.app.thread != null) {
|
mWindowManager.setWindowOpaque(waitingActivity.appToken, false);
|
||||||
|
if (waitingActivity.app != null && waitingActivity.app.thread != null) {
|
||||||
try {
|
try {
|
||||||
waitingActivity.app.thread.scheduleTranslucentConversionComplete(
|
waitingActivity.app.thread.scheduleTranslucentConversionComplete(
|
||||||
waitingActivity.appToken, r != null);
|
waitingActivity.appToken, r != null);
|
||||||
@ -1243,6 +1244,7 @@ final class ActivityStack {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that the top activity in the stack is resumed.
|
* Ensure that the top activity in the stack is resumed.
|
||||||
|
@ -4200,10 +4200,25 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
AppWindowToken atoken = findAppWindowToken(token);
|
AppWindowToken atoken = findAppWindowToken(token);
|
||||||
if (atoken != null) {
|
if (atoken != null) {
|
||||||
atoken.appFullscreen = toOpaque;
|
atoken.appFullscreen = toOpaque;
|
||||||
|
// When making translucent, wait until windows below have been drawn.
|
||||||
|
if (toOpaque) {
|
||||||
|
// Making opaque so do it now.
|
||||||
|
setWindowOpaque(token, true);
|
||||||
|
}
|
||||||
requestTraversal();
|
requestTraversal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setWindowOpaque(IBinder token, boolean isOpaque) {
|
||||||
|
AppWindowToken wtoken = findAppWindowToken(token);
|
||||||
|
if (wtoken != null) {
|
||||||
|
WindowState win = wtoken.findMainWindow();
|
||||||
|
if (win != null) {
|
||||||
|
win.mWinAnimator.setOpaque(isOpaque);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean setTokenVisibilityLocked(AppWindowToken wtoken, WindowManager.LayoutParams lp,
|
boolean setTokenVisibilityLocked(AppWindowToken wtoken, WindowManager.LayoutParams lp,
|
||||||
boolean visible, int transit, boolean performLayout) {
|
boolean visible, int transit, boolean performLayout) {
|
||||||
boolean delayed = false;
|
boolean delayed = false;
|
||||||
|
@ -490,6 +490,7 @@ class WindowStateAnimator {
|
|||||||
private final Rect mWindowCrop = new Rect();
|
private final Rect mWindowCrop = new Rect();
|
||||||
private boolean mShown = false;
|
private boolean mShown = false;
|
||||||
private int mLayerStack;
|
private int mLayerStack;
|
||||||
|
private boolean mIsOpaque;
|
||||||
private final String mName;
|
private final String mName;
|
||||||
|
|
||||||
public SurfaceTrace(SurfaceSession s,
|
public SurfaceTrace(SurfaceSession s,
|
||||||
@ -574,6 +575,16 @@ class WindowStateAnimator {
|
|||||||
super.setLayerStack(layerStack);
|
super.setLayerStack(layerStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setOpaque(boolean isOpaque) {
|
||||||
|
if (isOpaque != mIsOpaque) {
|
||||||
|
Slog.v(SURFACE_TAG, "setOpaque(" + isOpaque + "): OLD:" + this
|
||||||
|
+ ". Called by " + Debug.getCallers(3));
|
||||||
|
mIsOpaque = isOpaque;
|
||||||
|
}
|
||||||
|
super.setOpaque(isOpaque);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hide() {
|
public void hide() {
|
||||||
if (mShown) {
|
if (mShown) {
|
||||||
@ -620,7 +631,8 @@ class WindowStateAnimator {
|
|||||||
+ mName + " (" + mLayerStack + "): shown=" + mShown + " layer=" + mLayer
|
+ mName + " (" + mLayerStack + "): shown=" + mShown + " layer=" + mLayer
|
||||||
+ " alpha=" + mSurfaceTraceAlpha + " " + mPosition.x + "," + mPosition.y
|
+ " alpha=" + mSurfaceTraceAlpha + " " + mPosition.x + "," + mPosition.y
|
||||||
+ " " + mSize.x + "x" + mSize.y
|
+ " " + mSize.x + "x" + mSize.y
|
||||||
+ " crop=" + mWindowCrop.toShortString();
|
+ " crop=" + mWindowCrop.toShortString()
|
||||||
|
+ " opaque=" + mIsOpaque;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1337,8 +1349,7 @@ class WindowStateAnimator {
|
|||||||
Slog.w(TAG, "setTransparentRegionHint: null mSurface after mHasSurface true");
|
Slog.w(TAG, "setTransparentRegionHint: null mSurface after mHasSurface true");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
|
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setTransparentRegion");
|
||||||
">>> OPEN TRANSACTION setTransparentRegion");
|
|
||||||
SurfaceControl.openTransaction();
|
SurfaceControl.openTransaction();
|
||||||
try {
|
try {
|
||||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin,
|
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin,
|
||||||
@ -1364,8 +1375,7 @@ class WindowStateAnimator {
|
|||||||
// transformation is being applied by the animation.
|
// transformation is being applied by the animation.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
|
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setWallpaperOffset");
|
||||||
">>> OPEN TRANSACTION setWallpaperOffset");
|
|
||||||
SurfaceControl.openTransaction();
|
SurfaceControl.openTransaction();
|
||||||
try {
|
try {
|
||||||
if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin,
|
if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin,
|
||||||
@ -1383,6 +1393,22 @@ class WindowStateAnimator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setOpaque(boolean isOpaque) {
|
||||||
|
if (mSurfaceControl == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setOpaque");
|
||||||
|
SurfaceControl.openTransaction();
|
||||||
|
try {
|
||||||
|
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin, "isOpaque=" + isOpaque,
|
||||||
|
null);
|
||||||
|
mSurfaceControl.setOpaque(isOpaque);
|
||||||
|
} finally {
|
||||||
|
SurfaceControl.closeTransaction();
|
||||||
|
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION setOpaque");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This must be called while inside a transaction.
|
// This must be called while inside a transaction.
|
||||||
boolean performShowLocked() {
|
boolean performShowLocked() {
|
||||||
if (mWin.isHiddenFromUserLocked()) {
|
if (mWin.isHiddenFromUserLocked()) {
|
||||||
|
Reference in New Issue
Block a user