Rename variables and methods for clarity.
Change-Id: I2a1b2f2d5605123e55f264d45b1e7292852f2a7f
diff --git a/services/java/com/android/server/wm/DragState.java b/services/java/com/android/server/wm/DragState.java
index dc52fcf..545fce5 100644
--- a/services/java/com/android/server/wm/DragState.java
+++ b/services/java/com/android/server/wm/DragState.java
@@ -189,7 +189,7 @@
Slog.d(WindowManagerService.TAG, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")");
}
- final WindowList windows = mService.getWindowList(mDisplay);
+ final WindowList windows = mService.getWindowListLocked(mDisplay);
final int N = windows.size();
for (int i = 0; i < N; i++) {
sendDragStartedLw(windows.get(i), touchX, touchY, mDataDescription);
@@ -392,7 +392,7 @@
final int x = (int) xf;
final int y = (int) yf;
- final WindowList windows = mService.getWindowList(mDisplay);
+ final WindowList windows = mService.getWindowListLocked(mDisplay);
final int N = windows.size();
for (int i = N - 1; i >= 0; i--) {
WindowState child = windows.get(i);
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 6951879..54cec82 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -610,11 +610,11 @@
public AppWindowAnimParams(final AppWindowAnimator appAnimator) {
mAppAnimator = appAnimator;
- final AppWindowToken wtoken = appAnimator.mAppToken;
+ final AppWindowToken atoken = appAnimator.mAppToken;
mWinAnimators = new ArrayList<WindowStateAnimator>();
- final int N = wtoken.allAppWindows.size();
+ final int N = atoken.allAppWindows.size();
for (int i = 0; i < N; i++) {
- mWinAnimators.add(wtoken.allAppWindows.get(i).mWinAnimator);
+ mWinAnimators.add(atoken.allAppWindows.get(i).mWinAnimator);
}
}
}
@@ -788,7 +788,7 @@
mDisplayManager.registerDisplayListener(this, null);
Display[] displays = mDisplayManager.getDisplays();
for (Display display : displays) {
- createDisplayContent(display);
+ createDisplayContentLocked(display);
}
mKeyguardDisableHandler = new KeyguardDisableHandler(mContext, mPolicy);
@@ -1166,7 +1166,7 @@
// TODO(multidisplay): Needs some serious rethought when the target and IME are not on the
// same display. Or even when the current IME/target are not on the same screen as the next
// IME/target. For now only look for input windows on the main screen.
- WindowList windows = getDefaultWindowList();
+ WindowList windows = getDefaultWindowListLocked();
final int N = windows.size();
WindowState w = null;
int i = N;
@@ -1308,7 +1308,7 @@
if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(
TAG, "Adding input method window " + win + " at " + pos);
// TODO(multidisplay): IMEs are only supported on the default display.
- getDefaultWindowList().add(pos, win);
+ getDefaultWindowListLocked().add(pos, win);
mWindowsChanged = true;
moveInputMethodDialogsLocked(pos+1);
return;
@@ -1396,7 +1396,7 @@
ArrayList<WindowState> dialogs = mInputMethodDialogs;
// TODO(multidisplay): IMEs are only supported on the default display.
- WindowList windows = getDefaultWindowList();
+ WindowList windows = getDefaultWindowListLocked();
final int N = dialogs.size();
if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Removing " + N + " dialogs w/pos=" + pos);
for (int i=0; i<N; i++) {
@@ -1446,7 +1446,7 @@
}
// TODO(multidisplay): IMEs are only supported on the default display.
- WindowList windows = getDefaultWindowList();
+ WindowList windows = getDefaultWindowListLocked();
int imPos = findDesiredInputMethodWindowIndexLocked(true);
if (imPos >= 0) {
@@ -1566,13 +1566,13 @@
int changed = 0;
// TODO(multidisplay): Wallpapers on main screen only.
- final DisplayInfo displayInfo = getDefaultDisplayContent().getDisplayInfo();
+ final DisplayInfo displayInfo = getDefaultDisplayContentLocked().getDisplayInfo();
final int dw = displayInfo.appWidth;
final int dh = displayInfo.appHeight;
// First find top-most window that has asked to be on top of the
// wallpaper; all wallpapers go behind it.
- final WindowList windows = getDefaultWindowList();
+ final WindowList windows = getDefaultWindowListLocked();
int N = windows.size();
WindowState w = null;
WindowState foundW = null;
@@ -1812,7 +1812,7 @@
token.hidden = !visible;
// Need to do a layout to ensure the wallpaper now has the
// correct size.
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
}
int curWallpaperIndex = token.windows.size();
@@ -2055,7 +2055,7 @@
token.hidden = !visible;
// Need to do a layout to ensure the wallpaper now has the
// correct size.
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
}
int curWallpaperIndex = token.windows.size();
@@ -2173,7 +2173,7 @@
}
}
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
win = new WindowState(this, session, client, token,
attachedWindow, seq, attrs, viewVisibility, displayContent);
if (win.mDeathRecipient == null) {
@@ -2668,7 +2668,7 @@
boolean immediate) {
RemoteCallbackList<IDisplayContentChangeListener> callbacks = null;
synchronized (mWindowMap) {
- DisplayContent displayContent = getDisplayContent(displayId);
+ DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent == null) {
return;
}
@@ -2966,7 +2966,7 @@
configChanged = updateOrientationFromAppTokensLocked(false);
performLayoutAndPlaceSurfacesLocked();
if (toBeDisplayed && win.mIsWallpaper) {
- DisplayInfo displayInfo = getDefaultDisplayInfo();
+ DisplayInfo displayInfo = getDefaultDisplayInfoLocked();
updateWallpaperOffsetLocked(win,
displayInfo.appWidth, displayInfo.appHeight, false);
}
@@ -3089,7 +3089,7 @@
throw new SecurityException("Requires RETRIEVE_WINDOW_INFO permission.");
}
synchronized (mWindowMap) {
- DisplayContent displayContent = getDisplayContent(displayId);
+ DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent == null) {
return;
}
@@ -3106,6 +3106,7 @@
}
}
+ @Override
public void magnifyDisplay(int displayId, float scale, float offsetX, float offsetY) {
if (!checkCallingPermission(
android.Manifest.permission.MAGNIFY_DISPLAY, "magnifyDisplay()")) {
@@ -3134,7 +3135,7 @@
}
MagnificationSpec getDisplayMagnificationSpecLocked(int displayId) {
- DisplayContent displayContent = getDisplayContent(displayId);
+ DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent != null) {
if (displayContent.mMagnificationSpec == null) {
displayContent.mMagnificationSpec = new MagnificationSpec();
@@ -3279,7 +3280,7 @@
break;
}
// TODO(multidisplay): For now assume all app animation is on main display.
- final DisplayInfo displayInfo = getDefaultDisplayInfo();
+ final DisplayInfo displayInfo = getDefaultDisplayInfoLocked();
if (enter) {
// Entering app zooms out from the center of the initial rect.
float scaleW = mNextAppTransitionStartWidth / (float) displayInfo.appWidth;
@@ -3330,7 +3331,7 @@
break;
}
// TOOD(multidisplay): For now assume all app animation is on the main screen.
- DisplayInfo displayInfo = getDefaultDisplayInfo();
+ DisplayInfo displayInfo = getDefaultDisplayInfoLocked();
if (thumb) {
// Animation for zooming thumbnail from its initial size to
// filling the screen.
@@ -3425,7 +3426,7 @@
return a;
}
- private boolean applyAnimationLocked(AppWindowToken wtoken,
+ private boolean applyAnimationLocked(AppWindowToken atoken,
WindowManager.LayoutParams lp, int transit, boolean enter) {
// Only apply an animation if the display isn't frozen. If it is
// frozen, there is no reason to animate and it can cause strange
@@ -3438,14 +3439,14 @@
a = loadAnimation(mNextAppTransitionPackage, enter ?
mNextAppTransitionEnter : mNextAppTransitionExit);
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
- "applyAnimation: wtoken=" + wtoken
+ "applyAnimation: atoken=" + atoken
+ " anim=" + a + " nextAppTransition=ANIM_CUSTOM"
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
} else if (mNextAppTransitionType == ActivityOptions.ANIM_SCALE_UP) {
a = createScaleUpAnimationLocked(transit, enter);
initialized = true;
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
- "applyAnimation: wtoken=" + wtoken
+ "applyAnimation: atoken=" + atoken
+ " anim=" + a + " nextAppTransition=ANIM_SCALE_UP"
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
} else if (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_UP ||
@@ -3456,7 +3457,7 @@
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
String animName = scaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
- Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
+ Slog.v(TAG, "applyAnimation: atoken=" + atoken
+ " anim=" + a + " nextAppTransition=" + animName
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
}
@@ -3516,7 +3517,7 @@
}
a = animAttr != 0 ? loadAnimation(lp, animAttr) : null;
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
- "applyAnimation: wtoken=" + wtoken
+ "applyAnimation: atoken=" + atoken
+ " anim=" + a
+ " animAttr=0x" + Integer.toHexString(animAttr)
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
@@ -3528,15 +3529,15 @@
e = new RuntimeException();
e.fillInStackTrace();
}
- Slog.v(TAG, "Loaded animation " + a + " for " + wtoken, e);
+ Slog.v(TAG, "Loaded animation " + a + " for " + atoken, e);
}
- wtoken.mAppAnimator.setAnimation(a, initialized);
+ atoken.mAppAnimator.setAnimation(a, initialized);
}
} else {
- wtoken.mAppAnimator.clearAnimation();
+ atoken.mAppAnimator.clearAnimation();
}
- return wtoken.mAppAnimator.animation != null;
+ return atoken.mAppAnimator.animation != null;
}
// -------------------------------------------------------------
@@ -3547,14 +3548,14 @@
int v = tokens.size()-1;
int m = mAppTokens.size()-1;
while (v >= 0 && m >= 0) {
- AppWindowToken wtoken = mAppTokens.get(m);
- if (wtoken.removed) {
+ AppWindowToken atoken = mAppTokens.get(m);
+ if (atoken.removed) {
m--;
continue;
}
- if (tokens.get(v) != wtoken.token) {
+ if (tokens.get(v) != atoken.token) {
Slog.w(TAG, "Tokens out of sync: external is " + tokens.get(v)
- + " @ " + v + ", internal is " + wtoken.token + " @ " + m);
+ + " @ " + v + ", internal is " + atoken.token + " @ " + m);
}
v--;
m--;
@@ -3564,9 +3565,9 @@
v--;
}
while (m >= 0) {
- AppWindowToken wtoken = mAppTokens.get(m);
- if (!wtoken.removed) {
- Slog.w(TAG, "Invalid internal token: " + wtoken.token + " @ " + m);
+ AppWindowToken atoken = mAppTokens.get(m);
+ if (!atoken.removed) {
+ Slog.w(TAG, "Invalid internal atoken: " + atoken.token + " @ " + m);
}
m--;
}
@@ -3685,18 +3686,18 @@
* Find the location to insert a new AppWindowToken into the window-ordered app token list.
* Note that mAppTokens.size() == mAnimatingAppTokens.size() + 1.
* @param addPos The location the token was inserted into in mAppTokens.
- * @param wtoken The token to insert.
+ * @param atoken The token to insert.
*/
- private void addAppTokenToAnimating(final int addPos, final AppWindowToken wtoken) {
+ private void addAppTokenToAnimating(final int addPos, final AppWindowToken atoken) {
if (addPos == 0 || addPos == mAnimatingAppTokens.size()) {
// It was inserted into the beginning or end of mAppTokens. Honor that.
- mAnimatingAppTokens.add(addPos, wtoken);
+ mAnimatingAppTokens.add(addPos, atoken);
return;
}
// Find the item immediately above the mAppTokens insertion point and put the token
// immediately below that one in mAnimatingAppTokens.
final AppWindowToken aboveAnchor = mAppTokens.get(addPos + 1);
- mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), wtoken);
+ mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), atoken);
}
@Override
@@ -3722,25 +3723,25 @@
}
synchronized(mWindowMap) {
- AppWindowToken wtoken = findAppWindowToken(token.asBinder());
- if (wtoken != null) {
+ AppWindowToken atoken = findAppWindowToken(token.asBinder());
+ if (atoken != null) {
Slog.w(TAG, "Attempted to add existing app token: " + token);
return;
}
- wtoken = new AppWindowToken(this, token);
- wtoken.inputDispatchingTimeoutNanos = inputDispatchingTimeoutNanos;
- wtoken.groupId = groupId;
- wtoken.appFullscreen = fullscreen;
- wtoken.requestedOrientation = requestedOrientation;
- if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + wtoken
+ atoken = new AppWindowToken(this, token);
+ atoken.inputDispatchingTimeoutNanos = inputDispatchingTimeoutNanos;
+ atoken.groupId = groupId;
+ atoken.appFullscreen = fullscreen;
+ atoken.requestedOrientation = requestedOrientation;
+ if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
+ " at " + addPos);
- mAppTokens.add(addPos, wtoken);
- addAppTokenToAnimating(addPos, wtoken);
- mTokenMap.put(token.asBinder(), wtoken);
+ mAppTokens.add(addPos, atoken);
+ addAppTokenToAnimating(addPos, atoken);
+ mTokenMap.put(token.asBinder(), atoken);
// Application tokens start out hidden.
- wtoken.hidden = true;
- wtoken.hiddenRequested = true;
+ atoken.hidden = true;
+ atoken.hiddenRequested = true;
//dump();
}
@@ -3754,12 +3755,12 @@
}
synchronized(mWindowMap) {
- AppWindowToken wtoken = findAppWindowToken(token);
- if (wtoken == null) {
+ AppWindowToken atoken = findAppWindowToken(token);
+ if (atoken == null) {
Slog.w(TAG, "Attempted to set group id of non-existing app token: " + token);
return;
}
- wtoken.groupId = groupId;
+ atoken.groupId = groupId;
}
}
@@ -3774,7 +3775,7 @@
}
// TODO(multidisplay): Change to the correct display.
- final WindowList windows = getDefaultWindowList();
+ final WindowList windows = getDefaultWindowListLocked();
int pos = windows.size() - 1;
while (pos >= 0) {
WindowState wtoken = windows.get(pos);
@@ -3805,20 +3806,20 @@
boolean haveGroup = false;
boolean lastFullscreen = false;
for (int pos = mAppTokens.size() - 1; pos >= 0; pos--) {
- AppWindowToken wtoken = mAppTokens.get(pos);
+ AppWindowToken atoken = mAppTokens.get(pos);
- if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + wtoken);
+ if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + atoken);
// if we're about to tear down this window and not seek for
// the behind activity, don't use it for orientation
if (!findingBehind
- && (!wtoken.hidden && wtoken.hiddenRequested)) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken
+ && (!atoken.hidden && atoken.hiddenRequested)) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + atoken
+ " -- going to hide");
continue;
}
- if (haveGroup == true && curGroup != wtoken.groupId) {
+ if (haveGroup == true && curGroup != atoken.groupId) {
// If we have hit a new application group, and the bottom
// of the previous group didn't explicitly say to use
// the orientation behind it, and the last app was
@@ -3826,33 +3827,33 @@
// user's orientation.
if (lastOrientation != ActivityInfo.SCREEN_ORIENTATION_BEHIND
&& lastFullscreen) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + wtoken
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
+ " -- end of group, return " + lastOrientation);
return lastOrientation;
}
}
// We ignore any hidden applications on the top.
- if (wtoken.hiddenRequested || wtoken.willBeHidden) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken
+ if (atoken.hiddenRequested || atoken.willBeHidden) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + atoken
+ " -- hidden on top");
continue;
}
if (!haveGroup) {
haveGroup = true;
- curGroup = wtoken.groupId;
- lastOrientation = wtoken.requestedOrientation;
+ curGroup = atoken.groupId;
+ lastOrientation = atoken.requestedOrientation;
}
- int or = wtoken.requestedOrientation;
+ int or = atoken.requestedOrientation;
// If this application is fullscreen, and didn't explicitly say
// to use the orientation behind it, then just take whatever
// orientation it has and ignores whatever is under it.
- lastFullscreen = wtoken.appFullscreen;
+ lastFullscreen = atoken.appFullscreen;
if (lastFullscreen
&& or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + wtoken
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
+ " -- full screen, return " + or);
return or;
}
@@ -3860,7 +3861,7 @@
// then use it.
if (or != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
&& or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) {
- if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + wtoken
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken
+ " -- explicitly set, return " + or);
return or;
}
@@ -3896,10 +3897,10 @@
if (updateOrientationFromAppTokensLocked(false)) {
if (freezeThisOneIfNeeded != null) {
- AppWindowToken wtoken = findAppWindowToken(
+ AppWindowToken atoken = findAppWindowToken(
freezeThisOneIfNeeded);
- if (wtoken != null) {
- startAppFreezingScreenLocked(wtoken,
+ if (atoken != null) {
+ startAppFreezingScreenLocked(atoken,
ActivityInfo.CONFIG_ORIENTATION);
}
}
@@ -3915,7 +3916,7 @@
if (computeScreenConfigurationLocked(mTempConfiguration)) {
if (currentConfig.diff(mTempConfiguration) != 0) {
mWaitingForConfig = true;
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
startFreezingDisplayLocked(false, 0, 0);
config = new Configuration(mTempConfiguration);
}
@@ -3991,13 +3992,13 @@
}
synchronized(mWindowMap) {
- AppWindowToken wtoken = findAppWindowToken(token.asBinder());
- if (wtoken == null) {
+ AppWindowToken atoken = findAppWindowToken(token.asBinder());
+ if (atoken == null) {
Slog.w(TAG, "Attempted to set orientation of non-existing app token: " + token);
return;
}
- wtoken.requestedOrientation = requestedOrientation;
+ atoken.requestedOrientation = requestedOrientation;
}
}
@@ -4090,6 +4091,7 @@
}
}
+ @Override
public int getPendingAppTransition() {
return mNextAppTransition;
}
@@ -4100,6 +4102,7 @@
}
}
+ @Override
public void overridePendingAppTransition(String packageName,
int enterAnim, int exitAnim, IRemoteCallback startedCallback) {
synchronized(mWindowMap) {
@@ -4281,7 +4284,7 @@
updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
true /*updateInputWindows*/);
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
performLayoutAndPlaceSurfacesLocked();
Binder.restoreCallingIdentity(origId);
return;
@@ -5475,7 +5478,7 @@
&& !mOnlyCore;
boolean haveKeyguard = true;
// TODO(multidisplay): Expand to all displays?
- final WindowList windows = getDefaultWindowList();
+ final WindowList windows = getDefaultWindowListLocked();
final int N = windows.size();
for (int i=0; i<N; i++) {
WindowState w = windows.get(i);
@@ -5650,7 +5653,7 @@
// TODO(multi-display): support multiple displays
if (mStrictModeFlash == null) {
mStrictModeFlash = new StrictModeFlash(
- getDefaultDisplayContent().getDisplay(), mFxSession);
+ getDefaultDisplayContentLocked().getDisplay(), mFxSession);
}
mStrictModeFlash.setVisibility(on);
} finally {
@@ -5692,7 +5695,7 @@
synchronized(mWindowMap) {
long ident = Binder.clearCallingIdentity();
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
final DisplayInfo displayInfo = displayContent.getDisplayInfo();
dw = displayInfo.logicalWidth;
dh = displayInfo.logicalHeight;
@@ -5763,7 +5766,7 @@
}
// The screenshot API does not apply the current screen rotation.
- rot = getDefaultDisplayContent().getDisplay().getRotation();
+ rot = getDefaultDisplayContentLocked().getDisplay().getRotation();
int fw = frame.width();
int fh = frame.height();
@@ -5912,7 +5915,7 @@
synchronized(mWindowMap) {
changed = updateRotationUncheckedLocked(false);
if (!changed || forceRelayout) {
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
performLayoutAndPlaceSurfacesLocked();
}
}
@@ -5990,7 +5993,7 @@
mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT), 2000);
mWaitingForConfig = true;
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
startFreezingDisplayLocked(inTransaction, 0, 0);
// We need to update our screen size information to match the new
@@ -6001,7 +6004,7 @@
// the rotation animation for the new rotation.
computeScreenConfigurationLocked(null);
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final DisplayInfo displayInfo = displayContent.getDisplayInfo();
if (!inTransaction) {
if (SHOW_TRANSACTIONS) {
@@ -6112,7 +6115,7 @@
final int rotation = getRotation();
// TODO(multidisplay): Assume that such devices physical keys are on the main screen.
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
if (displayContent.mInitialDisplayWidth < displayContent.mInitialDisplayHeight) {
// On devices with a natural orientation of portrait
switch (rotation) {
@@ -6440,7 +6443,7 @@
throw new SecurityException("Requires RETRIEVE_WINDOW_INFO permission");
}
synchronized(mWindowMap) {
- DisplayContent displayContent = getDisplayContent(displayId);
+ DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent.mDisplayContentChangeListeners == null) {
displayContent.mDisplayContentChangeListeners =
new RemoteCallbackList<IDisplayContentChangeListener>();
@@ -6456,7 +6459,7 @@
throw new SecurityException("Requires RETRIEVE_WINDOW_INFO permission");
}
synchronized(mWindowMap) {
- DisplayContent displayContent = getDisplayContent(displayId);
+ DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent.mDisplayContentChangeListeners != null) {
displayContent.mDisplayContentChangeListeners.unregister(listener);
if (displayContent.mDisplayContentChangeListeners
@@ -6478,7 +6481,7 @@
private void handleNotifyWindowTranstion(int transition, WindowInfo info) {
RemoteCallbackList<IDisplayContentChangeListener> callbacks = null;
synchronized (mWindowMap) {
- DisplayContent displayContent = getDisplayContent(info.displayId);
+ DisplayContent displayContent = getDisplayContentLocked(info.displayId);
if (displayContent == null) {
return;
}
@@ -6514,7 +6517,7 @@
private void handleNotifyRotationChanged(int displayId, int rotation) {
RemoteCallbackList<IDisplayContentChangeListener> callbacks = null;
synchronized (mWindowMap) {
- DisplayContent displayContent = getDisplayContent(displayId);
+ DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent == null) {
return;
}
@@ -6801,7 +6804,7 @@
}
// TODO(multidisplay): For now, apply Configuration to main screen only.
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
// Use the effective "visual" dimensions based on current rotation
final boolean rotated = (mRotation == Surface.ROTATION_90
@@ -6999,7 +7002,7 @@
try {
if (mDragState == null) {
// TODO(multi-display): support other displays
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final Display display = displayContent.getDisplay();
Surface surface = new Surface(session, "drag surface",
width, height, PixelFormat.TRANSLUCENT, Surface.HIDDEN);
@@ -7148,7 +7151,7 @@
displayReady(Display.DEFAULT_DISPLAY);
synchronized(mWindowMap) {
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final Display display = displayContent.getDisplay();
readForcedDisplaySizeAndDensityLocked(displayContent);
@@ -7158,7 +7161,7 @@
mAnimator.initializeLocked(display.getLayerStack());
- final DisplayInfo displayInfo = getDefaultDisplayInfo();
+ final DisplayInfo displayInfo = getDefaultDisplayInfoLocked();
mAnimator.setDisplayDimensions(
displayInfo.logicalWidth, displayInfo.logicalHeight,
displayInfo.appWidth, displayInfo.appHeight);
@@ -7177,7 +7180,7 @@
public void displayReady(int displayId) {
synchronized(mWindowMap) {
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
final DisplayInfo displayInfo;
synchronized(displayContent.mDisplaySizeLock) {
// Bootstrap the default logical display from the display manager.
@@ -7493,7 +7496,7 @@
// TODO(multidisplay): Can non-default displays rotate?
synchronized (mWindowMap) {
Slog.w(TAG, "Window freeze timeout expired.");
- final WindowList windows = getDefaultWindowList();
+ final WindowList windows = getDefaultWindowListLocked();
int i = windows.size();
while (i > 0) {
i--;
@@ -7768,7 +7771,7 @@
int idx = findDesiredInputMethodWindowIndexLocked(false);
if (idx > 0) {
// TODO(multidisplay): IMEs are only supported on the default display.
- WindowState imFocus = getDefaultWindowList().get(idx-1);
+ WindowState imFocus = getDefaultWindowListLocked().get(idx-1);
if (DEBUG_INPUT_METHOD) {
Slog.i(TAG, "Desired input method target: " + imFocus);
Slog.i(TAG, "Current focus: " + mCurrentFocus);
@@ -7824,7 +7827,7 @@
public void getInitialDisplaySize(int displayId, Point size) {
// TODO(cmautner): Access to DisplayContent should be locked on mWindowMap. Doing that
// could lead to deadlock since this is called from ActivityManager.
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
synchronized(displayContent.mDisplaySizeLock) {
size.x = displayContent.mInitialDisplayWidth;
size.y = displayContent.mInitialDisplayHeight;
@@ -7838,7 +7841,7 @@
final int MIN_WIDTH = 200;
final int MIN_HEIGHT = 200;
final int MAX_SCALE = 2;
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
width = Math.min(Math.max(width, MIN_WIDTH),
displayContent.mInitialDisplayWidth * MAX_SCALE);
@@ -7856,7 +7859,7 @@
mBlackFrame = null;
}
// TODO(multidisplay): For now rotations are only main screen.
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final Display display = displayContent.getDisplay();
if (displayContent.mBaseDisplayWidth < displayContent.mInitialDisplayWidth
|| displayContent.mBaseDisplayHeight < displayContent.mInitialDisplayHeight) {
@@ -7948,7 +7951,7 @@
public void clearForcedDisplaySize(int displayId) {
synchronized(mWindowMap) {
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
setForcedDisplaySizeLocked(displayContent, displayContent.mInitialDisplayWidth,
displayContent.mInitialDisplayHeight);
Settings.Global.putString(mContext.getContentResolver(),
@@ -7958,7 +7961,7 @@
public void setForcedDisplayDensity(int displayId, int density) {
synchronized(mWindowMap) {
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
setForcedDisplayDensityLocked(displayContent, density);
Settings.Global.putString(mContext.getContentResolver(),
Settings.Global.DISPLAY_DENSITY_FORCED, Integer.toString(density));
@@ -7976,7 +7979,7 @@
public void clearForcedDisplayDensity(int displayId) {
synchronized(mWindowMap) {
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
setForcedDisplayDensityLocked(displayContent, displayContent.mInitialDisplayDensity);
Settings.Secure.putString(mContext.getContentResolver(),
Settings.Secure.DISPLAY_DENSITY_FORCED, "");
@@ -8659,7 +8662,7 @@
mNextAppTransitionThumbnail.getHeight());
try {
// TODO(multi-display): support other displays
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final Display display = displayContent.getDisplay();
Surface surface = new Surface(mFxSession,
"thumbnail anim",
@@ -8703,10 +8706,11 @@
// a new layout to get them all up-to-date.
changes |= WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT
| WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG;
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
// TODO(multidisplay): IMEs are only supported on the default display.
- if (windows == getDefaultWindowList() && !moveInputMethodWindowsIfNeededLocked(true)) {
+ if (windows == getDefaultWindowListLocked()
+ && !moveInputMethodWindowsIfNeededLocked(true)) {
assignLayersLocked(windows);
}
updateFocusedWindowLocked(UPDATE_FOCUS_PLACING_SURFACES, false /*updateInputWindows*/);
@@ -8956,7 +8960,7 @@
mInnerFields.mButtonBrightness = -1;
mTransactionSequence++;
- final DisplayContent defaultDisplay = getDefaultDisplayContent();
+ final DisplayContent defaultDisplay = getDefaultDisplayContentLocked();
final DisplayInfo defaultInfo = defaultDisplay.getDisplayInfo();
final int defaultDw = defaultInfo.logicalWidth;
final int defaultDh = defaultInfo.logicalHeight;
@@ -9380,7 +9384,7 @@
}
if (wallpaperDestroyed && (adjustWallpaperWindowsLocked() != 0)) {
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
}
DisplayContentsIterator iterator = new DisplayContentsIterator();
@@ -9665,7 +9669,8 @@
doRequest = true;
}
for (int i = 0; i < count; ++i) {
- final DisplayContent displayContent = getDisplayContent(pendingLayouts.keyAt(i));
+ final DisplayContent displayContent =
+ getDisplayContentLocked(pendingLayouts.keyAt(i));
displayContent.pendingLayoutChanges |= pendingLayouts.valueAt(i);
}
@@ -9796,14 +9801,14 @@
int focusChanged = mPolicy.focusChangedLw(oldFocus, newFocus);
// TODO(multidisplay): Focused windows on default display only.
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final WindowState imWindow = mInputMethodWindow;
if (newFocus != imWindow && oldFocus != imWindow) {
if (moveInputMethodWindowsIfNeededLocked(
mode != UPDATE_FOCUS_WILL_ASSIGN_LAYERS &&
mode != UPDATE_FOCUS_WILL_PLACE_SURFACES)) {
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
}
if (mode == UPDATE_FOCUS_PLACING_SURFACES) {
performLayoutLockedInner(displayContent, true /*initial*/, updateInputWindows);
@@ -9817,7 +9822,7 @@
if ((focusChanged & WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT) != 0) {
// The change in focus caused us to need to do a layout. Okay.
- getDefaultDisplayContent().layoutNeeded = true;
+ getDefaultDisplayContentLocked().layoutNeeded = true;
if (mode == UPDATE_FOCUS_PLACING_SURFACES) {
performLayoutLockedInner(displayContent, true /*initial*/, updateInputWindows);
}
@@ -9853,7 +9858,7 @@
? mAppTokens.get(nextAppIndex) : null;
// TODO(multidisplay): IMEs are only supported on the default display.
- WindowList windows = getDefaultWindowList();
+ WindowList windows = getDefaultWindowListLocked();
for (int i = windows.size() - 1; i >= 0; i--) {
win = windows.get(i);
@@ -9951,7 +9956,7 @@
}
// TODO(multidisplay): rotation on main screen only.
- final DisplayContent displayContent = getDefaultDisplayContent();
+ final DisplayContent displayContent = getDefaultDisplayContentLocked();
final Display display = displayContent.getDisplay();
final DisplayInfo displayInfo = displayContent.getDisplayInfo();
mAnimator.mScreenRotationAnimation = new ScreenRotationAnimation(mContext,
@@ -9989,7 +9994,7 @@
&& mAnimator.mScreenRotationAnimation.hasScreenshot()) {
if (DEBUG_ORIENTATION) Slog.i(TAG, "**** Dismissing screen rotation animation");
// TODO(multidisplay): rotation on main screen only.
- DisplayInfo displayInfo = getDefaultDisplayContent().getDisplayInfo();
+ DisplayInfo displayInfo = getDefaultDisplayContentLocked().getDisplayInfo();
if (mAnimator.mScreenRotationAnimation.dismiss(mFxSession, MAX_ANIMATION_DURATION,
mTransitionAnimationScale, displayInfo.logicalWidth,
displayInfo.logicalHeight)) {
@@ -10071,7 +10076,7 @@
if (line != null) {
String[] toks = line.split("%");
if (toks != null && toks.length > 0) {
- mWatermark = new Watermark(getDefaultDisplayContent().getDisplay(),
+ mWatermark = new Watermark(getDefaultDisplayContentLocked().getDisplay(),
mRealDisplayMetrics, mFxSession, toks);
}
}
@@ -10105,7 +10110,7 @@
// TOOD(multidisplay): StatusBar on multiple screens?
void updateStatusBarVisibilityLocked(int visibility) {
mInputManager.setSystemUiVisibility(visibility);
- final WindowList windows = getDefaultWindowList();
+ final WindowList windows = getDefaultWindowListLocked();
final int N = windows.size();
for (int i = 0; i < N; i++) {
WindowState ws = windows.get(i);
@@ -10176,7 +10181,7 @@
public void saveLastInputMethodWindowForTransition() {
synchronized (mWindowMap) {
// TODO(multidisplay): Pass in the displayID.
- DisplayContent displayContent = getDefaultDisplayContent();
+ DisplayContent displayContent = getDefaultDisplayContentLocked();
if (mInputMethodWindow != null) {
mPolicy.setLastInputMethodWindowLw(mInputMethodWindow, mInputMethodTarget);
}
@@ -10774,7 +10779,7 @@
}
}
- public void createDisplayContent(final Display display) {
+ public void createDisplayContentLocked(final Display display) {
if (display == null) {
throw new IllegalArgumentException("getDisplayContent: display must not be null");
}
@@ -10782,7 +10787,7 @@
mDisplayContents.put(display.getDisplayId(), displayContent);
}
- public DisplayContent getDisplayContent(final int displayId) {
+ public DisplayContent getDisplayContentLocked(final int displayId) {
DisplayContent displayContent = mDisplayContents.get(displayId);
if (displayContent == null) {
displayContent = new DisplayContent(mDisplayManager.getDisplay(displayId));
@@ -10872,20 +10877,20 @@
}
}
- public DisplayContent getDefaultDisplayContent() {
- return getDisplayContent(Display.DEFAULT_DISPLAY);
+ public DisplayContent getDefaultDisplayContentLocked() {
+ return getDisplayContentLocked(Display.DEFAULT_DISPLAY);
}
- public WindowList getDefaultWindowList() {
- return getDefaultDisplayContent().getWindowList();
+ public WindowList getDefaultWindowListLocked() {
+ return getDefaultDisplayContentLocked().getWindowList();
}
- public DisplayInfo getDefaultDisplayInfo() {
- return getDefaultDisplayContent().getDisplayInfo();
+ public DisplayInfo getDefaultDisplayInfoLocked() {
+ return getDefaultDisplayContentLocked().getDisplayInfo();
}
- public WindowList getWindowList(final Display display) {
- return getDisplayContent(display.getDisplayId()).getWindowList();
+ public WindowList getWindowListLocked(final Display display) {
+ return getDisplayContentLocked(display.getDisplayId()).getWindowList();
}
@Override
@@ -10894,7 +10899,7 @@
}
private void handleDisplayAddedLocked(int displayId) {
- createDisplayContent(mDisplayManager.getDisplay(displayId));
+ createDisplayContentLocked(mDisplayManager.getDisplay(displayId));
}
@Override
@@ -10903,7 +10908,7 @@
}
private void handleDisplayRemovedLocked(int displayId) {
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
mDisplayContents.delete(displayId);
WindowList windows = displayContent.getWindowList();
for (int i = windows.size() - 1; i >= 0; --i) {
@@ -10918,7 +10923,7 @@
}
private void handleDisplayChangedLocked(int displayId) {
- final DisplayContent displayContent = getDisplayContent(displayId);
+ final DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent != null) {
displayContent.updateDisplayInfo();
}