Ignore touches in taskbar and all apps windows during system drag.

Touches are ignored as soon as we want to start system drag so that system drag can start sooner (i.e. before any AbstractFloatingView animations finish). This approach utilizes ViewTreeObserverWrapper's compute insets listener by temporarily setting the touch region to empty. The taskbar window remains fullscreen until the drag finishes so the touch region is reset at the right point. Similarly, the all apps window is kept open during its drag operations until the drag finishes. System drag state is now exposed through the drag controller to skip predrag.

Test: Manual by dragging to split screen and triggering dismissal
animation from both windows. Verified predrag works.
Fix: 221104066
Fix: 220070070

Change-Id: I424106269c841f58cbe5338d30b6c33fbd889019
This commit is contained in:
Brian Isganitis
2022-02-24 18:57:59 -08:00
parent 281182739a
commit 1bc23b7662
7 changed files with 70 additions and 7 deletions

View File

@@ -17,6 +17,8 @@ package com.android.launcher3.taskbar.allapps;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import android.content.Context;
import android.graphics.PixelFormat;
import android.view.Gravity;
@@ -129,11 +131,16 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList
}
/**
* Removes the all apps window from the hierarchy.
* Removes the all apps window from the hierarchy, if all floating views are closed and there is
* no system drag operation in progress.
* <p>
* This method should be called after an exit animation finishes, if applicable.
*/
void closeWindow() {
void maybeCloseWindow() {
if (AbstractFloatingView.getOpenView(mAllAppsContext, TYPE_ALL) != null
|| mAllAppsContext.getDragController().isSystemDragInProgress()) {
return;
}
mProxyView.close(false);
mTaskbarContext.removeOnDeviceProfileChangeListener(this);
Optional.ofNullable(mAllAppsContext)