Merge "Reduce duration of rotation xfade animation." into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8f980e1a5a
@@ -18,6 +18,6 @@
|
|||||||
|
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
|
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
|
||||||
android:duration="500"
|
android:duration="150"
|
||||||
android:interpolator="@interpolator/decelerate_quad" />
|
android:interpolator="@interpolator/decelerate_quad" />
|
||||||
</set>
|
</set>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
import android.util.TimeUtils;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
@@ -30,6 +31,11 @@ public class AppWindowAnimator {
|
|||||||
// Protect with mAnimator.
|
// Protect with mAnimator.
|
||||||
boolean freezingScreen;
|
boolean freezingScreen;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How long we last kept the screen frozen.
|
||||||
|
*/
|
||||||
|
int lastFreezeDuration;
|
||||||
|
|
||||||
// Offset to the window of all layers in the token, for use by
|
// Offset to the window of all layers in the token, for use by
|
||||||
// AppWindowToken animations.
|
// AppWindowToken animations.
|
||||||
int animLayerAdjustment;
|
int animLayerAdjustment;
|
||||||
@@ -287,6 +293,10 @@ public class AppWindowAnimator {
|
|||||||
pw.print(prefix); pw.print("freezingScreen="); pw.print(freezingScreen);
|
pw.print(prefix); pw.print("freezingScreen="); pw.print(freezingScreen);
|
||||||
pw.print(" allDrawn="); pw.print(allDrawn);
|
pw.print(" allDrawn="); pw.print(allDrawn);
|
||||||
pw.print(" animLayerAdjustment="); pw.println(animLayerAdjustment);
|
pw.print(" animLayerAdjustment="); pw.println(animLayerAdjustment);
|
||||||
|
if (lastFreezeDuration != 0) {
|
||||||
|
pw.print(prefix); pw.print("lastFreezeDuration=");
|
||||||
|
TimeUtils.formatDuration(lastFreezeDuration, pw); pw.println();
|
||||||
|
}
|
||||||
if (animating || animation != null) {
|
if (animating || animation != null) {
|
||||||
pw.print(prefix); pw.print("animating="); pw.println(animating);
|
pw.print(prefix); pw.print("animating="); pw.println(animating);
|
||||||
pw.print(prefix); pw.print("animation="); pw.println(animation);
|
pw.print(prefix); pw.print("animation="); pw.println(animation);
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class WindowAnimator {
|
|||||||
int mAboveUniverseLayer = 0;
|
int mAboveUniverseLayer = 0;
|
||||||
|
|
||||||
int mBulkUpdateParams = 0;
|
int mBulkUpdateParams = 0;
|
||||||
|
Object mLastWindowFreezeSource;
|
||||||
|
|
||||||
SparseArray<DisplayContentsAnimator> mDisplayContentsAnimators =
|
SparseArray<DisplayContentsAnimator> mDisplayContentsAnimators =
|
||||||
new SparseArray<WindowAnimator.DisplayContentsAnimator>();
|
new SparseArray<WindowAnimator.DisplayContentsAnimator>();
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
|
|||||||
import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||||
|
|
||||||
import android.app.AppOpsManager;
|
import android.app.AppOpsManager;
|
||||||
|
import android.util.TimeUtils;
|
||||||
import android.view.IWindowId;
|
import android.view.IWindowId;
|
||||||
import com.android.internal.app.IBatteryStats;
|
import com.android.internal.app.IBatteryStats;
|
||||||
import com.android.internal.policy.PolicyManager;
|
import com.android.internal.policy.PolicyManager;
|
||||||
@@ -464,6 +465,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
boolean mTraversalScheduled = false;
|
boolean mTraversalScheduled = false;
|
||||||
boolean mDisplayFrozen = false;
|
boolean mDisplayFrozen = false;
|
||||||
|
long mDisplayFreezeTime = 0;
|
||||||
|
int mLastDisplayFreezeDuration = 0;
|
||||||
|
Object mLastFinishedFreezeSource = null;
|
||||||
boolean mWaitingForConfig = false;
|
boolean mWaitingForConfig = false;
|
||||||
boolean mWindowsFreezingScreen = false;
|
boolean mWindowsFreezingScreen = false;
|
||||||
boolean mClientFreezingScreen = false;
|
boolean mClientFreezingScreen = false;
|
||||||
@@ -582,6 +586,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
boolean mWallpaperForceHidingChanged = false;
|
boolean mWallpaperForceHidingChanged = false;
|
||||||
boolean mWallpaperMayChange = false;
|
boolean mWallpaperMayChange = false;
|
||||||
boolean mOrientationChangeComplete = true;
|
boolean mOrientationChangeComplete = true;
|
||||||
|
Object mLastWindowFreezeSource = null;
|
||||||
private Session mHoldScreen = null;
|
private Session mHoldScreen = null;
|
||||||
private boolean mObscured = false;
|
private boolean mObscured = false;
|
||||||
boolean mDimming = false;
|
boolean mDimming = false;
|
||||||
@@ -3590,7 +3595,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
synchronized(mWindowMap) {
|
synchronized(mWindowMap) {
|
||||||
mCurConfiguration = new Configuration(config);
|
mCurConfiguration = new Configuration(config);
|
||||||
mWaitingForConfig = false;
|
if (mWaitingForConfig) {
|
||||||
|
mWaitingForConfig = false;
|
||||||
|
mLastFinishedFreezeSource = "new-config";
|
||||||
|
}
|
||||||
performLayoutAndPlaceSurfacesLocked();
|
performLayoutAndPlaceSurfacesLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4209,6 +4217,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.mOrientationChanging = true;
|
w.mOrientationChanging = true;
|
||||||
mInnerFields.mOrientationChangeComplete = false;
|
mInnerFields.mOrientationChangeComplete = false;
|
||||||
}
|
}
|
||||||
|
w.mLastFreezeDuration = 0;
|
||||||
unfrozeWindows = true;
|
unfrozeWindows = true;
|
||||||
w.mDisplayContent.layoutNeeded = true;
|
w.mDisplayContent.layoutNeeded = true;
|
||||||
}
|
}
|
||||||
@@ -4216,7 +4225,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (force || unfrozeWindows) {
|
if (force || unfrozeWindows) {
|
||||||
if (DEBUG_ORIENTATION) Slog.v(TAG, "No longer freezing: " + wtoken);
|
if (DEBUG_ORIENTATION) Slog.v(TAG, "No longer freezing: " + wtoken);
|
||||||
wtoken.mAppAnimator.freezingScreen = false;
|
wtoken.mAppAnimator.freezingScreen = false;
|
||||||
|
wtoken.mAppAnimator.lastFreezeDuration = (int)(SystemClock.elapsedRealtime()
|
||||||
|
- mDisplayFreezeTime);
|
||||||
mAppsFreezingScreen--;
|
mAppsFreezingScreen--;
|
||||||
|
mLastFinishedFreezeSource = wtoken;
|
||||||
}
|
}
|
||||||
if (unfreezeSurfaceNow) {
|
if (unfreezeSurfaceNow) {
|
||||||
if (unfrozeWindows) {
|
if (unfrozeWindows) {
|
||||||
@@ -4242,6 +4254,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (!wtoken.hiddenRequested) {
|
if (!wtoken.hiddenRequested) {
|
||||||
if (!wtoken.mAppAnimator.freezingScreen) {
|
if (!wtoken.mAppAnimator.freezingScreen) {
|
||||||
wtoken.mAppAnimator.freezingScreen = true;
|
wtoken.mAppAnimator.freezingScreen = true;
|
||||||
|
wtoken.mAppAnimator.lastFreezeDuration = 0;
|
||||||
mAppsFreezingScreen++;
|
mAppsFreezingScreen++;
|
||||||
if (mAppsFreezingScreen == 1) {
|
if (mAppsFreezingScreen == 1) {
|
||||||
startFreezingDisplayLocked(false, 0, 0);
|
startFreezingDisplayLocked(false, 0, 0);
|
||||||
@@ -4750,6 +4763,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
synchronized(mWindowMap) {
|
synchronized(mWindowMap) {
|
||||||
if (mClientFreezingScreen) {
|
if (mClientFreezingScreen) {
|
||||||
mClientFreezingScreen = false;
|
mClientFreezingScreen = false;
|
||||||
|
mLastFinishedFreezeSource = "client";
|
||||||
final long origId = Binder.clearCallingIdentity();
|
final long origId = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
stopFreezingDisplayLocked();
|
stopFreezingDisplayLocked();
|
||||||
@@ -5742,6 +5756,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.mOrientationChanging = true;
|
w.mOrientationChanging = true;
|
||||||
mInnerFields.mOrientationChangeComplete = false;
|
mInnerFields.mOrientationChangeComplete = false;
|
||||||
}
|
}
|
||||||
|
w.mLastFreezeDuration = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=mRotationWatchers.size()-1; i>=0; i--) {
|
for (int i=mRotationWatchers.size()-1; i>=0; i--) {
|
||||||
@@ -6240,6 +6255,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (config == null && mWaitingForConfig) {
|
if (config == null && mWaitingForConfig) {
|
||||||
// Nothing changed but we are waiting for something... stop that!
|
// Nothing changed but we are waiting for something... stop that!
|
||||||
mWaitingForConfig = false;
|
mWaitingForConfig = false;
|
||||||
|
mLastFinishedFreezeSource = "new-config";
|
||||||
performLayoutAndPlaceSurfacesLocked();
|
performLayoutAndPlaceSurfacesLocked();
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
@@ -7036,6 +7052,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
WindowState w = windows.get(i);
|
WindowState w = windows.get(i);
|
||||||
if (w.mOrientationChanging) {
|
if (w.mOrientationChanging) {
|
||||||
w.mOrientationChanging = false;
|
w.mOrientationChanging = false;
|
||||||
|
w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
|
||||||
|
- mDisplayFreezeTime);
|
||||||
Slog.w(TAG, "Force clearing orientation change: " + w);
|
Slog.w(TAG, "Force clearing orientation change: " + w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7112,6 +7130,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
synchronized (mWindowMap) {
|
synchronized (mWindowMap) {
|
||||||
if (mClientFreezingScreen) {
|
if (mClientFreezingScreen) {
|
||||||
mClientFreezingScreen = false;
|
mClientFreezingScreen = false;
|
||||||
|
mLastFinishedFreezeSource = "client-timeout";
|
||||||
stopFreezingDisplayLocked();
|
stopFreezingDisplayLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8029,6 +8048,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (DEBUG_ORIENTATION) Slog.v(TAG,
|
if (DEBUG_ORIENTATION) Slog.v(TAG,
|
||||||
"Changing surface while display frozen: " + w);
|
"Changing surface while display frozen: " + w);
|
||||||
w.mOrientationChanging = true;
|
w.mOrientationChanging = true;
|
||||||
|
w.mLastFreezeDuration = 0;
|
||||||
mInnerFields.mOrientationChangeComplete = false;
|
mInnerFields.mOrientationChangeComplete = false;
|
||||||
if (!mWindowsFreezingScreen) {
|
if (!mWindowsFreezingScreen) {
|
||||||
mWindowsFreezingScreen = true;
|
mWindowsFreezingScreen = true;
|
||||||
@@ -8417,6 +8437,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
"Orientation not waiting for draw in "
|
"Orientation not waiting for draw in "
|
||||||
+ w + ", surface " + winAnimator.mSurfaceControl);
|
+ w + ", surface " + winAnimator.mSurfaceControl);
|
||||||
w.mOrientationChanging = false;
|
w.mOrientationChanging = false;
|
||||||
|
w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
|
||||||
|
- mDisplayFreezeTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8930,6 +8952,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
winAnimator.mSurfaceResized = false;
|
winAnimator.mSurfaceResized = false;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
win.mOrientationChanging = false;
|
win.mOrientationChanging = false;
|
||||||
|
win.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
|
||||||
|
- mDisplayFreezeTime);
|
||||||
}
|
}
|
||||||
mResizingWindows.remove(i);
|
mResizingWindows.remove(i);
|
||||||
}
|
}
|
||||||
@@ -8940,6 +8964,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (mInnerFields.mOrientationChangeComplete) {
|
if (mInnerFields.mOrientationChangeComplete) {
|
||||||
if (mWindowsFreezingScreen) {
|
if (mWindowsFreezingScreen) {
|
||||||
mWindowsFreezingScreen = false;
|
mWindowsFreezingScreen = false;
|
||||||
|
mLastFinishedFreezeSource = mInnerFields.mLastWindowFreezeSource;
|
||||||
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
||||||
}
|
}
|
||||||
stopFreezingDisplayLocked();
|
stopFreezingDisplayLocked();
|
||||||
@@ -9226,6 +9251,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mInnerFields.mOrientationChangeComplete = false;
|
mInnerFields.mOrientationChangeComplete = false;
|
||||||
} else {
|
} else {
|
||||||
mInnerFields.mOrientationChangeComplete = true;
|
mInnerFields.mOrientationChangeComplete = true;
|
||||||
|
mInnerFields.mLastWindowFreezeSource = mAnimator.mLastWindowFreezeSource;
|
||||||
if (mWindowsFreezingScreen) {
|
if (mWindowsFreezingScreen) {
|
||||||
doRequest = true;
|
doRequest = true;
|
||||||
}
|
}
|
||||||
@@ -9498,6 +9524,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mScreenFrozenLock.acquire();
|
mScreenFrozenLock.acquire();
|
||||||
|
|
||||||
mDisplayFrozen = true;
|
mDisplayFrozen = true;
|
||||||
|
mDisplayFreezeTime = SystemClock.elapsedRealtime();
|
||||||
|
mLastFinishedFreezeSource = null;
|
||||||
|
|
||||||
mInputMonitor.freezeInputDispatchingLw();
|
mInputMonitor.freezeInputDispatchingLw();
|
||||||
|
|
||||||
@@ -9552,6 +9580,15 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
mDisplayFrozen = false;
|
mDisplayFrozen = false;
|
||||||
|
mLastDisplayFreezeDuration = (int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime);
|
||||||
|
StringBuilder sb = new StringBuilder(128);
|
||||||
|
sb.append("Screen frozen for ");
|
||||||
|
TimeUtils.formatDuration(mLastDisplayFreezeDuration, sb);
|
||||||
|
if (mLastFinishedFreezeSource != null) {
|
||||||
|
sb.append(" due to ");
|
||||||
|
sb.append(mLastFinishedFreezeSource);
|
||||||
|
}
|
||||||
|
Slog.i(TAG, sb.toString());
|
||||||
mH.removeMessages(H.APP_FREEZE_TIMEOUT);
|
mH.removeMessages(H.APP_FREEZE_TIMEOUT);
|
||||||
mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT);
|
mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT);
|
||||||
if (PROFILE_ORIENTATION) {
|
if (PROFILE_ORIENTATION) {
|
||||||
@@ -10076,6 +10113,13 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
pw.print(" mInTouchMode="); pw.print(mInTouchMode);
|
pw.print(" mInTouchMode="); pw.print(mInTouchMode);
|
||||||
pw.print(" mLayoutSeq="); pw.println(mLayoutSeq);
|
pw.print(" mLayoutSeq="); pw.println(mLayoutSeq);
|
||||||
|
pw.print(" mLastDisplayFreezeDuration=");
|
||||||
|
TimeUtils.formatDuration(mLastDisplayFreezeDuration, pw);
|
||||||
|
if ( mLastFinishedFreezeSource != null) {
|
||||||
|
pw.print(" due to ");
|
||||||
|
pw.print(mLastFinishedFreezeSource);
|
||||||
|
}
|
||||||
|
pw.println();
|
||||||
if (dumpAll) {
|
if (dumpAll) {
|
||||||
pw.print(" mSystemDecorRect="); pw.print(mSystemDecorRect.toShortString());
|
pw.print(" mSystemDecorRect="); pw.print(mSystemDecorRect.toShortString());
|
||||||
pw.print(" mSystemDecorLayer="); pw.print(mSystemDecorLayer);
|
pw.print(" mSystemDecorLayer="); pw.print(mSystemDecorLayer);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
|
|||||||
|
|
||||||
import android.app.AppOpsManager;
|
import android.app.AppOpsManager;
|
||||||
import android.os.RemoteCallbackList;
|
import android.os.RemoteCallbackList;
|
||||||
|
import android.util.TimeUtils;
|
||||||
import android.view.IWindowFocusObserver;
|
import android.view.IWindowFocusObserver;
|
||||||
import android.view.IWindowId;
|
import android.view.IWindowId;
|
||||||
import com.android.server.input.InputWindowHandle;
|
import com.android.server.input.InputWindowHandle;
|
||||||
@@ -266,6 +267,11 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
*/
|
*/
|
||||||
boolean mOrientationChanging;
|
boolean mOrientationChanging;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How long we last kept the screen frozen.
|
||||||
|
*/
|
||||||
|
int mLastFreezeDuration;
|
||||||
|
|
||||||
/** Is this window now (or just being) removed? */
|
/** Is this window now (or just being) removed? */
|
||||||
boolean mRemoved;
|
boolean mRemoved;
|
||||||
|
|
||||||
@@ -1387,6 +1393,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
pw.print(" mAppFreezing="); pw.print(mAppFreezing);
|
pw.print(" mAppFreezing="); pw.print(mAppFreezing);
|
||||||
pw.print(" mTurnOnScreen="); pw.println(mTurnOnScreen);
|
pw.print(" mTurnOnScreen="); pw.println(mTurnOnScreen);
|
||||||
}
|
}
|
||||||
|
if (mLastFreezeDuration != 0) {
|
||||||
|
pw.print(prefix); pw.print("mLastFreezeDuration=");
|
||||||
|
TimeUtils.formatDuration(mLastFreezeDuration, pw); pw.println();
|
||||||
|
}
|
||||||
if (mHScale != 1 || mVScale != 1) {
|
if (mHScale != 1 || mVScale != 1) {
|
||||||
pw.print(prefix); pw.print("mHScale="); pw.print(mHScale);
|
pw.print(prefix); pw.print("mHScale="); pw.print(mHScale);
|
||||||
pw.print(" mVScale="); pw.println(mVScale);
|
pw.print(" mVScale="); pw.println(mVScale);
|
||||||
|
|||||||
@@ -1307,6 +1307,7 @@ class WindowStateAnimator {
|
|||||||
if (w.mOrientationChanging) {
|
if (w.mOrientationChanging) {
|
||||||
if (!w.isDrawnLw()) {
|
if (!w.isDrawnLw()) {
|
||||||
mAnimator.mBulkUpdateParams &= ~SET_ORIENTATION_CHANGE_COMPLETE;
|
mAnimator.mBulkUpdateParams &= ~SET_ORIENTATION_CHANGE_COMPLETE;
|
||||||
|
mAnimator.mLastWindowFreezeSource = w;
|
||||||
if (DEBUG_ORIENTATION) Slog.v(TAG,
|
if (DEBUG_ORIENTATION) Slog.v(TAG,
|
||||||
"Orientation continue waiting for draw in " + w);
|
"Orientation continue waiting for draw in " + w);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user