OSDN Git Service

Fixing issue where the configuration can have stale docked state.
authorWinson <winsonc@google.com>
Tue, 1 Dec 2015 02:43:43 +0000 (18:43 -0800)
committerWinson Chung <winsonc@google.com>
Tue, 1 Dec 2015 17:18:33 +0000 (17:18 +0000)
- Fixing issue where you could not drag after undocking a task while
  Overview is open, since we did not update the docked state.  We can
  just read the state directly in that case.

Change-Id: I5d2844edf024ba379e13be1a625bda8579d971b1

packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java

index 440ed6b..cdfad18 100644 (file)
@@ -69,7 +69,6 @@ public class RecentsConfiguration {
     public final int smallestWidth;
 
     /** Misc **/
-    public boolean hasDockedTasks;
     public boolean useHardwareLayers;
     public boolean fakeShadows;
     public int svelteLevel;
@@ -112,7 +111,6 @@ public class RecentsConfiguration {
         // settings or via multi window
         lockToAppEnabled = !ssp.hasFreeformWorkspaceSupport() &&
                 ssp.getSystemSetting(context, Settings.System.LOCK_TO_APP_ENABLED) != 0;
-        hasDockedTasks = ssp.hasDockedTask();
 
         // Recompute some values based on the given state, since we can not rely on the resource
         // system to get certain values.
index c55f383..2920295 100644 (file)
@@ -27,6 +27,7 @@ import com.android.systemui.recents.events.ui.dragndrop.DragEndEvent;
 import com.android.systemui.recents.events.ui.dragndrop.DragStartEvent;
 import com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent;
 import com.android.systemui.recents.misc.ReferenceCountedTrigger;
+import com.android.systemui.recents.misc.SystemServicesProxy;
 import com.android.systemui.recents.model.Task;
 import com.android.systemui.recents.model.TaskStack;
 
@@ -111,6 +112,7 @@ public class RecentsViewTouchHandler {
     /**** Events ****/
 
     public final void onBusEvent(DragStartEvent event) {
+        SystemServicesProxy ssp = Recents.getSystemServices();
         mRv.getParent().requestDisallowInterceptTouchEvent(true);
         mDragging = true;
         mDragTask = event.task;
@@ -127,7 +129,7 @@ public class RecentsViewTouchHandler {
         mTaskView.setTranslationY(y);
 
         RecentsConfiguration config = Recents.getConfiguration();
-        if (!config.hasDockedTasks) {
+        if (!ssp.hasDockedTask()) {
             // Add the dock state drop targets (these take priority)
             TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
             for (TaskStack.DockState dockState : dockStates) {