summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/wm
diff options
context:
space:
mode:
Diffstat (limited to 'services/core/java/com/android/server/wm')
-rw-r--r--services/core/java/com/android/server/wm/AccessibilityController.java3
-rw-r--r--services/core/java/com/android/server/wm/AppTransition.java3
-rw-r--r--services/core/java/com/android/server/wm/AppWindowAnimator.java2
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java81
4 files changed, 41 insertions, 48 deletions
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java
index 91ce739..482ae24 100644
--- a/services/core/java/com/android/server/wm/AccessibilityController.java
+++ b/services/core/java/com/android/server/wm/AccessibilityController.java
@@ -432,8 +432,7 @@ final class AccessibilityController {
mDrawBorderInset = (int) mBorderWidth / 2;
mWindow = new ViewportWindow(mContext);
- if (mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_windowIsRound)) {
+ if (mContext.getResources().getConfiguration().isScreenRound()) {
mCircularPath = new Path();
mWindowManager.getDefaultDisplay().getRealSize(mTempPoint);
final int centerXY = mTempPoint.x / 2;
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 0357de2..60bbc48 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -325,8 +325,7 @@ public class AppTransition implements Dump {
mListeners.add(listener);
}
- public void notifyAppTransitionFinishedLocked(AppWindowAnimator animator) {
- IBinder token = animator != null ? animator.mAppToken.token : null;
+ public void notifyAppTransitionFinishedLocked(IBinder token) {
for (int i = 0; i < mListeners.size(); i++) {
mListeners.get(i).onAppTransitionFinishedLocked(token);
}
diff --git a/services/core/java/com/android/server/wm/AppWindowAnimator.java b/services/core/java/com/android/server/wm/AppWindowAnimator.java
index 3feec82..2e89385 100644
--- a/services/core/java/com/android/server/wm/AppWindowAnimator.java
+++ b/services/core/java/com/android/server/wm/AppWindowAnimator.java
@@ -345,7 +345,7 @@ public class AppWindowAnimator {
for (int i = 0; i < numAllAppWinAnimators; i++) {
mAllAppWinAnimators.get(i).finishExit();
}
- mService.mAppTransition.notifyAppTransitionFinishedLocked(this);
+ mService.mAppTransition.notifyAppTransitionFinishedLocked(mAppToken.token);
return false;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 22ef801..d956d76 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -252,11 +252,6 @@ public class WindowManagerService extends IWindowManager.Stub
static final int LAYER_OFFSET_DIM = 1;
/**
- * Blur surface layer is immediately below dim layer.
- */
- static final int LAYER_OFFSET_BLUR = 2;
-
- /**
* FocusedStackFrame layer is immediately above focused window.
*/
static final int LAYER_OFFSET_FOCUSED_STACK = 1;
@@ -266,27 +261,12 @@ public class WindowManagerService extends IWindowManager.Stub
* the thumbnail (or in other words as far as possible above the window
* below it).
*/
- static final int LAYER_OFFSET_THUMBNAIL = WINDOW_LAYER_MULTIPLIER-1;
-
- /**
- * Layer at which to put the rotation freeze snapshot.
- */
- static final int FREEZE_LAYER = (TYPE_LAYER_MULTIPLIER * 200) + 1;
-
- /**
- * Layer at which to put the mask for emulated screen sizes.
- */
- static final int MASK_LAYER = TYPE_LAYER_MULTIPLIER * 200;
+ static final int LAYER_OFFSET_THUMBNAIL = WINDOW_LAYER_MULTIPLIER - 1;
/** The maximum length we will accept for a loaded animation duration:
* this is 10 seconds.
*/
- static final int MAX_ANIMATION_DURATION = 10*1000;
-
- /** Amount of time (in milliseconds) to animate the fade-in-out transition for
- * compatible windows.
- */
- static final int DEFAULT_FADE_IN_OUT_DURATION = 400;
+ static final int MAX_ANIMATION_DURATION = 10 * 1000;
/** Amount of time (in milliseconds) to delay before declaring a window freeze timeout. */
static final int WINDOW_FREEZE_TIMEOUT_DURATION = 2000;
@@ -381,48 +361,43 @@ public class WindowManagerService extends IWindowManager.Stub
/**
* All currently active sessions with clients.
*/
- final ArraySet<Session> mSessions = new ArraySet<Session>();
+ final ArraySet<Session> mSessions = new ArraySet<>();
/**
* Mapping from an IWindow IBinder to the server's Window object.
* This is also used as the lock for all of our state.
* NOTE: Never call into methods that lock ActivityManagerService while holding this object.
*/
- final HashMap<IBinder, WindowState> mWindowMap = new HashMap<IBinder, WindowState>();
+ final HashMap<IBinder, WindowState> mWindowMap = new HashMap<>();
/**
* Mapping from a token IBinder to a WindowToken object.
*/
- final HashMap<IBinder, WindowToken> mTokenMap = new HashMap<IBinder, WindowToken>();
+ final HashMap<IBinder, WindowToken> mTokenMap = new HashMap<>();
/**
* List of window tokens that have finished starting their application,
* and now need to have the policy remove their windows.
*/
- final ArrayList<AppWindowToken> mFinishedStarting = new ArrayList<AppWindowToken>();
+ final ArrayList<AppWindowToken> mFinishedStarting = new ArrayList<>();
/**
* Fake windows added to the window manager. Note: ordered from top to
* bottom, opposite of mWindows.
*/
- final ArrayList<FakeWindowImpl> mFakeWindows = new ArrayList<FakeWindowImpl>();
+ final ArrayList<FakeWindowImpl> mFakeWindows = new ArrayList<>();
/**
* Windows that are being resized. Used so we can tell the client about
* the resize after closing the transaction in which we resized the
* underlying surface.
*/
- final ArrayList<WindowState> mResizingWindows = new ArrayList<WindowState>();
+ final ArrayList<WindowState> mResizingWindows = new ArrayList<>();
/**
* Windows whose animations have ended and now must be removed.
*/
- final ArrayList<WindowState> mPendingRemove = new ArrayList<WindowState>();
-
- /**
- * Stacks whose animations have ended and whose tasks, apps, selves may now be removed.
- */
- final ArraySet<TaskStack> mPendingStacksRemove = new ArraySet<TaskStack>();
+ final ArrayList<WindowState> mPendingRemove = new ArrayList<>();
/**
* Used when processing mPendingRemove to avoid working on the original array.
@@ -432,13 +407,13 @@ public class WindowManagerService extends IWindowManager.Stub
/**
* Windows whose surface should be destroyed.
*/
- final ArrayList<WindowState> mDestroySurface = new ArrayList<WindowState>();
+ final ArrayList<WindowState> mDestroySurface = new ArrayList<>();
/**
* Windows that have lost input focus and are waiting for the new
* focus window to be displayed before they are told about this.
*/
- ArrayList<WindowState> mLosingFocus = new ArrayList<WindowState>();
+ ArrayList<WindowState> mLosingFocus = new ArrayList<>();
/**
* This is set when we have run out of memory, and will either be an empty
@@ -449,7 +424,7 @@ public class WindowManagerService extends IWindowManager.Stub
/**
* Windows that clients are waiting to have drawn.
*/
- ArrayList<WindowState> mWaitingForDrawn = new ArrayList<WindowState>();
+ ArrayList<WindowState> mWaitingForDrawn = new ArrayList<>();
/**
* And the callback to make when they've all been drawn.
*/
@@ -466,7 +441,7 @@ public class WindowManagerService extends IWindowManager.Stub
* This array is essentially a cache for all userId for
* {@link android.app.admin.DevicePolicyManager#getScreenCaptureDisabled}
*/
- SparseArray<Boolean> mScreenCaptureDisabled = new SparseArray<Boolean>();
+ SparseArray<Boolean> mScreenCaptureDisabled = new SparseArray<>();
IInputMethodManager mInputMethodManager;
@@ -840,8 +815,7 @@ public class WindowManagerService extends IWindowManager.Stub
boolean mInTouchMode;
private ViewServer mViewServer;
- private final ArrayList<WindowChangeListener> mWindowChangeListeners =
- new ArrayList<WindowChangeListener>();
+ private final ArrayList<WindowChangeListener> mWindowChangeListeners = new ArrayList<>();
private boolean mWindowsChanged = false;
public interface WindowChangeListener {
@@ -859,6 +833,10 @@ public class WindowManagerService extends IWindowManager.Stub
// For example, when this flag is true, there will be no wallpaper service.
final boolean mOnlyCore;
+ // List of clients without a transtiton animation that we notify once we are done transitioning
+ // since they won't be notified through the app window animator.
+ private final List<IBinder> mNoAnimationNotifyOnTransitionFinished = new ArrayList<>();
+
/** Listener to notify activity manager about app transitions. */
private final WindowManagerInternal.AppTransitionListener mActivityManagerAppTransitionNotifier
= new WindowManagerInternal.AppTransitionListener() {
@@ -5926,8 +5904,7 @@ public class WindowManagerService extends IWindowManager.Stub
public void updateCircularDisplayMaskIfNeeded() {
// we're fullscreen and not hosted in an ActivityView
- if (mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_windowIsRound)
+ if (mContext.getResources().getConfiguration().isScreenRound()
&& mContext.getResources().getBoolean(
com.android.internal.R.bool.config_windowShowCircularMask)) {
// Device configuration calls for a circular display mask, but we only enable the mask
@@ -7344,6 +7321,11 @@ public class WindowManagerService extends IWindowManager.Stub
computeSizeRangesAndScreenLayout(displayInfo, rotated, dw, dh, mDisplayMetrics.density,
config);
+ config.screenLayout = (config.screenLayout & ~Configuration.SCREENLAYOUT_ROUND_MASK)
+ | ((displayInfo.flags & Display.FLAG_ROUND) != 0
+ ? Configuration.SCREENLAYOUT_ROUND_YES
+ : Configuration.SCREENLAYOUT_ROUND_NO);
+
config.compatScreenWidthDp = (int)(config.screenWidthDp / mCompatibleScreenScale);
config.compatScreenHeightDp = (int)(config.screenHeightDp / mCompatibleScreenScale);
config.compatSmallestScreenWidthDp = computeCompatSmallestWidth(rotated,
@@ -9224,6 +9206,7 @@ public class WindowManagerService extends IWindowManager.Stub
transit = AppTransition.TRANSIT_UNSET;
}
mSkipAppTransitionAnimation = false;
+ mNoAnimationNotifyOnTransitionFinished.clear();
mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
@@ -9393,7 +9376,13 @@ public class WindowManagerService extends IWindowManager.Stub
appAnimator.animation = null;
}
wtoken.inPendingTransaction = false;
- setTokenVisibilityLocked(wtoken, animLp, true, transit, false, voiceInteraction);
+ if (!setTokenVisibilityLocked(
+ wtoken, animLp, true, transit, false, voiceInteraction)){
+ // This token isn't going to be animating. Add it to the list of tokens to
+ // be notified of app transition complete since the notification will not be
+ // sent be the app window animator.
+ mNoAnimationNotifyOnTransitionFinished.add(wtoken.token);
+ }
wtoken.updateReportedVisibilityLocked();
wtoken.waitingToShow = false;
@@ -9560,6 +9549,12 @@ public class WindowManagerService extends IWindowManager.Stub
mAppTransition.setIdle();
+ for (int i = mNoAnimationNotifyOnTransitionFinished.size() - 1; i >= 0; i--) {
+ final IBinder token = mNoAnimationNotifyOnTransitionFinished.get(i);
+ mAppTransition.notifyAppTransitionFinishedLocked(token);
+ }
+ mNoAnimationNotifyOnTransitionFinished.clear();
+
if (mDeferredHideWallpaper != null) {
hideWallpapersLocked(mDeferredHideWallpaper);
mDeferredHideWallpaper = null;