Merge change 24099 into eclair
* changes: Fix issue #2095422: Some fades from opaque to transparent don't work
This commit is contained in:
@@ -377,6 +377,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
if (!mCreated) {
|
if (!mCreated) {
|
||||||
mLayout.type = mIWallpaperEngine.mWindowType;
|
mLayout.type = mIWallpaperEngine.mWindowType;
|
||||||
mLayout.gravity = Gravity.LEFT|Gravity.TOP;
|
mLayout.gravity = Gravity.LEFT|Gravity.TOP;
|
||||||
|
mLayout.setTitle(WallpaperService.this.getClass().getName());
|
||||||
mLayout.windowAnimations =
|
mLayout.windowAnimations =
|
||||||
com.android.internal.R.style.Animation_Wallpaper;
|
com.android.internal.R.style.Animation_Wallpaper;
|
||||||
mSession.add(mWindow, mLayout, View.VISIBLE, mContentInsets);
|
mSession.add(mWindow, mLayout, View.VISIBLE, mContentInsets);
|
||||||
@@ -558,7 +559,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
mSession.remove(mWindow);
|
mSession.remove(mWindow);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
mSurfaceHolder.mSurface.clear();
|
mSurfaceHolder.mSurface.release();
|
||||||
mCreated = false;
|
mCreated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class Surface implements Parcelable {
|
|||||||
public Surface(SurfaceSession s,
|
public Surface(SurfaceSession s,
|
||||||
int pid, int display, int w, int h, int format, int flags)
|
int pid, int display, int w, int h, int format, int flags)
|
||||||
throws OutOfResourcesException {
|
throws OutOfResourcesException {
|
||||||
mCanvas = new Canvas();
|
mCanvas = new CompatibleCanvas();
|
||||||
init(s,pid,display,w,h,format,flags);
|
init(s,pid,display,w,h,format,flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,8 +271,12 @@ public class Surface implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public native boolean isValid();
|
public native boolean isValid();
|
||||||
|
|
||||||
/** Call this free the surface up. {@hide} */
|
/** Free all server-side state associated with this surface and
|
||||||
public native void clear();
|
* release this object's reference. {@hide} */
|
||||||
|
public native void destroy();
|
||||||
|
|
||||||
|
/** Release the local reference to the server-side surface. @hide */
|
||||||
|
public native void release();
|
||||||
|
|
||||||
/** draw into a surface */
|
/** draw into a surface */
|
||||||
public Canvas lockCanvas(Rect dirty) throws OutOfResourcesException, IllegalArgumentException
|
public Canvas lockCanvas(Rect dirty) throws OutOfResourcesException, IllegalArgumentException
|
||||||
@@ -400,6 +404,4 @@ public class Surface implements Parcelable {
|
|||||||
throws OutOfResourcesException;
|
throws OutOfResourcesException;
|
||||||
|
|
||||||
private native void init(Parcel source);
|
private native void init(Parcel source);
|
||||||
|
|
||||||
private native void release();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1575,7 +1575,7 @@ public final class ViewRoot extends Handler implements ViewParent,
|
|||||||
if (mUseGL) {
|
if (mUseGL) {
|
||||||
destroyGL();
|
destroyGL();
|
||||||
}
|
}
|
||||||
mSurface.clear();
|
mSurface.release();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sWindowSession.remove(mWindow);
|
sWindowSession.remove(mWindow);
|
||||||
@@ -2532,7 +2532,7 @@ public final class ViewRoot extends Handler implements ViewParent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mSurface.clear();
|
mSurface.release();
|
||||||
}
|
}
|
||||||
if (mAdded) {
|
if (mAdded) {
|
||||||
mAdded = false;
|
mAdded = false;
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ static void Surface_initParcel(JNIEnv* env, jobject clazz, jobject argParcel)
|
|||||||
setSurface(env, clazz, rhs);
|
setSurface(env, clazz, rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Surface_clear(JNIEnv* env, jobject clazz, uintptr_t *ostack)
|
static void Surface_destroy(JNIEnv* env, jobject clazz, uintptr_t *ostack)
|
||||||
{
|
{
|
||||||
const sp<SurfaceControl>& surface(getSurfaceControl(env, clazz));
|
const sp<SurfaceControl>& surface(getSurfaceControl(env, clazz));
|
||||||
if (SurfaceControl::isValid(surface)) {
|
if (SurfaceControl::isValid(surface)) {
|
||||||
@@ -622,7 +622,7 @@ static JNINativeMethod gSurfaceMethods[] = {
|
|||||||
{"nativeClassInit", "()V", (void*)nativeClassInit },
|
{"nativeClassInit", "()V", (void*)nativeClassInit },
|
||||||
{"init", "(Landroid/view/SurfaceSession;IIIIII)V", (void*)Surface_init },
|
{"init", "(Landroid/view/SurfaceSession;IIIIII)V", (void*)Surface_init },
|
||||||
{"init", "(Landroid/os/Parcel;)V", (void*)Surface_initParcel },
|
{"init", "(Landroid/os/Parcel;)V", (void*)Surface_initParcel },
|
||||||
{"clear", "()V", (void*)Surface_clear },
|
{"destroy", "()V", (void*)Surface_destroy },
|
||||||
{"release", "()V", (void*)Surface_release },
|
{"release", "()V", (void*)Surface_release },
|
||||||
{"copyFrom", "(Landroid/view/Surface;)V", (void*)Surface_copyFrom },
|
{"copyFrom", "(Landroid/view/Surface;)V", (void*)Surface_copyFrom },
|
||||||
{"isValid", "()Z", (void*)Surface_isValid },
|
{"isValid", "()Z", (void*)Surface_isValid },
|
||||||
|
|||||||
@@ -1207,8 +1207,11 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|| mLowerWallpaperTarget != null;
|
|| mLowerWallpaperTarget != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean adjustWallpaperWindowsLocked() {
|
static final int ADJUST_WALLPAPER_LAYERS_CHANGED = 1<<1;
|
||||||
boolean changed = false;
|
static final int ADJUST_WALLPAPER_VISIBILITY_CHANGED = 1<<2;
|
||||||
|
|
||||||
|
int adjustWallpaperWindowsLocked() {
|
||||||
|
int changed = 0;
|
||||||
|
|
||||||
final int dw = mDisplay.getWidth();
|
final int dw = mDisplay.getWidth();
|
||||||
final int dh = mDisplay.getHeight();
|
final int dh = mDisplay.getHeight();
|
||||||
@@ -1274,12 +1277,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (mWallpaperTarget != null && mWallpaperTarget.mAppToken != null) {
|
if (mWallpaperTarget != null && mWallpaperTarget.mAppToken != null) {
|
||||||
if (DEBUG_WALLPAPER) Log.v(TAG,
|
if (DEBUG_WALLPAPER) Log.v(TAG,
|
||||||
"Wallpaper not changing: waiting for app anim in current target");
|
"Wallpaper not changing: waiting for app anim in current target");
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
if (foundW != null && foundW.mAppToken != null) {
|
if (foundW != null && foundW.mAppToken != null) {
|
||||||
if (DEBUG_WALLPAPER) Log.v(TAG,
|
if (DEBUG_WALLPAPER) Log.v(TAG,
|
||||||
"Wallpaper not changing: waiting for app anim in found target");
|
"Wallpaper not changing: waiting for app anim in found target");
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1410,7 +1413,13 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
while (curTokenIndex > 0) {
|
while (curTokenIndex > 0) {
|
||||||
curTokenIndex--;
|
curTokenIndex--;
|
||||||
WindowToken token = mWallpaperTokens.get(curTokenIndex);
|
WindowToken token = mWallpaperTokens.get(curTokenIndex);
|
||||||
token.hidden = !visible;
|
if (token.hidden == visible) {
|
||||||
|
changed |= ADJUST_WALLPAPER_VISIBILITY_CHANGED;
|
||||||
|
token.hidden = !visible;
|
||||||
|
// Need to do a layout to ensure the wallpaper now has the
|
||||||
|
// correct size.
|
||||||
|
mLayoutNeeded = true;
|
||||||
|
}
|
||||||
|
|
||||||
int curWallpaperIndex = token.windows.size();
|
int curWallpaperIndex = token.windows.size();
|
||||||
while (curWallpaperIndex > 0) {
|
while (curWallpaperIndex > 0) {
|
||||||
@@ -1463,7 +1472,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
+ " from " + oldIndex + " to " + foundI);
|
+ " from " + oldIndex + " to " + foundI);
|
||||||
|
|
||||||
localmWindows.add(foundI, wallpaper);
|
localmWindows.add(foundI, wallpaper);
|
||||||
changed = true;
|
changed |= ADJUST_WALLPAPER_LAYERS_CHANGED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1574,7 +1583,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
while (curTokenIndex > 0) {
|
while (curTokenIndex > 0) {
|
||||||
curTokenIndex--;
|
curTokenIndex--;
|
||||||
WindowToken token = mWallpaperTokens.get(curTokenIndex);
|
WindowToken token = mWallpaperTokens.get(curTokenIndex);
|
||||||
token.hidden = !visible;
|
if (token.hidden == visible) {
|
||||||
|
token.hidden = !visible;
|
||||||
|
// Need to do a layout to ensure the wallpaper now has the
|
||||||
|
// correct size.
|
||||||
|
mLayoutNeeded = true;
|
||||||
|
}
|
||||||
|
|
||||||
int curWallpaperIndex = token.windows.size();
|
int curWallpaperIndex = token.windows.size();
|
||||||
while (curWallpaperIndex > 0) {
|
while (curWallpaperIndex > 0) {
|
||||||
@@ -1999,10 +2013,15 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
synchronized (mWindowMap) {
|
synchronized (mWindowMap) {
|
||||||
WindowState w = windowForClientLocked(session, client);
|
WindowState w = windowForClientLocked(session, client);
|
||||||
if ((w != null) && (w.mSurface != null)) {
|
if ((w != null) && (w.mSurface != null)) {
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(TAG, ">>> OPEN TRANSACTION");
|
||||||
Surface.openTransaction();
|
Surface.openTransaction();
|
||||||
try {
|
try {
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(
|
||||||
|
TAG, " SURFACE " + w.mSurface
|
||||||
|
+ ": transparentRegionHint=" + region);
|
||||||
w.mSurface.setTransparentRegionHint(region);
|
w.mSurface.setTransparentRegionHint(region);
|
||||||
} finally {
|
} finally {
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(TAG, "<<< CLOSE TRANSACTION");
|
||||||
Surface.closeTransaction();
|
Surface.closeTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2149,13 +2168,17 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
Surface surface = win.createSurfaceLocked();
|
Surface surface = win.createSurfaceLocked();
|
||||||
if (surface != null) {
|
if (surface != null) {
|
||||||
outSurface.copyFrom(surface);
|
outSurface.copyFrom(surface);
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(TAG,
|
||||||
|
" OUT SURFACE " + outSurface + ": copied");
|
||||||
} else {
|
} else {
|
||||||
outSurface.clear();
|
// For some reason there isn't a surface. Clear the
|
||||||
|
// caller's object so they see the same state.
|
||||||
|
outSurface.release();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Exception thrown when creating surface for client "
|
Log.w(TAG, "Exception thrown when creating surface for client "
|
||||||
+ client + " (" + win.mAttrs.getTitle() + ")",
|
+ client + " (" + win.mAttrs.getTitle() + ")",
|
||||||
e);
|
e);
|
||||||
Binder.restoreCallingIdentity(origId);
|
Binder.restoreCallingIdentity(origId);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2196,7 +2219,11 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outSurface.clear();
|
// We are being called from a local process, which
|
||||||
|
// means outSurface holds its current surface. Ensure the
|
||||||
|
// surface object is cleared, but we don't want it actually
|
||||||
|
// destroyed at this point.
|
||||||
|
outSurface.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (focusMayChange) {
|
if (focusMayChange) {
|
||||||
@@ -2217,7 +2244,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wallpaperMayMove) {
|
if (wallpaperMayMove) {
|
||||||
if (adjustWallpaperWindowsLocked()) {
|
if ((adjustWallpaperWindowsLocked()&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
|
||||||
assignLayers = true;
|
assignLayers = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6281,6 +6308,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (localLOGV) Log.v(
|
if (localLOGV) Log.v(
|
||||||
TAG, "First window added to " + this + ", creating SurfaceSession");
|
TAG, "First window added to " + this + ", creating SurfaceSession");
|
||||||
mSurfaceSession = new SurfaceSession();
|
mSurfaceSession = new SurfaceSession();
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(
|
||||||
|
TAG, " NEW SURFACE SESSION " + mSurfaceSession);
|
||||||
mSessions.add(this);
|
mSessions.add(this);
|
||||||
}
|
}
|
||||||
mNumWindow++;
|
mNumWindow++;
|
||||||
@@ -6298,6 +6327,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (localLOGV) Log.v(
|
if (localLOGV) Log.v(
|
||||||
TAG, "Last window removed from " + this
|
TAG, "Last window removed from " + this
|
||||||
+ ", destroying " + mSurfaceSession);
|
+ ", destroying " + mSurfaceSession);
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(
|
||||||
|
TAG, " KILL SURFACE SESSION " + mSurfaceSession);
|
||||||
try {
|
try {
|
||||||
mSurfaceSession.kill();
|
mSurfaceSession.kill();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -6794,6 +6825,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mSurface = new Surface(
|
mSurface = new Surface(
|
||||||
mSession.mSurfaceSession, mSession.mPid,
|
mSession.mSurfaceSession, mSession.mPid,
|
||||||
0, w, h, mAttrs.format, flags);
|
0, w, h, mAttrs.format, flags);
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(TAG, " CREATE SURFACE "
|
||||||
|
+ mSurface + " IN SESSION "
|
||||||
|
+ mSession.mSurfaceSession
|
||||||
|
+ ": pid=" + mSession.mPid + " format="
|
||||||
|
+ mAttrs.format + " flags=0x"
|
||||||
|
+ Integer.toHexString(flags));
|
||||||
} catch (Surface.OutOfResourcesException e) {
|
} catch (Surface.OutOfResourcesException e) {
|
||||||
Log.w(TAG, "OutOfResourcesException creating surface");
|
Log.w(TAG, "OutOfResourcesException creating surface");
|
||||||
reclaimSomeSurfaceMemoryLocked(this, "create");
|
reclaimSomeSurfaceMemoryLocked(this, "create");
|
||||||
@@ -6823,6 +6860,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mSurface.setLayer(mAnimLayer);
|
mSurface.setLayer(mAnimLayer);
|
||||||
mSurface.hide();
|
mSurface.hide();
|
||||||
if ((mAttrs.flags&WindowManager.LayoutParams.FLAG_DITHER) != 0) {
|
if ((mAttrs.flags&WindowManager.LayoutParams.FLAG_DITHER) != 0) {
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(TAG, " SURFACE "
|
||||||
|
+ mSurface + ": DITHER");
|
||||||
mSurface.setFlags(Surface.SURFACE_DITHER,
|
mSurface.setFlags(Surface.SURFACE_DITHER,
|
||||||
Surface.SURFACE_DITHER);
|
Surface.SURFACE_DITHER);
|
||||||
}
|
}
|
||||||
@@ -6868,7 +6907,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
Log.i(TAG, " SURFACE " + mSurface + ": DESTROY ("
|
Log.i(TAG, " SURFACE " + mSurface + ": DESTROY ("
|
||||||
+ mAttrs.getTitle() + ")", ex);
|
+ mAttrs.getTitle() + ")", ex);
|
||||||
}
|
}
|
||||||
mSurface.clear();
|
mSurface.destroy();
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
Log.w(TAG, "Exception thrown when destroying Window " + this
|
Log.w(TAG, "Exception thrown when destroying Window " + this
|
||||||
+ " surface " + mSurface + " session " + mSession
|
+ " surface " + mSurface + " session " + mSession
|
||||||
@@ -8840,6 +8879,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (w.commitFinishDrawingLocked(currentTime)) {
|
if (w.commitFinishDrawingLocked(currentTime)) {
|
||||||
if ((w.mAttrs.flags
|
if ((w.mAttrs.flags
|
||||||
& WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
|
& WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
|
||||||
|
if (DEBUG_WALLPAPER) Log.v(TAG,
|
||||||
|
"First draw done in potential wallpaper target " + w);
|
||||||
wallpaperMayChange = true;
|
wallpaperMayChange = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9134,10 +9175,23 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wallpaperMayChange) {
|
if (wallpaperMayChange) {
|
||||||
if (adjustWallpaperWindowsLocked()) {
|
if (DEBUG_WALLPAPER) Log.v(TAG,
|
||||||
|
"Wallpaper may change! Adjusting");
|
||||||
|
int adjResult = adjustWallpaperWindowsLocked();
|
||||||
|
if ((adjResult&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
|
||||||
|
if (DEBUG_WALLPAPER) Log.v(TAG,
|
||||||
|
"Wallpaper layer changed: assigning layers + relayout");
|
||||||
|
restart = true;
|
||||||
|
mLayoutNeeded = true;
|
||||||
assignLayersLocked();
|
assignLayersLocked();
|
||||||
|
} else if ((adjResult&ADJUST_WALLPAPER_VISIBILITY_CHANGED) != 0) {
|
||||||
|
if (DEBUG_WALLPAPER) Log.v(TAG,
|
||||||
|
"Wallpaper visibility changed: relayout");
|
||||||
|
restart = true;
|
||||||
|
mLayoutNeeded = true;
|
||||||
}
|
}
|
||||||
if (mLayoutNeeded) {
|
if (mLayoutNeeded) {
|
||||||
|
restart = true;
|
||||||
performLayoutLockedInner();
|
performLayoutLockedInner();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9184,6 +9238,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.mLastRequestedHeight = height;
|
w.mLastRequestedHeight = height;
|
||||||
w.mLastShownFrame.set(w.mShownFrame);
|
w.mLastShownFrame.set(w.mShownFrame);
|
||||||
try {
|
try {
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(
|
||||||
|
TAG, " SURFACE " + w.mSurface
|
||||||
|
+ ": POS " + w.mShownFrame.left
|
||||||
|
+ ", " + w.mShownFrame.top);
|
||||||
w.mSurface.setPosition(w.mShownFrame.left, w.mShownFrame.top);
|
w.mSurface.setPosition(w.mShownFrame.left, w.mShownFrame.top);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
Log.w(TAG, "Error positioning surface in " + w, e);
|
Log.w(TAG, "Error positioning surface in " + w, e);
|
||||||
@@ -9196,14 +9254,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
width = w.mShownFrame.width();
|
width = w.mShownFrame.width();
|
||||||
height = w.mShownFrame.height();
|
height = w.mShownFrame.height();
|
||||||
w.mLastShownFrame.set(w.mShownFrame);
|
w.mLastShownFrame.set(w.mShownFrame);
|
||||||
if (resize) {
|
|
||||||
if (SHOW_TRANSACTIONS) Log.i(
|
|
||||||
TAG, " SURFACE " + w.mSurface + ": ("
|
|
||||||
+ w.mShownFrame.left + ","
|
|
||||||
+ w.mShownFrame.top + ") ("
|
|
||||||
+ w.mShownFrame.width() + "x"
|
|
||||||
+ w.mShownFrame.height() + ")");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resize) {
|
if (resize) {
|
||||||
@@ -9211,6 +9261,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (height < 1) height = 1;
|
if (height < 1) height = 1;
|
||||||
if (w.mSurface != null) {
|
if (w.mSurface != null) {
|
||||||
try {
|
try {
|
||||||
|
if (SHOW_TRANSACTIONS) Log.i(
|
||||||
|
TAG, " SURFACE " + w.mSurface + ": POS "
|
||||||
|
+ w.mShownFrame.left + ","
|
||||||
|
+ w.mShownFrame.top + " SIZE "
|
||||||
|
+ w.mShownFrame.width() + "x"
|
||||||
|
+ w.mShownFrame.height());
|
||||||
w.mSurface.setSize(width, height);
|
w.mSurface.setSize(width, height);
|
||||||
w.mSurface.setPosition(w.mShownFrame.left,
|
w.mSurface.setPosition(w.mShownFrame.left,
|
||||||
w.mShownFrame.top);
|
w.mShownFrame.top);
|
||||||
@@ -9239,6 +9295,22 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.mLastFrame.set(w.mFrame);
|
w.mLastFrame.set(w.mFrame);
|
||||||
w.mLastContentInsets.set(w.mContentInsets);
|
w.mLastContentInsets.set(w.mContentInsets);
|
||||||
w.mLastVisibleInsets.set(w.mVisibleInsets);
|
w.mLastVisibleInsets.set(w.mVisibleInsets);
|
||||||
|
// If the screen is currently frozen, then keep
|
||||||
|
// it frozen until this window draws at its new
|
||||||
|
// orientation.
|
||||||
|
if (mDisplayFrozen) {
|
||||||
|
if (DEBUG_ORIENTATION) Log.v(TAG,
|
||||||
|
"Resizing while display frozen: " + w);
|
||||||
|
w.mOrientationChanging = true;
|
||||||
|
if (mWindowsFreezingScreen) {
|
||||||
|
mWindowsFreezingScreen = true;
|
||||||
|
// XXX should probably keep timeout from
|
||||||
|
// when we first froze the display.
|
||||||
|
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
||||||
|
mH.sendMessageDelayed(mH.obtainMessage(
|
||||||
|
H.WINDOW_FREEZE_TIMEOUT), 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
// If the orientation is changing, then we need to
|
// If the orientation is changing, then we need to
|
||||||
// hold off on unfreezing the display until this
|
// hold off on unfreezing the display until this
|
||||||
// window has been redrawn; to do that, we need
|
// window has been redrawn; to do that, we need
|
||||||
@@ -9340,7 +9412,11 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.mLastVScale = w.mVScale;
|
w.mLastVScale = w.mVScale;
|
||||||
if (SHOW_TRANSACTIONS) Log.i(
|
if (SHOW_TRANSACTIONS) Log.i(
|
||||||
TAG, " SURFACE " + w.mSurface + ": alpha="
|
TAG, " SURFACE " + w.mSurface + ": alpha="
|
||||||
+ w.mShownAlpha + " layer=" + w.mAnimLayer);
|
+ w.mShownAlpha + " layer=" + w.mAnimLayer
|
||||||
|
+ " matrix=[" + (w.mDsDx*w.mHScale)
|
||||||
|
+ "," + (w.mDtDx*w.mVScale)
|
||||||
|
+ "][" + (w.mDsDy*w.mHScale)
|
||||||
|
+ "," + (w.mDtDy*w.mVScale) + "]");
|
||||||
if (w.mSurface != null) {
|
if (w.mSurface != null) {
|
||||||
try {
|
try {
|
||||||
w.mSurface.setAlpha(w.mShownAlpha);
|
w.mSurface.setAlpha(w.mShownAlpha);
|
||||||
@@ -9571,6 +9647,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
i--;
|
i--;
|
||||||
WindowState win = mResizingWindows.get(i);
|
WindowState win = mResizingWindows.get(i);
|
||||||
try {
|
try {
|
||||||
|
if (DEBUG_ORIENTATION) Log.v(TAG, "Reporting new frame to "
|
||||||
|
+ win + ": " + win.mFrame);
|
||||||
win.mClient.resized(win.mFrame.width(),
|
win.mClient.resized(win.mFrame.width(),
|
||||||
win.mFrame.height(), win.mLastContentInsets,
|
win.mFrame.height(), win.mLastContentInsets,
|
||||||
win.mLastVisibleInsets, win.mDrawPending);
|
win.mLastVisibleInsets, win.mDrawPending);
|
||||||
@@ -9642,7 +9720,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mH.sendEmptyMessage(H.REPORT_LOSING_FOCUS);
|
mH.sendEmptyMessage(H.REPORT_LOSING_FOCUS);
|
||||||
}
|
}
|
||||||
if (wallpaperDestroyed) {
|
if (wallpaperDestroyed) {
|
||||||
needRelayout = adjustWallpaperWindowsLocked();
|
needRelayout = adjustWallpaperWindowsLocked() != 0;
|
||||||
}
|
}
|
||||||
if (needRelayout) {
|
if (needRelayout) {
|
||||||
requestAnimationLocked(0);
|
requestAnimationLocked(0);
|
||||||
@@ -9720,7 +9798,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
+ " token=" + win.mToken
|
+ " token=" + win.mToken
|
||||||
+ " pid=" + ws.mSession.mPid
|
+ " pid=" + ws.mSession.mPid
|
||||||
+ " uid=" + ws.mSession.mUid);
|
+ " uid=" + ws.mSession.mUid);
|
||||||
ws.mSurface.clear();
|
ws.mSurface.destroy();
|
||||||
ws.mSurface = null;
|
ws.mSurface = null;
|
||||||
mForceRemoves.add(ws);
|
mForceRemoves.add(ws);
|
||||||
i--;
|
i--;
|
||||||
@@ -9730,7 +9808,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
Log.w(TAG, "LEAKED SURFACE (app token hidden): "
|
Log.w(TAG, "LEAKED SURFACE (app token hidden): "
|
||||||
+ ws + " surface=" + ws.mSurface
|
+ ws + " surface=" + ws.mSurface
|
||||||
+ " token=" + win.mAppToken);
|
+ " token=" + win.mAppToken);
|
||||||
ws.mSurface.clear();
|
ws.mSurface.destroy();
|
||||||
ws.mSurface = null;
|
ws.mSurface = null;
|
||||||
leakedSurface = true;
|
leakedSurface = true;
|
||||||
}
|
}
|
||||||
@@ -9766,7 +9844,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// surface and ask the app to request another one.
|
// surface and ask the app to request another one.
|
||||||
Log.w(TAG, "Looks like we have reclaimed some memory, clearing surface for retry.");
|
Log.w(TAG, "Looks like we have reclaimed some memory, clearing surface for retry.");
|
||||||
if (surface != null) {
|
if (surface != null) {
|
||||||
surface.clear();
|
surface.destroy();
|
||||||
win.mSurface = null;
|
win.mSurface = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10025,6 +10103,16 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.dump(pw, " ");
|
w.dump(pw, " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mResizingWindows.size() > 0) {
|
||||||
|
pw.println(" ");
|
||||||
|
pw.println(" Windows waiting to resize:");
|
||||||
|
for (int i=mResizingWindows.size()-1; i>=0; i--) {
|
||||||
|
WindowState w = mResizingWindows.get(i);
|
||||||
|
pw.print(" Resizing #"); pw.print(i); pw.print(' ');
|
||||||
|
pw.print(w); pw.println(":");
|
||||||
|
w.dump(pw, " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (mSessions.size() > 0) {
|
if (mSessions.size() > 0) {
|
||||||
pw.println(" ");
|
pw.println(" ");
|
||||||
pw.println(" All active sessions:");
|
pw.println(" All active sessions:");
|
||||||
@@ -10227,7 +10315,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mDimSurface.setLayer(w.mAnimLayer-1);
|
mDimSurface.setLayer(w.mAnimLayer-1);
|
||||||
|
|
||||||
final float target = w.mExiting ? 0 : w.mAttrs.dimAmount;
|
final float target = w.mExiting ? 0 : w.mAttrs.dimAmount;
|
||||||
if (SHOW_TRANSACTIONS) Log.i(TAG, "layer=" + (w.mAnimLayer-1) + ", target=" + target);
|
if (SHOW_TRANSACTIONS) Log.i(TAG, " DIM " + mDimSurface
|
||||||
|
+ ": layer=" + (w.mAnimLayer-1) + " target=" + target);
|
||||||
if (mDimTargetAlpha != target) {
|
if (mDimTargetAlpha != target) {
|
||||||
// If the desired dim level has changed, then
|
// If the desired dim level has changed, then
|
||||||
// start an animation to it.
|
// start an animation to it.
|
||||||
|
|||||||
Reference in New Issue
Block a user