am b54980d1: Merge "Fix issue #5588689: Black camera preview after coming back from gmail" into ics-mr1
* commit 'b54980d1d4d903f68cdfa952256afff01902cd94': Fix issue #5588689: Black camera preview after coming back from gmail
This commit is contained in:
@@ -608,7 +608,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
|
|
||||||
final int relayoutResult = mSession.relayout(
|
final int relayoutResult = mSession.relayout(
|
||||||
mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
|
mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
|
||||||
View.VISIBLE, false, mWinFrame, mContentInsets,
|
View.VISIBLE, 0, mWinFrame, mContentInsets,
|
||||||
mVisibleInsets, mConfiguration, mSurfaceHolder.mSurface);
|
mVisibleInsets, mConfiguration, mSurfaceHolder.mSurface);
|
||||||
|
|
||||||
if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
|
if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
|
||||||
@@ -654,7 +654,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
redrawNeeded |= creating
|
redrawNeeded |= creating
|
||||||
|| (relayoutResult&WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0;
|
|| (relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0;
|
||||||
|
|
||||||
if (forceReport || creating || surfaceCreating
|
if (forceReport || creating || surfaceCreating
|
||||||
|| formatChanged || sizeChanged) {
|
|| formatChanged || sizeChanged) {
|
||||||
|
|||||||
@@ -54,9 +54,8 @@ interface IWindowSession {
|
|||||||
* @param requestedWidth The width the window wants to be.
|
* @param requestedWidth The width the window wants to be.
|
||||||
* @param requestedHeight The height the window wants to be.
|
* @param requestedHeight The height the window wants to be.
|
||||||
* @param viewVisibility Window root view's visibility.
|
* @param viewVisibility Window root view's visibility.
|
||||||
* @param insetsPending Set to true if the client will be later giving
|
* @param flags Request flags: {@link WindowManagerImpl#RELAYOUT_INSETS_PENDING},
|
||||||
* internal insets; as a result, the window will not impact other window
|
* {@link WindowManagerImpl#RELAYOUT_DEFER_SURFACE_DESTROY}.
|
||||||
* layouts until the insets are given.
|
|
||||||
* @param outFrame Rect in which is placed the new position/size on
|
* @param outFrame Rect in which is placed the new position/size on
|
||||||
* screen.
|
* screen.
|
||||||
* @param outContentInsets Rect in which is placed the offsets from
|
* @param outContentInsets Rect in which is placed the offsets from
|
||||||
@@ -80,10 +79,16 @@ interface IWindowSession {
|
|||||||
*/
|
*/
|
||||||
int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs,
|
int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs,
|
||||||
int requestedWidth, int requestedHeight, int viewVisibility,
|
int requestedWidth, int requestedHeight, int viewVisibility,
|
||||||
boolean insetsPending, out Rect outFrame, out Rect outContentInsets,
|
int flags, out Rect outFrame, out Rect outContentInsets,
|
||||||
out Rect outVisibleInsets, out Configuration outConfig,
|
out Rect outVisibleInsets, out Configuration outConfig,
|
||||||
out Surface outSurface);
|
out Surface outSurface);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a call to relayout() asked to have the surface destroy deferred,
|
||||||
|
* it must call this once it is okay to destroy that surface.
|
||||||
|
*/
|
||||||
|
void performDeferredDestroy(IWindow window);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by a client to report that it ran out of graphics memory.
|
* Called by a client to report that it ran out of graphics memory.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package android.view;
|
package android.view;
|
||||||
|
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import com.android.internal.view.BaseIWindow;
|
import com.android.internal.view.BaseIWindow;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -82,7 +81,6 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
public class SurfaceView extends View {
|
public class SurfaceView extends View {
|
||||||
static private final String TAG = "SurfaceView";
|
static private final String TAG = "SurfaceView";
|
||||||
static private final boolean DEBUG = false;
|
static private final boolean DEBUG = false;
|
||||||
static private final boolean localLOGV = DEBUG ? true : false;
|
|
||||||
|
|
||||||
final ArrayList<SurfaceHolder.Callback> mCallbacks
|
final ArrayList<SurfaceHolder.Callback> mCallbacks
|
||||||
= new ArrayList<SurfaceHolder.Callback>();
|
= new ArrayList<SurfaceHolder.Callback>();
|
||||||
@@ -90,7 +88,8 @@ public class SurfaceView extends View {
|
|||||||
final int[] mLocation = new int[2];
|
final int[] mLocation = new int[2];
|
||||||
|
|
||||||
final ReentrantLock mSurfaceLock = new ReentrantLock();
|
final ReentrantLock mSurfaceLock = new ReentrantLock();
|
||||||
final Surface mSurface = new Surface();
|
Surface mSurface = new Surface(); // Current surface in use
|
||||||
|
Surface mNewSurface = new Surface(); // New surface we are switching to
|
||||||
boolean mDrawingStopped = true;
|
boolean mDrawingStopped = true;
|
||||||
|
|
||||||
final WindowManager.LayoutParams mLayout
|
final WindowManager.LayoutParams mLayout
|
||||||
@@ -145,8 +144,7 @@ public class SurfaceView extends View {
|
|||||||
int mRequestedFormat = PixelFormat.RGB_565;
|
int mRequestedFormat = PixelFormat.RGB_565;
|
||||||
|
|
||||||
boolean mHaveFrame = false;
|
boolean mHaveFrame = false;
|
||||||
boolean mDestroyReportNeeded = false;
|
boolean mSurfaceCreated = false;
|
||||||
boolean mNewSurfaceNeeded = false;
|
|
||||||
long mLastLockTime = 0;
|
long mLastLockTime = 0;
|
||||||
|
|
||||||
boolean mVisible = false;
|
boolean mVisible = false;
|
||||||
@@ -236,46 +234,6 @@ public class SurfaceView extends View {
|
|||||||
updateWindow(false, false);
|
updateWindow(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is not intended for general use. It was created
|
|
||||||
* temporarily to improve performance of 3D layers in Launcher
|
|
||||||
* and should be removed and fixed properly.
|
|
||||||
*
|
|
||||||
* Do not call this method. Ever.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
protected void showSurface() {
|
|
||||||
if (mSession != null) {
|
|
||||||
updateWindow(true, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is not intended for general use. It was created
|
|
||||||
* temporarily to improve performance of 3D layers in Launcher
|
|
||||||
* and should be removed and fixed properly.
|
|
||||||
*
|
|
||||||
* Do not call this method. Ever.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
protected void hideSurface() {
|
|
||||||
if (mSession != null && mWindow != null) {
|
|
||||||
mSurfaceLock.lock();
|
|
||||||
try {
|
|
||||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
|
||||||
mLayout.x = metrics.widthPixels * 3;
|
|
||||||
mSession.relayout(mWindow, mWindow.mSeq, mLayout, mWidth, mHeight, VISIBLE, false,
|
|
||||||
mWinFrame, mContentInsets, mVisibleInsets, mConfiguration, mSurface);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
// Ignore
|
|
||||||
} finally {
|
|
||||||
mSurfaceLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDetachedFromWindow() {
|
protected void onDetachedFromWindow() {
|
||||||
if (mGlobalListenersAdded) {
|
if (mGlobalListenersAdded) {
|
||||||
@@ -444,14 +402,13 @@ public class SurfaceView extends View {
|
|||||||
final boolean creating = mWindow == null;
|
final boolean creating = mWindow == null;
|
||||||
final boolean formatChanged = mFormat != mRequestedFormat;
|
final boolean formatChanged = mFormat != mRequestedFormat;
|
||||||
final boolean sizeChanged = mWidth != myWidth || mHeight != myHeight;
|
final boolean sizeChanged = mWidth != myWidth || mHeight != myHeight;
|
||||||
final boolean visibleChanged = mVisible != mRequestedVisible
|
final boolean visibleChanged = mVisible != mRequestedVisible;
|
||||||
|| mNewSurfaceNeeded;
|
|
||||||
|
|
||||||
if (force || creating || formatChanged || sizeChanged || visibleChanged
|
if (force || creating || formatChanged || sizeChanged || visibleChanged
|
||||||
|| mLeft != mLocation[0] || mTop != mLocation[1]
|
|| mLeft != mLocation[0] || mTop != mLocation[1]
|
||||||
|| mUpdateWindowNeeded || mReportDrawNeeded || redrawNeeded) {
|
|| mUpdateWindowNeeded || mReportDrawNeeded || redrawNeeded) {
|
||||||
|
|
||||||
if (localLOGV) Log.i(TAG, "Changes: creating=" + creating
|
if (DEBUG) Log.i(TAG, "Changes: creating=" + creating
|
||||||
+ " format=" + formatChanged + " size=" + sizeChanged
|
+ " format=" + formatChanged + " size=" + sizeChanged
|
||||||
+ " visible=" + visibleChanged
|
+ " visible=" + visibleChanged
|
||||||
+ " left=" + (mLeft != mLocation[0])
|
+ " left=" + (mLeft != mLocation[0])
|
||||||
@@ -496,15 +453,11 @@ public class SurfaceView extends View {
|
|||||||
mVisible ? VISIBLE : GONE, mContentInsets);
|
mVisible ? VISIBLE : GONE, mContentInsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visibleChanged && (!visible || mNewSurfaceNeeded)) {
|
|
||||||
reportSurfaceDestroyed();
|
|
||||||
}
|
|
||||||
|
|
||||||
mNewSurfaceNeeded = false;
|
|
||||||
|
|
||||||
boolean realSizeChanged;
|
boolean realSizeChanged;
|
||||||
boolean reportDrawNeeded;
|
boolean reportDrawNeeded;
|
||||||
|
|
||||||
|
int relayoutResult;
|
||||||
|
|
||||||
mSurfaceLock.lock();
|
mSurfaceLock.lock();
|
||||||
try {
|
try {
|
||||||
mUpdateWindowNeeded = false;
|
mUpdateWindowNeeded = false;
|
||||||
@@ -512,17 +465,21 @@ public class SurfaceView extends View {
|
|||||||
mReportDrawNeeded = false;
|
mReportDrawNeeded = false;
|
||||||
mDrawingStopped = !visible;
|
mDrawingStopped = !visible;
|
||||||
|
|
||||||
final int relayoutResult = mSession.relayout(
|
if (DEBUG) Log.i(TAG, "Cur surface: " + mSurface);
|
||||||
|
|
||||||
|
relayoutResult = mSession.relayout(
|
||||||
mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
|
mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
|
||||||
visible ? VISIBLE : GONE, false, mWinFrame, mContentInsets,
|
visible ? VISIBLE : GONE,
|
||||||
mVisibleInsets, mConfiguration, mSurface);
|
WindowManagerImpl.RELAYOUT_DEFER_SURFACE_DESTROY,
|
||||||
if ((relayoutResult&WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) {
|
mWinFrame, mContentInsets,
|
||||||
|
mVisibleInsets, mConfiguration, mNewSurface);
|
||||||
|
if ((relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0) {
|
||||||
mReportDrawNeeded = true;
|
mReportDrawNeeded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localLOGV) Log.i(TAG, "New surface: " + mSurface
|
if (DEBUG) Log.i(TAG, "New surface: " + mNewSurface
|
||||||
+ ", vis=" + visible + ", frame=" + mWinFrame);
|
+ ", vis=" + visible + ", frame=" + mWinFrame);
|
||||||
|
|
||||||
mSurfaceFrame.left = 0;
|
mSurfaceFrame.left = 0;
|
||||||
mSurfaceFrame.top = 0;
|
mSurfaceFrame.top = 0;
|
||||||
if (mTranslator == null) {
|
if (mTranslator == null) {
|
||||||
@@ -547,28 +504,54 @@ public class SurfaceView extends View {
|
|||||||
try {
|
try {
|
||||||
redrawNeeded |= creating | reportDrawNeeded;
|
redrawNeeded |= creating | reportDrawNeeded;
|
||||||
|
|
||||||
if (visible) {
|
SurfaceHolder.Callback callbacks[] = null;
|
||||||
mDestroyReportNeeded = true;
|
|
||||||
|
|
||||||
SurfaceHolder.Callback callbacks[];
|
final boolean surfaceChanged =
|
||||||
synchronized (mCallbacks) {
|
(relayoutResult&WindowManagerImpl.RELAYOUT_RES_SURFACE_CHANGED) != 0;
|
||||||
callbacks = new SurfaceHolder.Callback[mCallbacks.size()];
|
if (mSurfaceCreated && (surfaceChanged || (!visible && visibleChanged))) {
|
||||||
mCallbacks.toArray(callbacks);
|
mSurfaceCreated = false;
|
||||||
|
if (mSurface.isValid()) {
|
||||||
|
if (DEBUG) Log.i(TAG, "visibleChanged -- surfaceDestroyed");
|
||||||
|
callbacks = getSurfaceCallbacks();
|
||||||
|
for (SurfaceHolder.Callback c : callbacks) {
|
||||||
|
c.surfaceDestroyed(mSurfaceHolder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (visibleChanged) {
|
Surface tmpSurface = mSurface;
|
||||||
|
mSurface = mNewSurface;
|
||||||
|
mNewSurface = tmpSurface;
|
||||||
|
mNewSurface.release();
|
||||||
|
|
||||||
|
if (visible) {
|
||||||
|
if (!mSurfaceCreated && (surfaceChanged || visibleChanged)) {
|
||||||
|
mSurfaceCreated = true;
|
||||||
mIsCreating = true;
|
mIsCreating = true;
|
||||||
|
if (DEBUG) Log.i(TAG, "visibleChanged -- surfaceCreated");
|
||||||
|
if (callbacks == null) {
|
||||||
|
callbacks = getSurfaceCallbacks();
|
||||||
|
}
|
||||||
for (SurfaceHolder.Callback c : callbacks) {
|
for (SurfaceHolder.Callback c : callbacks) {
|
||||||
c.surfaceCreated(mSurfaceHolder);
|
c.surfaceCreated(mSurfaceHolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (creating || formatChanged || sizeChanged
|
if (creating || formatChanged || sizeChanged
|
||||||
|| visibleChanged || realSizeChanged) {
|
|| visibleChanged || realSizeChanged) {
|
||||||
|
if (DEBUG) Log.i(TAG, "surfaceChanged -- format=" + mFormat
|
||||||
|
+ " w=" + myWidth + " h=" + myHeight);
|
||||||
|
if (callbacks == null) {
|
||||||
|
callbacks = getSurfaceCallbacks();
|
||||||
|
}
|
||||||
for (SurfaceHolder.Callback c : callbacks) {
|
for (SurfaceHolder.Callback c : callbacks) {
|
||||||
c.surfaceChanged(mSurfaceHolder, mFormat, myWidth, myHeight);
|
c.surfaceChanged(mSurfaceHolder, mFormat, myWidth, myHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (redrawNeeded) {
|
if (redrawNeeded) {
|
||||||
|
if (DEBUG) Log.i(TAG, "surfaceRedrawNeeded");
|
||||||
|
if (callbacks == null) {
|
||||||
|
callbacks = getSurfaceCallbacks();
|
||||||
|
}
|
||||||
for (SurfaceHolder.Callback c : callbacks) {
|
for (SurfaceHolder.Callback c : callbacks) {
|
||||||
if (c instanceof SurfaceHolder.Callback2) {
|
if (c instanceof SurfaceHolder.Callback2) {
|
||||||
((SurfaceHolder.Callback2)c).surfaceRedrawNeeded(
|
((SurfaceHolder.Callback2)c).surfaceRedrawNeeded(
|
||||||
@@ -576,41 +559,34 @@ public class SurfaceView extends View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
mSurface.release();
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
mIsCreating = false;
|
mIsCreating = false;
|
||||||
if (redrawNeeded) {
|
if (redrawNeeded) {
|
||||||
|
if (DEBUG) Log.i(TAG, "finishedDrawing");
|
||||||
mSession.finishDrawing(mWindow);
|
mSession.finishDrawing(mWindow);
|
||||||
}
|
}
|
||||||
|
mSession.performDeferredDestroy(mWindow);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
if (localLOGV) Log.v(
|
if (DEBUG) Log.v(
|
||||||
TAG, "Layout: x=" + mLayout.x + " y=" + mLayout.y +
|
TAG, "Layout: x=" + mLayout.x + " y=" + mLayout.y +
|
||||||
" w=" + mLayout.width + " h=" + mLayout.height +
|
" w=" + mLayout.width + " h=" + mLayout.height +
|
||||||
", frame=" + mSurfaceFrame);
|
", frame=" + mSurfaceFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reportSurfaceDestroyed() {
|
private SurfaceHolder.Callback[] getSurfaceCallbacks() {
|
||||||
if (mDestroyReportNeeded) {
|
SurfaceHolder.Callback callbacks[];
|
||||||
mDestroyReportNeeded = false;
|
synchronized (mCallbacks) {
|
||||||
SurfaceHolder.Callback callbacks[];
|
callbacks = new SurfaceHolder.Callback[mCallbacks.size()];
|
||||||
synchronized (mCallbacks) {
|
mCallbacks.toArray(callbacks);
|
||||||
callbacks = new SurfaceHolder.Callback[mCallbacks.size()];
|
|
||||||
mCallbacks.toArray(callbacks);
|
|
||||||
}
|
|
||||||
for (SurfaceHolder.Callback c : callbacks) {
|
|
||||||
c.surfaceDestroyed(mSurfaceHolder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
super.onDetachedFromWindow();
|
return callbacks;
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleGetNewSurface() {
|
void handleGetNewSurface() {
|
||||||
mNewSurfaceNeeded = true;
|
|
||||||
updateWindow(false, false);
|
updateWindow(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,7 +612,7 @@ public class SurfaceView extends View {
|
|||||||
Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
|
Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
|
||||||
SurfaceView surfaceView = mSurfaceView.get();
|
SurfaceView surfaceView = mSurfaceView.get();
|
||||||
if (surfaceView != null) {
|
if (surfaceView != null) {
|
||||||
if (localLOGV) Log.v(
|
if (DEBUG) Log.v(
|
||||||
"SurfaceView", surfaceView + " got resized: w=" +
|
"SurfaceView", surfaceView + " got resized: w=" +
|
||||||
w + " h=" + h + ", cur w=" + mCurWidth + " h=" + mCurHeight);
|
w + " h=" + h + ", cur w=" + mCurWidth + " h=" + mCurHeight);
|
||||||
surfaceView.mSurfaceLock.lock();
|
surfaceView.mSurfaceLock.lock();
|
||||||
@@ -754,7 +730,7 @@ public class SurfaceView extends View {
|
|||||||
private final Canvas internalLockCanvas(Rect dirty) {
|
private final Canvas internalLockCanvas(Rect dirty) {
|
||||||
mSurfaceLock.lock();
|
mSurfaceLock.lock();
|
||||||
|
|
||||||
if (localLOGV) Log.i(TAG, "Locking canvas... stopped="
|
if (DEBUG) Log.i(TAG, "Locking canvas... stopped="
|
||||||
+ mDrawingStopped + ", win=" + mWindow);
|
+ mDrawingStopped + ", win=" + mWindow);
|
||||||
|
|
||||||
Canvas c = null;
|
Canvas c = null;
|
||||||
@@ -774,7 +750,7 @@ public class SurfaceView extends View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localLOGV) Log.i(TAG, "Returned canvas: " + c);
|
if (DEBUG) Log.i(TAG, "Returned canvas: " + c);
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
mLastLockTime = SystemClock.uptimeMillis();
|
mLastLockTime = SystemClock.uptimeMillis();
|
||||||
return c;
|
return c;
|
||||||
|
|||||||
@@ -1426,7 +1426,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
|
|
||||||
if (!mStopped) {
|
if (!mStopped) {
|
||||||
boolean focusChangedDueToTouchMode = ensureTouchModeLocally(
|
boolean focusChangedDueToTouchMode = ensureTouchModeLocally(
|
||||||
(relayoutResult&WindowManagerImpl.RELAYOUT_IN_TOUCH_MODE) != 0);
|
(relayoutResult&WindowManagerImpl.RELAYOUT_RES_IN_TOUCH_MODE) != 0);
|
||||||
if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth()
|
if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth()
|
||||||
|| mHeight != host.getMeasuredHeight() || contentInsetsChanged) {
|
|| mHeight != host.getMeasuredHeight() || contentInsetsChanged) {
|
||||||
childWidthMeasureSpec = getRootMeasureSpec(mWidth, lp.width);
|
childWidthMeasureSpec = getRootMeasureSpec(mWidth, lp.width);
|
||||||
@@ -1637,7 +1637,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mLastDrawDurationNanos = System.nanoTime() - drawStartTime;
|
mLastDrawDurationNanos = System.nanoTime() - drawStartTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((relayoutResult&WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0
|
if ((relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0
|
||||||
|| mReportNextDraw) {
|
|| mReportNextDraw) {
|
||||||
if (LOCAL_LOGV) {
|
if (LOCAL_LOGV) {
|
||||||
Log.v(TAG, "FINISHED DRAWING: " + mWindowAttributes.getTitle());
|
Log.v(TAG, "FINISHED DRAWING: " + mWindowAttributes.getTitle());
|
||||||
@@ -1670,7 +1670,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
}
|
}
|
||||||
// We were supposed to report when we are done drawing. Since we canceled the
|
// We were supposed to report when we are done drawing. Since we canceled the
|
||||||
// draw, remember it here.
|
// draw, remember it here.
|
||||||
if ((relayoutResult&WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) {
|
if ((relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0) {
|
||||||
mReportNextDraw = true;
|
mReportNextDraw = true;
|
||||||
}
|
}
|
||||||
if (fullRedrawNeeded) {
|
if (fullRedrawNeeded) {
|
||||||
@@ -3586,8 +3586,8 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mWindow, mSeq, params,
|
mWindow, mSeq, params,
|
||||||
(int) (mView.getMeasuredWidth() * appScale + 0.5f),
|
(int) (mView.getMeasuredWidth() * appScale + 0.5f),
|
||||||
(int) (mView.getMeasuredHeight() * appScale + 0.5f),
|
(int) (mView.getMeasuredHeight() * appScale + 0.5f),
|
||||||
viewVisibility, insetsPending, mWinFrame,
|
viewVisibility, insetsPending ? WindowManagerImpl.RELAYOUT_INSETS_PENDING : 0,
|
||||||
mPendingContentInsets, mPendingVisibleInsets,
|
mWinFrame, mPendingContentInsets, mPendingVisibleInsets,
|
||||||
mPendingConfiguration, mSurface);
|
mPendingConfiguration, mSurface);
|
||||||
//Log.d(TAG, "<<<<<< BACK FROM relayout");
|
//Log.d(TAG, "<<<<<< BACK FROM relayout");
|
||||||
if (restore) {
|
if (restore) {
|
||||||
@@ -3717,7 +3717,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
// animation info.
|
// animation info.
|
||||||
try {
|
try {
|
||||||
if ((relayoutWindow(mWindowAttributes, viewVisibility, false)
|
if ((relayoutWindow(mWindowAttributes, viewVisibility, false)
|
||||||
& WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) {
|
& WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0) {
|
||||||
sWindowSession.finishDrawing(mWindow);
|
sWindowSession.finishDrawing(mWindow);
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
@@ -63,15 +63,34 @@ public class WindowManagerImpl implements WindowManager {
|
|||||||
* The user is navigating with keys (not the touch screen), so
|
* The user is navigating with keys (not the touch screen), so
|
||||||
* navigational focus should be shown.
|
* navigational focus should be shown.
|
||||||
*/
|
*/
|
||||||
public static final int RELAYOUT_IN_TOUCH_MODE = 0x1;
|
public static final int RELAYOUT_RES_IN_TOUCH_MODE = 0x1;
|
||||||
/**
|
/**
|
||||||
* This is the first time the window is being drawn,
|
* This is the first time the window is being drawn,
|
||||||
* so the client must call drawingFinished() when done
|
* so the client must call drawingFinished() when done
|
||||||
*/
|
*/
|
||||||
public static final int RELAYOUT_FIRST_TIME = 0x2;
|
public static final int RELAYOUT_RES_FIRST_TIME = 0x2;
|
||||||
|
/**
|
||||||
|
* The window manager has changed the surface from the last call.
|
||||||
|
*/
|
||||||
|
public static final int RELAYOUT_RES_SURFACE_CHANGED = 0x4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag for relayout: the client will be later giving
|
||||||
|
* internal insets; as a result, the window will not impact other window
|
||||||
|
* layouts until the insets are given.
|
||||||
|
*/
|
||||||
|
public static final int RELAYOUT_INSETS_PENDING = 0x1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag for relayout: the client may be currently using the current surface,
|
||||||
|
* so if it is to be destroyed as a part of the relayout the destroy must
|
||||||
|
* be deferred until later. The client will call performDeferredDestroy()
|
||||||
|
* when it is okay.
|
||||||
|
*/
|
||||||
|
public static final int RELAYOUT_DEFER_SURFACE_DESTROY = 0x2;
|
||||||
|
|
||||||
public static final int ADD_FLAG_APP_VISIBLE = 0x2;
|
public static final int ADD_FLAG_APP_VISIBLE = 0x2;
|
||||||
public static final int ADD_FLAG_IN_TOUCH_MODE = RELAYOUT_IN_TOUCH_MODE;
|
public static final int ADD_FLAG_IN_TOUCH_MODE = RELAYOUT_RES_IN_TOUCH_MODE;
|
||||||
|
|
||||||
public static final int ADD_OKAY = 0;
|
public static final int ADD_OKAY = 0;
|
||||||
public static final int ADD_BAD_APP_TOKEN = -1;
|
public static final int ADD_BAD_APP_TOKEN = -1;
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@interpolator/decelerate_quad">
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:detachWallpaper="true" android:interpolator="@interpolator/decelerate_quad">
|
||||||
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="160" />
|
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="160" />
|
||||||
</set>
|
</set>
|
||||||
|
|
||||||
|
|||||||
@@ -151,18 +151,22 @@ final class Session extends IWindowSession.Stub
|
|||||||
|
|
||||||
public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs,
|
public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs,
|
||||||
int requestedWidth, int requestedHeight, int viewFlags,
|
int requestedWidth, int requestedHeight, int viewFlags,
|
||||||
boolean insetsPending, Rect outFrame, Rect outContentInsets,
|
int flags, Rect outFrame, Rect outContentInsets,
|
||||||
Rect outVisibleInsets, Configuration outConfig, Surface outSurface) {
|
Rect outVisibleInsets, Configuration outConfig, Surface outSurface) {
|
||||||
if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from "
|
if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from "
|
||||||
+ Binder.getCallingPid());
|
+ Binder.getCallingPid());
|
||||||
int res = mService.relayoutWindow(this, window, seq, attrs,
|
int res = mService.relayoutWindow(this, window, seq, attrs,
|
||||||
requestedWidth, requestedHeight, viewFlags, insetsPending,
|
requestedWidth, requestedHeight, viewFlags, flags,
|
||||||
outFrame, outContentInsets, outVisibleInsets, outConfig, outSurface);
|
outFrame, outContentInsets, outVisibleInsets, outConfig, outSurface);
|
||||||
if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to "
|
if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to "
|
||||||
+ Binder.getCallingPid());
|
+ Binder.getCallingPid());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void performDeferredDestroy(IWindow window) {
|
||||||
|
mService.performDeferredDestroyWindow(this, window);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean outOfMemory(IWindow window) {
|
public boolean outOfMemory(IWindow window) {
|
||||||
return mService.outOfMemoryWindow(this, window);
|
return mService.outOfMemoryWindow(this, window);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2499,12 +2499,13 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
public int relayoutWindow(Session session, IWindow client, int seq,
|
public int relayoutWindow(Session session, IWindow client, int seq,
|
||||||
WindowManager.LayoutParams attrs, int requestedWidth,
|
WindowManager.LayoutParams attrs, int requestedWidth,
|
||||||
int requestedHeight, int viewVisibility, boolean insetsPending,
|
int requestedHeight, int viewVisibility, int flags,
|
||||||
Rect outFrame, Rect outContentInsets, Rect outVisibleInsets,
|
Rect outFrame, Rect outContentInsets, Rect outVisibleInsets,
|
||||||
Configuration outConfig, Surface outSurface) {
|
Configuration outConfig, Surface outSurface) {
|
||||||
boolean displayed = false;
|
boolean displayed = false;
|
||||||
boolean inTouchMode;
|
boolean inTouchMode;
|
||||||
boolean configChanged;
|
boolean configChanged;
|
||||||
|
boolean surfaceChanged = false;
|
||||||
|
|
||||||
// if they don't have this permission, mask out the status bar bits
|
// if they don't have this permission, mask out the status bar bits
|
||||||
int systemUiVisibility = 0;
|
int systemUiVisibility = 0;
|
||||||
@@ -2534,6 +2535,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mPolicy.adjustWindowParamsLw(attrs);
|
mPolicy.adjustWindowParamsLw(attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
win.mSurfaceDestroyDeferred =
|
||||||
|
(flags&WindowManagerImpl.RELAYOUT_DEFER_SURFACE_DESTROY) != 0;
|
||||||
|
|
||||||
int attrChanges = 0;
|
int attrChanges = 0;
|
||||||
int flagChanges = 0;
|
int flagChanges = 0;
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
@@ -2630,8 +2634,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// To change the format, we need to re-build the surface.
|
// To change the format, we need to re-build the surface.
|
||||||
win.destroySurfaceLocked();
|
win.destroySurfaceLocked();
|
||||||
displayed = true;
|
displayed = true;
|
||||||
|
surfaceChanged = true;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (win.mSurface == null) {
|
||||||
|
surfaceChanged = true;
|
||||||
|
}
|
||||||
Surface surface = win.createSurfaceLocked();
|
Surface surface = win.createSurfaceLocked();
|
||||||
if (surface != null) {
|
if (surface != null) {
|
||||||
outSurface.copyFrom(surface);
|
outSurface.copyFrom(surface);
|
||||||
@@ -2683,6 +2691,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// If we are not currently running the exit animation, we
|
// If we are not currently running the exit animation, we
|
||||||
// need to see about starting one.
|
// need to see about starting one.
|
||||||
if (!win.mExiting || win.mSurfacePendingDestroy) {
|
if (!win.mExiting || win.mSurfacePendingDestroy) {
|
||||||
|
surfaceChanged = true;
|
||||||
// Try starting an animation; if there isn't one, we
|
// Try starting an animation; if there isn't one, we
|
||||||
// can destroy the surface right away.
|
// can destroy the surface right away.
|
||||||
int transit = WindowManagerPolicy.TRANSIT_EXIT;
|
int transit = WindowManagerPolicy.TRANSIT_EXIT;
|
||||||
@@ -2715,10 +2724,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (win.mSurface == null || (win.getAttrs().flags
|
if (win.mSurface == null || (win.getAttrs().flags
|
||||||
& WindowManager.LayoutParams.FLAG_KEEP_SURFACE_WHILE_ANIMATING) == 0
|
& WindowManager.LayoutParams.FLAG_KEEP_SURFACE_WHILE_ANIMATING) == 0
|
||||||
|| win.mSurfacePendingDestroy) {
|
|| win.mSurfacePendingDestroy) {
|
||||||
// We are being called from a local process, which
|
// We could be called from a local process, which
|
||||||
// means outSurface holds its current surface. Ensure the
|
// means outSurface holds its current surface. Ensure the
|
||||||
// surface object is cleared, but we don't want it actually
|
// surface object is cleared, but we don't necessarily want
|
||||||
// destroyed at this point.
|
// it actually destroyed at this point.
|
||||||
win.mSurfacePendingDestroy = false;
|
win.mSurfacePendingDestroy = false;
|
||||||
outSurface.release();
|
outSurface.release();
|
||||||
if (DEBUG_VISIBILITY) Slog.i(TAG, "Releasing surface in: " + win);
|
if (DEBUG_VISIBILITY) Slog.i(TAG, "Releasing surface in: " + win);
|
||||||
@@ -2760,7 +2769,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
mLayoutNeeded = true;
|
mLayoutNeeded = true;
|
||||||
win.mGivenInsetsPending = insetsPending;
|
win.mGivenInsetsPending = (flags&WindowManagerImpl.RELAYOUT_INSETS_PENDING) != 0;
|
||||||
if (assignLayers) {
|
if (assignLayers) {
|
||||||
assignLayersLocked();
|
assignLayersLocked();
|
||||||
}
|
}
|
||||||
@@ -2797,8 +2806,25 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
Binder.restoreCallingIdentity(origId);
|
Binder.restoreCallingIdentity(origId);
|
||||||
|
|
||||||
return (inTouchMode ? WindowManagerImpl.RELAYOUT_IN_TOUCH_MODE : 0)
|
return (inTouchMode ? WindowManagerImpl.RELAYOUT_RES_IN_TOUCH_MODE : 0)
|
||||||
| (displayed ? WindowManagerImpl.RELAYOUT_FIRST_TIME : 0);
|
| (displayed ? WindowManagerImpl.RELAYOUT_RES_FIRST_TIME : 0)
|
||||||
|
| (surfaceChanged ? WindowManagerImpl.RELAYOUT_RES_SURFACE_CHANGED : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void performDeferredDestroyWindow(Session session, IWindow client) {
|
||||||
|
long origId = Binder.clearCallingIdentity();
|
||||||
|
|
||||||
|
try {
|
||||||
|
synchronized(mWindowMap) {
|
||||||
|
WindowState win = windowForClientLocked(session, client, false);
|
||||||
|
if (win == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
win.destroyDeferredSurfaceLocked();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(origId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean outOfMemoryWindow(Session session, IWindow client) {
|
public boolean outOfMemoryWindow(Session session, IWindow client) {
|
||||||
@@ -3738,7 +3764,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a translucent or wallpaper window, then don't
|
// If this is a translucent window, then don't
|
||||||
// show a starting window -- the current effect (a full-screen
|
// show a starting window -- the current effect (a full-screen
|
||||||
// opaque starting window that fades away to the real contents
|
// opaque starting window that fades away to the real contents
|
||||||
// when it is ready) does not work for this.
|
// when it is ready) does not work for this.
|
||||||
@@ -3755,7 +3781,16 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
if (ent.array.getBoolean(
|
if (ent.array.getBoolean(
|
||||||
com.android.internal.R.styleable.Window_windowShowWallpaper, false)) {
|
com.android.internal.R.styleable.Window_windowShowWallpaper, false)) {
|
||||||
return;
|
if (mWallpaperTarget == null) {
|
||||||
|
// If this theme is requesting a wallpaper, and the wallpaper
|
||||||
|
// is not curently visible, then this effectively serves as
|
||||||
|
// an opaque window and our starting window transition animation
|
||||||
|
// can still work. We just need to make sure the starting window
|
||||||
|
// is also showing the wallpaper.
|
||||||
|
windowFlags |= WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7659,7 +7694,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// a detached wallpaper animation.
|
// a detached wallpaper animation.
|
||||||
if (nowAnimating) {
|
if (nowAnimating) {
|
||||||
if (w.mAnimation != null) {
|
if (w.mAnimation != null) {
|
||||||
if (w.mAnimation.getDetachWallpaper()) {
|
if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0
|
||||||
|
&& w.mAnimation.getDetachWallpaper()) {
|
||||||
windowDetachedWallpaper = w;
|
windowDetachedWallpaper = w;
|
||||||
}
|
}
|
||||||
if (w.mAnimation.getBackgroundColor() != 0) {
|
if (w.mAnimation.getBackgroundColor() != 0) {
|
||||||
@@ -7679,7 +7715,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// displayed behind it.
|
// displayed behind it.
|
||||||
if (w.mAppToken != null && w.mAppToken.animation != null
|
if (w.mAppToken != null && w.mAppToken.animation != null
|
||||||
&& w.mAppToken.animating) {
|
&& w.mAppToken.animating) {
|
||||||
if (w.mAppToken.animation.getDetachWallpaper()) {
|
if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0
|
||||||
|
&& w.mAppToken.animation.getDetachWallpaper()) {
|
||||||
windowDetachedWallpaper = w;
|
windowDetachedWallpaper = w;
|
||||||
}
|
}
|
||||||
if (w.mAppToken.animation.getBackgroundColor() != 0) {
|
if (w.mAppToken.animation.getBackgroundColor() != 0) {
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
boolean mPolicyVisibilityAfterAnim = true;
|
boolean mPolicyVisibilityAfterAnim = true;
|
||||||
boolean mAppFreezing;
|
boolean mAppFreezing;
|
||||||
Surface mSurface;
|
Surface mSurface;
|
||||||
|
Surface mPendingDestroySurface;
|
||||||
boolean mReportDestroySurface;
|
boolean mReportDestroySurface;
|
||||||
boolean mSurfacePendingDestroy;
|
boolean mSurfacePendingDestroy;
|
||||||
boolean mAttachedHidden; // is our parent window hidden?
|
boolean mAttachedHidden; // is our parent window hidden?
|
||||||
@@ -121,7 +122,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
* we must tell them application to resize (and thus redraw itself).
|
* we must tell them application to resize (and thus redraw itself).
|
||||||
*/
|
*/
|
||||||
boolean mSurfaceResized;
|
boolean mSurfaceResized;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set if the client has asked that the destroy of its surface be delayed
|
||||||
|
* until it explicitly says it is okay.
|
||||||
|
*/
|
||||||
|
boolean mSurfaceDestroyDeferred;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insets that determine the actually visible area. These are in the application's
|
* Insets that determine the actually visible area. These are in the application's
|
||||||
* coordinate space (without compatibility scale applied).
|
* coordinate space (without compatibility scale applied).
|
||||||
@@ -764,15 +771,32 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
Slog.w(WindowManagerService.TAG, "Window " + this + " destroying surface "
|
Slog.w(WindowManagerService.TAG, "Window " + this + " destroying surface "
|
||||||
+ mSurface + ", session " + mSession, e);
|
+ mSurface + ", session " + mSession, e);
|
||||||
}
|
}
|
||||||
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
if (mSurfaceDestroyDeferred) {
|
||||||
RuntimeException e = null;
|
if (mSurface != null && mPendingDestroySurface != mSurface) {
|
||||||
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
|
if (mPendingDestroySurface != null) {
|
||||||
e = new RuntimeException();
|
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
||||||
e.fillInStackTrace();
|
RuntimeException e = null;
|
||||||
|
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
|
||||||
|
e = new RuntimeException();
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
WindowManagerService.logSurface(this, "DESTROY PENDING", e);
|
||||||
|
}
|
||||||
|
mPendingDestroySurface.destroy();
|
||||||
|
}
|
||||||
|
mPendingDestroySurface = mSurface;
|
||||||
}
|
}
|
||||||
WindowManagerService.logSurface(this, "DESTROY", e);
|
} else {
|
||||||
|
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
||||||
|
RuntimeException e = null;
|
||||||
|
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
|
||||||
|
e = new RuntimeException();
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
WindowManagerService.logSurface(this, "DESTROY", e);
|
||||||
|
}
|
||||||
|
mSurface.destroy();
|
||||||
}
|
}
|
||||||
mSurface.destroy();
|
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
Slog.w(WindowManagerService.TAG, "Exception thrown when destroying Window " + this
|
Slog.w(WindowManagerService.TAG, "Exception thrown when destroying Window " + this
|
||||||
+ " surface " + mSurface + " session " + mSession
|
+ " surface " + mSurface + " session " + mSession
|
||||||
@@ -784,6 +808,28 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void destroyDeferredSurfaceLocked() {
|
||||||
|
try {
|
||||||
|
if (mPendingDestroySurface != null) {
|
||||||
|
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
||||||
|
RuntimeException e = null;
|
||||||
|
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
|
||||||
|
e = new RuntimeException();
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
mService.logSurface(this, "DESTROY PENDING", e);
|
||||||
|
}
|
||||||
|
mPendingDestroySurface.destroy();
|
||||||
|
}
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
Slog.w(WindowManagerService.TAG, "Exception thrown when destroying Window "
|
||||||
|
+ this + " surface " + mPendingDestroySurface
|
||||||
|
+ " session " + mSession + ": " + e.toString());
|
||||||
|
}
|
||||||
|
mSurfaceDestroyDeferred = false;
|
||||||
|
mPendingDestroySurface = null;
|
||||||
|
}
|
||||||
|
|
||||||
boolean finishDrawingLocked() {
|
boolean finishDrawingLocked() {
|
||||||
if (mDrawPending) {
|
if (mDrawPending) {
|
||||||
if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) Slog.v(
|
if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) Slog.v(
|
||||||
@@ -977,6 +1023,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
mAnimation.cancel();
|
mAnimation.cancel();
|
||||||
mAnimation = null;
|
mAnimation = null;
|
||||||
}
|
}
|
||||||
|
if (mService.mWindowDetachedWallpaper == this) {
|
||||||
|
mService.mWindowDetachedWallpaper = null;
|
||||||
|
}
|
||||||
mAnimLayer = mLayer;
|
mAnimLayer = mLayer;
|
||||||
if (mIsImWindow) {
|
if (mIsImWindow) {
|
||||||
mAnimLayer += mService.mInputMethodAnimLayerAdjustment;
|
mAnimLayer += mService.mInputMethodAnimLayerAdjustment;
|
||||||
@@ -1415,6 +1464,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(WindowManagerService.TAG, "Removing " + this + " from " + mAttachedWindow);
|
if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(WindowManagerService.TAG, "Removing " + this + " from " + mAttachedWindow);
|
||||||
mAttachedWindow.mChildWindows.remove(this);
|
mAttachedWindow.mChildWindows.remove(this);
|
||||||
}
|
}
|
||||||
|
destroyDeferredSurfaceLocked();
|
||||||
destroySurfaceLocked();
|
destroySurfaceLocked();
|
||||||
mSession.windowRemovedLocked();
|
mSession.windowRemovedLocked();
|
||||||
try {
|
try {
|
||||||
@@ -1612,6 +1662,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
pw.print(") "); pw.print(mSurfaceW);
|
pw.print(") "); pw.print(mSurfaceW);
|
||||||
pw.print(" x "); pw.println(mSurfaceH);
|
pw.print(" x "); pw.println(mSurfaceH);
|
||||||
}
|
}
|
||||||
|
if (mPendingDestroySurface != null) {
|
||||||
|
pw.print(prefix); pw.print("mPendingDestroySurface=");
|
||||||
|
pw.println(mPendingDestroySurface);
|
||||||
|
}
|
||||||
if (dumpAll) {
|
if (dumpAll) {
|
||||||
pw.print(prefix); pw.print("mToken="); pw.println(mToken);
|
pw.print(prefix); pw.print("mToken="); pw.println(mToken);
|
||||||
pw.print(prefix); pw.print("mRootToken="); pw.println(mRootToken);
|
pw.print(prefix); pw.print("mRootToken="); pw.println(mRootToken);
|
||||||
@@ -1640,6 +1694,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
if (!mRelayoutCalled) {
|
if (!mRelayoutCalled) {
|
||||||
pw.print(prefix); pw.print("mRelayoutCalled="); pw.println(mRelayoutCalled);
|
pw.print(prefix); pw.print("mRelayoutCalled="); pw.println(mRelayoutCalled);
|
||||||
}
|
}
|
||||||
|
if (mSurfaceResized || mSurfaceDestroyDeferred) {
|
||||||
|
pw.print(prefix); pw.print("mSurfaceResized="); pw.print(mSurfaceResized);
|
||||||
|
pw.print(" mSurfaceDestroyDeferred="); pw.println(mSurfaceDestroyDeferred);
|
||||||
|
}
|
||||||
if (mXOffset != 0 || mYOffset != 0) {
|
if (mXOffset != 0 || mYOffset != 0) {
|
||||||
pw.print(prefix); pw.print("Offsets x="); pw.print(mXOffset);
|
pw.print(prefix); pw.print("Offsets x="); pw.print(mXOffset);
|
||||||
pw.print(" y="); pw.println(mYOffset);
|
pw.print(" y="); pw.println(mYOffset);
|
||||||
|
|||||||
@@ -79,12 +79,16 @@ public final class BridgeWindowSession implements IWindowSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int relayout(IWindow arg0, int seq, LayoutParams arg1, int arg2, int arg3, int arg4,
|
public int relayout(IWindow arg0, int seq, LayoutParams arg1, int arg2, int arg3, int arg4,
|
||||||
boolean arg4_5, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b, Surface arg8)
|
int arg4_5, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b, Surface arg8)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// pass for now.
|
// pass for now.
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void performDeferredDestroy(IWindow window) {
|
||||||
|
// pass for now.
|
||||||
|
}
|
||||||
|
|
||||||
public boolean outOfMemory(IWindow window) throws RemoteException {
|
public boolean outOfMemory(IWindow window) throws RemoteException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user