Merge "Remove unnecessary references in WindowManagerService"

This commit is contained in:
Craig Mautner
2012-12-04 09:45:03 -08:00
committed by Gerrit Code Review

View File

@ -4116,8 +4116,7 @@ public class WindowManagerService extends IWindowManager.Stub
mStartingIconInTransition = false; mStartingIconInTransition = false;
mSkipAppTransitionAnimation = false; mSkipAppTransitionAnimation = false;
mH.removeMessages(H.APP_TRANSITION_TIMEOUT); mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
mH.sendMessageDelayed(mH.obtainMessage(H.APP_TRANSITION_TIMEOUT), mH.sendEmptyMessageDelayed(H.APP_TRANSITION_TIMEOUT, 5000);
5000);
} }
} }
} }
@ -4688,8 +4687,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.sendMessageDelayed(mH.obtainMessage(H.APP_FREEZE_TIMEOUT), mH.sendEmptyMessageDelayed(H.APP_FREEZE_TIMEOUT, 5000);
5000);
} }
} }
final int N = wtoken.allAppWindows.size(); final int N = wtoken.allAppWindows.size();
@ -5209,8 +5207,7 @@ public class WindowManagerService extends IWindowManager.Stub
try { try {
startFreezingDisplayLocked(false, exitAnim, enterAnim); startFreezingDisplayLocked(false, exitAnim, enterAnim);
mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT); mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT);
mH.sendMessageDelayed(mH.obtainMessage(H.CLIENT_FREEZE_TIMEOUT), mH.sendEmptyMessageDelayed(H.CLIENT_FREEZE_TIMEOUT, 5000);
5000);
} finally { } finally {
Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId);
} }
@ -5338,7 +5335,7 @@ public class WindowManagerService extends IWindowManager.Stub
} }
// Persist setting // Persist setting
mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget(); mH.sendEmptyMessage(H.PERSIST_ANIMATION_SCALE);
} }
public void setAnimationScales(float[] scales) { public void setAnimationScales(float[] scales) {
@ -5360,7 +5357,7 @@ public class WindowManagerService extends IWindowManager.Stub
} }
// Persist setting // Persist setting
mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget(); mH.sendEmptyMessage(H.PERSIST_ANIMATION_SCALE);
} }
private void setAnimatorDurationScale(float scale) { private void setAnimatorDurationScale(float scale) {
@ -5470,8 +5467,7 @@ public class WindowManagerService extends IWindowManager.Stub
hideBootMessagesLocked(); hideBootMessagesLocked();
// If the screen still doesn't come up after 30 seconds, give // If the screen still doesn't come up after 30 seconds, give
// up and turn it on. // up and turn it on.
Message msg = mH.obtainMessage(H.BOOT_TIMEOUT); mH.sendEmptyMessageDelayed(H.BOOT_TIMEOUT, 30*1000);
mH.sendMessageDelayed(msg, 30*1000);
} }
mPolicy.systemBooted(); mPolicy.systemBooted();
@ -5494,7 +5490,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (!mSystemBooted && !mShowingBootMessages) { if (!mSystemBooted && !mShowingBootMessages) {
return; return;
} }
mH.sendMessage(mH.obtainMessage(H.ENABLE_SCREEN)); mH.sendEmptyMessage(H.ENABLE_SCREEN);
} }
public void performBootTimeout() { public void performBootTimeout() {
@ -6056,7 +6052,7 @@ public class WindowManagerService extends IWindowManager.Stub
mWindowsFreezingScreen = true; mWindowsFreezingScreen = true;
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT), mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT,
WINDOW_FREEZE_TIMEOUT_DURATION); WINDOW_FREEZE_TIMEOUT_DURATION);
mWaitingForConfig = true; mWaitingForConfig = true;
getDefaultDisplayContentLocked().layoutNeeded = true; getDefaultDisplayContentLocked().layoutNeeded = true;
@ -7585,8 +7581,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (mAnimator.mAnimating || mLayoutToAnim.mAnimationScheduled) { if (mAnimator.mAnimating || mLayoutToAnim.mAnimationScheduled) {
// If we are animating, don't do the gc now but // If we are animating, don't do the gc now but
// delay a bit so we don't interrupt the animation. // delay a bit so we don't interrupt the animation.
mH.sendMessageDelayed(mH.obtainMessage(H.FORCE_GC), sendEmptyMessageDelayed(H.FORCE_GC, 2000);
2000);
return; return;
} }
// If we are currently rotating the display, it will // If we are currently rotating the display, it will
@ -7711,7 +7706,7 @@ public class WindowManagerService extends IWindowManager.Stub
// Used to send multiple changes from the animation side to the layout side. // Used to send multiple changes from the animation side to the layout side.
synchronized (mWindowMap) { synchronized (mWindowMap) {
if (copyAnimToLayoutParamsLocked()) { if (copyAnimToLayoutParamsLocked()) {
mH.sendEmptyMessage(CLEAR_PENDING_ACTIONS); sendEmptyMessage(CLEAR_PENDING_ACTIONS);
performLayoutAndPlaceSurfacesLocked(); performLayoutAndPlaceSurfacesLocked();
} }
} }
@ -8300,7 +8295,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (mWindowsChanged && !mWindowChangeListeners.isEmpty()) { if (mWindowsChanged && !mWindowChangeListeners.isEmpty()) {
mH.removeMessages(H.REPORT_WINDOWS_CHANGE); mH.removeMessages(H.REPORT_WINDOWS_CHANGE);
mH.sendMessage(mH.obtainMessage(H.REPORT_WINDOWS_CHANGE)); mH.sendEmptyMessage(H.REPORT_WINDOWS_CHANGE);
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
mInLayout = false; mInLayout = false;
@ -8496,8 +8491,8 @@ public class WindowManagerService extends IWindowManager.Stub
// 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);
mH.sendMessageDelayed(mH.obtainMessage( mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT,
H.WINDOW_FREEZE_TIMEOUT), WINDOW_FREEZE_TIMEOUT_DURATION); WINDOW_FREEZE_TIMEOUT_DURATION);
} }
} }
} }
@ -10174,8 +10169,7 @@ public class WindowManagerService extends IWindowManager.Stub
// processes holds on others can be released if they are // processes holds on others can be released if they are
// no longer needed. // no longer needed.
mH.removeMessages(H.FORCE_GC); mH.removeMessages(H.FORCE_GC);
mH.sendMessageDelayed(mH.obtainMessage(H.FORCE_GC), mH.sendEmptyMessageDelayed(H.FORCE_GC, 2000);
2000);
mScreenFrozenLock.release(); mScreenFrozenLock.release();