Merge "Add a timeout state to frozen windows"
This commit is contained in:
@@ -504,7 +504,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
int mLastDisplayFreezeDuration = 0;
|
int mLastDisplayFreezeDuration = 0;
|
||||||
Object mLastFinishedFreezeSource = null;
|
Object mLastFinishedFreezeSource = null;
|
||||||
boolean mWaitingForConfig = false;
|
boolean mWaitingForConfig = false;
|
||||||
boolean mWindowsFreezingScreen = false;
|
|
||||||
|
final static int WINDOWS_FREEZING_SCREENS_NONE = 0;
|
||||||
|
final static int WINDOWS_FREEZING_SCREENS_ACTIVE = 1;
|
||||||
|
final static int WINDOWS_FREEZING_SCREENS_TIMEOUT = 2;
|
||||||
|
private int mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_NONE;
|
||||||
|
|
||||||
boolean mClientFreezingScreen = false;
|
boolean mClientFreezingScreen = false;
|
||||||
int mAppsFreezingScreen = 0;
|
int mAppsFreezingScreen = 0;
|
||||||
int mLastWindowForcedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
int mLastWindowForcedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||||
@@ -4761,7 +4766,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (mAppsFreezingScreen == 1) {
|
if (mAppsFreezingScreen == 1) {
|
||||||
startFreezingDisplayLocked(false, 0, 0);
|
startFreezingDisplayLocked(false, 0, 0);
|
||||||
mH.removeMessages(H.APP_FREEZE_TIMEOUT);
|
mH.removeMessages(H.APP_FREEZE_TIMEOUT);
|
||||||
mH.sendEmptyMessageDelayed(H.APP_FREEZE_TIMEOUT, 5000);
|
mH.sendEmptyMessageDelayed(H.APP_FREEZE_TIMEOUT, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final int N = wtoken.allAppWindows.size();
|
final int N = wtoken.allAppWindows.size();
|
||||||
@@ -6550,7 +6555,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mAltOrientation = altOrientation;
|
mAltOrientation = altOrientation;
|
||||||
mPolicy.setRotationLw(mRotation);
|
mPolicy.setRotationLw(mRotation);
|
||||||
|
|
||||||
mWindowsFreezingScreen = true;
|
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE;
|
||||||
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
||||||
mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION);
|
mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION);
|
||||||
mWaitingForConfig = true;
|
mWaitingForConfig = true;
|
||||||
@@ -7920,6 +7925,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// TODO(multidisplay): Can non-default displays rotate?
|
// TODO(multidisplay): Can non-default displays rotate?
|
||||||
synchronized (mWindowMap) {
|
synchronized (mWindowMap) {
|
||||||
Slog.w(TAG, "Window freeze timeout expired.");
|
Slog.w(TAG, "Window freeze timeout expired.");
|
||||||
|
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_TIMEOUT;
|
||||||
final WindowList windows = getDefaultWindowListLocked();
|
final WindowList windows = getDefaultWindowListLocked();
|
||||||
int i = windows.size();
|
int i = windows.size();
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
@@ -7991,6 +7997,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
case APP_FREEZE_TIMEOUT: {
|
case APP_FREEZE_TIMEOUT: {
|
||||||
synchronized (mWindowMap) {
|
synchronized (mWindowMap) {
|
||||||
Slog.w(TAG, "App freeze timeout expired.");
|
Slog.w(TAG, "App freeze timeout expired.");
|
||||||
|
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_TIMEOUT;
|
||||||
final int numStacks = mStackIdToStack.size();
|
final int numStacks = mStackIdToStack.size();
|
||||||
for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) {
|
for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) {
|
||||||
final TaskStack stack = mStackIdToStack.valueAt(stackNdx);
|
final TaskStack stack = mStackIdToStack.valueAt(stackNdx);
|
||||||
@@ -9081,8 +9088,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
w.mOrientationChanging = true;
|
w.mOrientationChanging = true;
|
||||||
w.mLastFreezeDuration = 0;
|
w.mLastFreezeDuration = 0;
|
||||||
mInnerFields.mOrientationChangeComplete = false;
|
mInnerFields.mOrientationChangeComplete = false;
|
||||||
if (!mWindowsFreezingScreen) {
|
if (mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_NONE) {
|
||||||
mWindowsFreezingScreen = true;
|
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE;
|
||||||
// XXX should probably keep timeout from
|
// XXX should probably keep timeout from
|
||||||
// when we first froze the display.
|
// when we first froze the display.
|
||||||
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
||||||
@@ -10107,8 +10114,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
"With display frozen, orientationChangeComplete="
|
"With display frozen, orientationChangeComplete="
|
||||||
+ mInnerFields.mOrientationChangeComplete);
|
+ mInnerFields.mOrientationChangeComplete);
|
||||||
if (mInnerFields.mOrientationChangeComplete) {
|
if (mInnerFields.mOrientationChangeComplete) {
|
||||||
if (mWindowsFreezingScreen) {
|
if (mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_NONE) {
|
||||||
mWindowsFreezingScreen = false;
|
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_NONE;
|
||||||
mLastFinishedFreezeSource = mInnerFields.mLastWindowFreezeSource;
|
mLastFinishedFreezeSource = mInnerFields.mLastWindowFreezeSource;
|
||||||
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
|
||||||
}
|
}
|
||||||
@@ -10394,7 +10401,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
} else {
|
} else {
|
||||||
mInnerFields.mOrientationChangeComplete = true;
|
mInnerFields.mOrientationChangeComplete = true;
|
||||||
mInnerFields.mLastWindowFreezeSource = mAnimator.mLastWindowFreezeSource;
|
mInnerFields.mLastWindowFreezeSource = mAnimator.mLastWindowFreezeSource;
|
||||||
if (mWindowsFreezingScreen) {
|
if (mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_NONE) {
|
||||||
doRequest = true;
|
doRequest = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10739,7 +10746,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWaitingForConfig || mAppsFreezingScreen > 0 || mWindowsFreezingScreen
|
if (mWaitingForConfig || mAppsFreezingScreen > 0
|
||||||
|
|| mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_ACTIVE
|
||||||
|| mClientFreezingScreen || !mOpeningApps.isEmpty()) {
|
|| mClientFreezingScreen || !mOpeningApps.isEmpty()) {
|
||||||
if (DEBUG_ORIENTATION) Slog.d(TAG,
|
if (DEBUG_ORIENTATION) Slog.d(TAG,
|
||||||
"stopFreezingDisplayLocked: Returning mWaitingForConfig=" + mWaitingForConfig
|
"stopFreezingDisplayLocked: Returning mWaitingForConfig=" + mWaitingForConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user