import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.INPUT_CONSUMER_NAVIGATION;
import static android.view.WindowManager.INPUT_CONSUMER_PIP;
-import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
import static android.view.WindowManager.INPUT_CONSUMER_WALLPAPER;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS;
private boolean mAddInputConsumerHandle;
private boolean mAddPipInputConsumerHandle;
private boolean mAddWallpaperInputConsumerHandle;
- private boolean mAddRecentsAnimationInputConsumerHandle;
private boolean mDisableWallpaperTouchEvents;
private final Rect mTmpRect = new Rect();
private final UpdateInputForAllWindowsConsumer mUpdateInputForAllWindowsConsumer =
InputConsumerImpl navInputConsumer;
InputConsumerImpl pipInputConsumer;
InputConsumerImpl wallpaperInputConsumer;
- InputConsumerImpl recentsAnimationInputConsumer;
+ Rect pipTouchableBounds;
boolean inDrag;
WallpaperController wallpaperController;
navInputConsumer = getInputConsumer(INPUT_CONSUMER_NAVIGATION, DEFAULT_DISPLAY);
pipInputConsumer = getInputConsumer(INPUT_CONSUMER_PIP, DEFAULT_DISPLAY);
wallpaperInputConsumer = getInputConsumer(INPUT_CONSUMER_WALLPAPER, DEFAULT_DISPLAY);
- recentsAnimationInputConsumer = getInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION,
- DEFAULT_DISPLAY);
mAddInputConsumerHandle = navInputConsumer != null;
mAddPipInputConsumerHandle = pipInputConsumer != null;
mAddWallpaperInputConsumerHandle = wallpaperInputConsumer != null;
- mAddRecentsAnimationInputConsumerHandle = recentsAnimationInputConsumer != null;
mTmpRect.setEmpty();
+ pipTouchableBounds = mAddPipInputConsumerHandle ? mTmpRect : null;
mDisableWallpaperTouchEvents = false;
this.inDrag = inDrag;
wallpaperController = mService.mRoot.mWallpaperController;
final boolean hasFocus = w == mInputFocus;
final boolean isVisible = w.isVisibleLw();
- if (mAddRecentsAnimationInputConsumerHandle) {
- final RecentsAnimationController recentsAnimationController =
- mService.getRecentsAnimationController();
- if (recentsAnimationController != null
- && recentsAnimationController.hasInputConsumerForApp(w.mAppToken)) {
- if (recentsAnimationController.updateInputConsumerForApp(
- recentsAnimationInputConsumer, hasFocus)) {
- addInputWindowHandle(recentsAnimationInputConsumer.mWindowHandle);
- mAddRecentsAnimationInputConsumerHandle = false;
- }
- // Skip adding the window below regardless of whether there is an input consumer
- // to handle it
- return;
- }
- }
-
if (w.inPinnedWindowingMode()) {
if (mAddPipInputConsumerHandle
&& (inputWindowHandle.layer <= pipInputConsumer.mWindowHandle.layer)) {
// Update the bounds of the Pip input consumer to match the window bounds.
- w.getBounds(mTmpRect);
- pipInputConsumer.mWindowHandle.touchableRegion.set(mTmpRect);
+ w.getBounds(pipTouchableBounds);
+ pipInputConsumer.mWindowHandle.touchableRegion.set(pipTouchableBounds);
addInputWindowHandle(pipInputConsumer.mWindowHandle);
mAddPipInputConsumerHandle = false;
}
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
-import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
// enabled for it to start intercepting touch events.
private boolean mInputConsumerEnabled;
- private Rect mTmpRect = new Rect();
-
public interface RecentsAnimationCallbacks {
void onAnimationFinished(boolean moveHomeToTop);
}
mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
mService.scheduleAnimationLocked();
- mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION);
}
void checkAnimationReady(WallpaperController wallpaperController) {
&& isHomeAppOverWallpaper();
}
- boolean hasInputConsumerForApp(AppWindowToken appToken) {
- return mInputConsumerEnabled && isAnimatingApp(appToken);
- }
-
- boolean updateInputConsumerForApp(InputConsumerImpl recentsAnimationInputConsumer,
- boolean hasFocus) {
- // Update the input consumer touchable region to match the home app main window
- final WindowState homeAppMainWindow = mHomeAppToken != null
- ? mHomeAppToken.findMainWindow()
- : null;
- if (homeAppMainWindow != null) {
- homeAppMainWindow.getBounds(mTmpRect);
- recentsAnimationInputConsumer.mWindowHandle.hasFocus = hasFocus;
- recentsAnimationInputConsumer.mWindowHandle.touchableRegion.set(mTmpRect);
- return true;
+ boolean isHomeAppOverWallpaper() {
+ if (mHomeAppToken == null) {
+ return false;
}
- return false;
+ return mHomeAppToken.windowsCanBeWallpaperTarget();
}
- private boolean isHomeAppOverWallpaper() {
+ WindowState getHomeAppMainWindow() {
if (mHomeAppToken == null) {
- return false;
+ return null;
}
- return mHomeAppToken.windowsCanBeWallpaperTarget();
+ return mHomeAppToken.findMainWindow();
}
- private boolean isAnimatingApp(AppWindowToken appToken) {
+ boolean isAnimatingApp(AppWindowToken appToken) {
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
final Task task = mPendingAnimations.get(i).mTask;
for (int j = task.getChildCount() - 1; j >= 0; j--) {
return false;
}
+ boolean isInputConsumerEnabled() {
+ return mInputConsumerEnabled;
+ }
+
private class TaskAnimationAdapter implements AnimationAdapter {
private Task mTask;