am f4b40de6: Merge "Fix issue #5445966: WindowManager reporting -long on prime when it shouldn\'t be." into ics-mr0

* commit 'f4b40de684b3574475205542f22b2d49a75f31eb':
  Fix issue #5445966: WindowManager reporting -long on prime when it shouldn't be.
This commit is contained in:
Dianne Hackborn
2011-10-12 17:06:27 -07:00
committed by Android Git Automerger
6 changed files with 43 additions and 23 deletions

View File

@@ -117,6 +117,11 @@ public class Display {
outSize.x = getRawWidth(); outSize.x = getRawWidth();
outSize.y = getRawHeight(); outSize.y = getRawHeight();
} }
if (false) {
RuntimeException here = new RuntimeException("here");
here.fillInStackTrace();
Slog.v(TAG, "Returning display size: " + outSize, here);
}
if (DEBUG_DISPLAY_SIZE && doCompat) Slog.v( if (DEBUG_DISPLAY_SIZE && doCompat) Slog.v(
TAG, "Returning display size: " + outSize); TAG, "Returning display size: " + outSize);
} catch (RemoteException e) { } catch (RemoteException e) {

View File

@@ -274,7 +274,8 @@ class DragState {
final int myPid = Process.myPid(); final int myPid = Process.myPid();
// Move the surface to the given touch // Move the surface to the given touch
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, ">>> OPEN TRANSACTION notifyMoveLw"); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(
WindowManagerService.TAG, ">>> OPEN TRANSACTION notifyMoveLw");
Surface.openTransaction(); Surface.openTransaction();
try { try {
mSurface.setPosition(x - mThumbOffsetX, y - mThumbOffsetY); mSurface.setPosition(x - mThumbOffsetX, y - mThumbOffsetY);
@@ -283,7 +284,8 @@ class DragState {
(int)(x - mThumbOffsetX) + "," + (int)(y - mThumbOffsetY) + ")"); (int)(x - mThumbOffsetX) + "," + (int)(y - mThumbOffsetY) + ")");
} finally { } finally {
Surface.closeTransaction(); Surface.closeTransaction();
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION notifyMoveLw"); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(
WindowManagerService.TAG, "<<< CLOSE TRANSACTION notifyMoveLw");
} }
// Tell the affected window // Tell the affected window

View File

@@ -81,7 +81,7 @@ class ScreenRotationAnimation {
mOriginalHeight = originalHeight; mOriginalHeight = originalHeight;
if (!inTransaction) { if (!inTransaction) {
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
">>> OPEN TRANSACTION ScreenRotationAnimation"); ">>> OPEN TRANSACTION ScreenRotationAnimation");
Surface.openTransaction(); Surface.openTransaction();
} }
@@ -117,7 +117,7 @@ class ScreenRotationAnimation {
mSurface = null; mSurface = null;
return; return;
} }
Paint paint = new Paint(0); Paint paint = new Paint(0);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
c.drawBitmap(screenshot, 0, 0, paint); c.drawBitmap(screenshot, 0, 0, paint);
@@ -127,7 +127,7 @@ class ScreenRotationAnimation {
} finally { } finally {
if (!inTransaction) { if (!inTransaction) {
Surface.closeTransaction(); Surface.closeTransaction();
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
"<<< CLOSE TRANSACTION ScreenRotationAnimation"); "<<< CLOSE TRANSACTION ScreenRotationAnimation");
} }
@@ -254,7 +254,7 @@ class ScreenRotationAnimation {
mEnterAnimation.restrictDuration(maxAnimationDuration); mEnterAnimation.restrictDuration(maxAnimationDuration);
mEnterAnimation.scaleCurrentDuration(animationScale); mEnterAnimation.scaleCurrentDuration(animationScale);
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
">>> OPEN TRANSACTION ScreenRotationAnimation.dismiss"); ">>> OPEN TRANSACTION ScreenRotationAnimation.dismiss");
Surface.openTransaction(); Surface.openTransaction();
@@ -266,7 +266,7 @@ class ScreenRotationAnimation {
Slog.w(TAG, "Unable to allocate black surface", e); Slog.w(TAG, "Unable to allocate black surface", e);
} finally { } finally {
Surface.closeTransaction(); Surface.closeTransaction();
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
"<<< CLOSE TRANSACTION ScreenRotationAnimation.dismiss"); "<<< CLOSE TRANSACTION ScreenRotationAnimation.dismiss");
} }

View File

@@ -278,7 +278,8 @@ final class Session extends IWindowSession.Stub
// Make the surface visible at the proper location // Make the surface visible at the proper location
final Surface surface = mService.mDragState.mSurface; final Surface surface = mService.mDragState.mSurface;
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, ">>> OPEN TRANSACTION performDrag"); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(
WindowManagerService.TAG, ">>> OPEN TRANSACTION performDrag");
Surface.openTransaction(); Surface.openTransaction();
try { try {
surface.setPosition(touchX - thumbCenterX, surface.setPosition(touchX - thumbCenterX,
@@ -288,7 +289,8 @@ final class Session extends IWindowSession.Stub
surface.show(); surface.show();
} finally { } finally {
Surface.closeTransaction(); Surface.closeTransaction();
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION performDrag"); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(
WindowManagerService.TAG, "<<< CLOSE TRANSACTION performDrag");
} }
} }

