Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e87ac08f authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Mark home-launch as transient for drag-to-desktop transition.

Bug: 379851953
Test: manual - drag Drive app into Desktop Mode without a user account
Flag: com.android.window.flags.enable_desktop_windowing_mode

Change-Id: I0133ff85a47d03374f5a2cd65d171479bb3f7d99
parent e6f0a017
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ import android.content.Intent
import android.content.Intent.FILL_IN_COMPONENT
import android.graphics.PointF
import android.graphics.Rect
import android.os.Bundle
import android.os.IBinder
import android.os.SystemClock
import android.os.SystemProperties
@@ -139,7 +138,11 @@ sealed class DragToDesktopTransitionHandler(
                taskUser,
            )
        val wct = WindowContainerTransaction()
        wct.sendPendingIntent(pendingIntent, launchHomeIntent, Bundle())
        // The app that is being dragged into desktop mode might cause new transitions, make this
        // launch transient to make sure those transitions can execute in parallel and thus won't
        // block the end-drag transition.
        val intentOptions = ActivityOptions.makeBasic().setTransientLaunch()
        wct.sendPendingIntent(pendingIntent, launchHomeIntent, intentOptions.toBundle())
        val startTransitionToken =
            transitions.startTransition(TRANSIT_DESKTOP_MODE_START_DRAG_TO_DESKTOP, wct, this)

+6 −2
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewRootImpl;
import android.view.WindowManager;
import android.window.DesktopModeFlags;
import android.window.TaskSnapshot;
@@ -965,8 +966,11 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
            }
            if (mInputManager != null
                    && !Flags.enableAccessibleCustomHeaders()) {
                ViewRootImpl viewRootImpl = v.getViewRootImpl();
                if (viewRootImpl != null) {
                    // Pilfer so that windows below receive cancellations for this gesture.
                mInputManager.pilferPointers(v.getViewRootImpl().getInputToken());
                    mInputManager.pilferPointers(viewRootImpl.getInputToken());
                }
            }
            if (isUpOrCancel) {
                // Gesture is finished, reset state.