From 37b202492e06a0f681864d5d3af643c004c39463 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 26 Sep 2017 11:51:08 -0700 Subject: [PATCH] Minimal change to ensure that position is last saved when docking. - When a task is docked from Recents, the last position is never updated if the user never touches the divider. Ensure that the default dock snap target is saved in this case as well. Bug: 66903645 Test: Dock a task from Recents, go home, and hit recents Change-Id: Ia229d2ba0eee792424fb9e9c043320cec71695dc --- .../SystemUI/src/com/android/systemui/stackdivider/DividerView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 6bfef20c9f53..23a7dae34cfb 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -64,6 +64,7 @@ import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.recents.Recents; import com.android.systemui.recents.events.EventBus; +import com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent; import com.android.systemui.recents.events.activity.DockedTopTaskEvent; import com.android.systemui.recents.events.activity.RecentsActivityStartingEvent; import com.android.systemui.recents.events.activity.UndockingTaskEvent; @@ -1210,6 +1211,10 @@ public class DividerView extends FrameLayout implements OnTouchListener, } } + public final void onBusEvent(DockedFirstAnimationFrameEvent event) { + saveSnapTargetBeforeMinimized(mSnapAlgorithm.getMiddleTarget()); + } + public final void onBusEvent(DockedTopTaskEvent event) { if (event.dragMode == NavigationBarGestureHelper.DRAG_MODE_NONE) { mState.growAfterRecentsDrawn = false; -- 2.11.0