View File

@@ -169,6 +169,7 @@ public class WindowManagerService extends IWindowManager.Stub
static final boolean DEBUG_SCREENSHOT = false; static final boolean DEBUG_SCREENSHOT = false;
static final boolean SHOW_SURFACE_ALLOC = false; static final boolean SHOW_SURFACE_ALLOC = false;
static final boolean SHOW_TRANSACTIONS = false; static final boolean SHOW_TRANSACTIONS = false;
static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS;
static final boolean HIDE_STACK_CRAWLS = true; static final boolean HIDE_STACK_CRAWLS = true;
static final boolean PROFILE_ORIENTATION = false; static final boolean PROFILE_ORIENTATION = false;
@@ -2369,7 +2370,7 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mWindowMap) { synchronized (mWindowMap) {
WindowState w = windowForClientLocked(session, client, false); WindowState w = windowForClientLocked(session, client, false);
if ((w != null) && (w.mSurface != null)) { if ((w != null) && (w.mSurface != null)) {
if (SHOW_TRANSACTIONS) Slog.i(TAG, if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
">>> OPEN TRANSACTION setTransparentRegion"); ">>> OPEN TRANSACTION setTransparentRegion");
Surface.openTransaction(); Surface.openTransaction();
try { try {
@@ -2378,7 +2379,7 @@ public class WindowManagerService extends IWindowManager.Stub
w.mSurface.setTransparentRegionHint(region); w.mSurface.setTransparentRegionHint(region);
} finally { } finally {
Surface.closeTransaction(); Surface.closeTransaction();
if (SHOW_TRANSACTIONS) Slog.i(TAG, if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
"<<< CLOSE TRANSACTION setTransparentRegion"); "<<< CLOSE TRANSACTION setTransparentRegion");
} }
} }
@@ -4905,7 +4906,8 @@ public class WindowManagerService extends IWindowManager.Stub
} }
} }
if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION showStrictModeViolation"); if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
">>> OPEN TRANSACTION showStrictModeViolation");
Surface.openTransaction(); Surface.openTransaction();
try { try {
if (mStrictModeFlash == null) { if (mStrictModeFlash == null) {
@@ -4914,7 +4916,8 @@ public class WindowManagerService extends IWindowManager.Stub
mStrictModeFlash.setVisibility(on); mStrictModeFlash.setVisibility(on);
} finally { } finally {
Surface.closeTransaction(); Surface.closeTransaction();
if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION showStrictModeViolation"); if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
"<<< CLOSE TRANSACTION showStrictModeViolation");
} }
} }
} }
@@ -5231,7 +5234,7 @@ public class WindowManagerService extends IWindowManager.Stub
mInputManager.setDisplayOrientation(0, rotation); mInputManager.setDisplayOrientation(0, rotation);
if (!inTransaction) { if (!inTransaction) {
if (SHOW_TRANSACTIONS) Slog.i(TAG, if (SHOW_TRANSACTIONS) Slog.i(TAG,
">>> OPEN TRANSACTION setRotationUnchecked"); ">>> OPEN TRANSACTION setRotationUnchecked");
Surface.openTransaction(); Surface.openTransaction();
} }
@@ -5246,7 +5249,7 @@ public class WindowManagerService extends IWindowManager.Stub
} finally { } finally {
if (!inTransaction) { if (!inTransaction) {
Surface.closeTransaction(); Surface.closeTransaction();
if (SHOW_TRANSACTIONS) Slog.i(TAG, if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
"<<< CLOSE TRANSACTION setRotationUnchecked"); "<<< CLOSE TRANSACTION setRotationUnchecked");
} }
} }
@@ -5843,6 +5846,10 @@ public class WindowManagerService extends IWindowManager.Stub
final DisplayMetrics dm = mDisplayMetrics; final DisplayMetrics dm = mDisplayMetrics;
mAppDisplayWidth = mPolicy.getNonDecorDisplayWidth(dw, dh, mRotation); mAppDisplayWidth = mPolicy.getNonDecorDisplayWidth(dw, dh, mRotation);
mAppDisplayHeight = mPolicy.getNonDecorDisplayHeight(dw, dh, mRotation); mAppDisplayHeight = mPolicy.getNonDecorDisplayHeight(dw, dh, mRotation);
if (false) {
Slog.i(TAG, "Set app display size: " + mAppDisplayWidth
+ " x " + mAppDisplayHeight);
}
mDisplay.getMetricsWithSize(dm, mAppDisplayWidth, mAppDisplayHeight); mDisplay.getMetricsWithSize(dm, mAppDisplayWidth, mAppDisplayHeight);
mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(dm, mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(dm,
@@ -5860,8 +5867,8 @@ public class WindowManagerService extends IWindowManager.Stub
// Compute the screen layout size class. // Compute the screen layout size class.
int screenLayout; int screenLayout;
int longSize = dw; int longSize = mAppDisplayWidth;
int shortSize = dh; int shortSize = mAppDisplayHeight;
if (longSize < shortSize) { if (longSize < shortSize) {
int tmp = longSize; int tmp = longSize;
longSize = shortSize; longSize = shortSize;
@@ -6847,7 +6854,7 @@ public class WindowManagerService extends IWindowManager.Stub
private void rebuildBlackFrame(boolean inTransaction) { private void rebuildBlackFrame(boolean inTransaction) {
if (!inTransaction) { if (!inTransaction) {
if (SHOW_TRANSACTIONS) Slog.i(TAG, if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
">>> OPEN TRANSACTION rebuildBlackFrame"); ">>> OPEN TRANSACTION rebuildBlackFrame");
Surface.openTransaction(); Surface.openTransaction();
} }
@@ -6882,7 +6889,7 @@ public class WindowManagerService extends IWindowManager.Stub
} finally { } finally {
if (!inTransaction) { if (!inTransaction) {
Surface.closeTransaction(); Surface.closeTransaction();
if (SHOW_TRANSACTIONS) Slog.i(TAG, if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
"<<< CLOSE TRANSACTION rebuildBlackFrame"); "<<< CLOSE TRANSACTION rebuildBlackFrame");
} }
} }
@@ -7354,7 +7361,8 @@ public class WindowManagerService extends IWindowManager.Stub
createWatermark = true; createWatermark = true;
} }
if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces"); if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces");
Surface.openTransaction(); Surface.openTransaction();
@@ -8463,7 +8471,8 @@ public class WindowManagerService extends IWindowManager.Stub
Surface.closeTransaction(); Surface.closeTransaction();
if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION performLayoutAndPlaceSurfaces"); if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
"<<< CLOSE TRANSACTION performLayoutAndPlaceSurfaces");
if (mWatermark != null) { if (mWatermark != null) {
mWatermark.drawIfNeeded(); mWatermark.drawIfNeeded();

View File

@@ -57,6 +57,7 @@ import java.util.ArrayList;
final class WindowState implements WindowManagerPolicy.WindowState { final class WindowState implements WindowManagerPolicy.WindowState {
static final boolean DEBUG_VISIBILITY = WindowManagerService.DEBUG_VISIBILITY; static final boolean DEBUG_VISIBILITY = WindowManagerService.DEBUG_VISIBILITY;
static final boolean SHOW_TRANSACTIONS = WindowManagerService.SHOW_TRANSACTIONS; static final boolean SHOW_TRANSACTIONS = WindowManagerService.SHOW_TRANSACTIONS;
static final boolean SHOW_LIGHT_TRANSACTIONS = WindowManagerService.SHOW_LIGHT_TRANSACTIONS;
static final boolean SHOW_SURFACE_ALLOC = WindowManagerService.SHOW_SURFACE_ALLOC; static final boolean SHOW_SURFACE_ALLOC = WindowManagerService.SHOW_SURFACE_ALLOC;
final WindowManagerService mService; final WindowManagerService mService;
@@ -671,7 +672,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
WindowManagerService.TAG, "Got surface: " + mSurface WindowManagerService.TAG, "Got surface: " + mSurface
+ ", set left=" + mFrame.left + " top=" + mFrame.top + ", set left=" + mFrame.left + " top=" + mFrame.top
+ ", animLayer=" + mAnimLayer); + ", animLayer=" + mAnimLayer);
if (SHOW_TRANSACTIONS) { if (SHOW_LIGHT_TRANSACTIONS) {
Slog.i(WindowManagerService.TAG, ">>> OPEN TRANSACTION createSurfaceLocked"); Slog.i(WindowManagerService.TAG, ">>> OPEN TRANSACTION createSurfaceLocked");
WindowManagerService.logSurface(this, "CREATE pos=(" + mFrame.left WindowManagerService.logSurface(this, "CREATE pos=(" + mFrame.left
+ "," + mFrame.top + ") (" + + "," + mFrame.top + ") (" +
@@ -700,7 +701,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mLastHidden = true; mLastHidden = true;
} finally { } finally {
Surface.closeTransaction(); Surface.closeTransaction();
if (SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION createSurfaceLocked"); if (SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
"<<< CLOSE TRANSACTION createSurfaceLocked");
} }
if (WindowManagerService.localLOGV) Slog.v( if (WindowManagerService.localLOGV) Slog.v(
WindowManagerService.TAG, "Created surface " + this); WindowManagerService.TAG, "Created surface " + this);