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

Commit d31546c9 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Merge "Don\'t dock tasks that are non-dockable" into nyc-dev

am: f2d7b281

* commit 'f2d7b281':
  Don't dock tasks that are non-dockable
parents ba13fb8b f2d7b281
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1575,6 +1575,7 @@ public class ActivityManager {
                    Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
            dest.writeInt(numActivities);
            dest.writeInt(numRunning);
            dest.writeInt(isDockable ? 1 : 0);
        }

        public void readFromParcel(Parcel source) {
@@ -1590,6 +1591,7 @@ public class ActivityManager {
            description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
            numActivities = source.readInt();
            numRunning = source.readInt();
            isDockable = source.readInt() != 0;
        }

        public static final Creator<RunningTaskInfo> CREATOR = new Creator<RunningTaskInfo>() {
+26 −17
Original line number Diff line number Diff line
@@ -35,9 +35,11 @@ import android.util.EventLog;
import android.util.Log;
import android.view.Display;
import android.view.View;
import android.widget.Toast;

import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
import com.android.systemui.R;
import com.android.systemui.RecentsComponent;
import com.android.systemui.SystemUI;
import com.android.systemui.recents.events.EventBus;
@@ -393,6 +395,7 @@ public class Recents extends SystemUI
        boolean screenPinningActive = ssp.isScreenPinningActive();
        boolean isTopTaskHome = topTask != null && SystemServicesProxy.isHomeStack(topTask.stackId);
        if (topTask != null && !isTopTaskHome && !screenPinningActive) {
            if (topTask.isDockable) {
                if (sSystemServicesProxy.isSystemUser(currentUser)) {
                    mImpl.dockTopTask(topTask.id, dragMode, stackCreateMode, initialBounds);
                } else {
@@ -413,9 +416,15 @@ public class Recents extends SystemUI
                }
                mDraggingInRecentsCurrentUser = currentUser;
                return true;
            } else {
                Toast.makeText(mContext, R.string.recents_drag_non_dockable_task_message,
                        Toast.LENGTH_SHORT).show();
                return false;
            }
        } else {
            return false;
        }
    }

    @Override
    public void onDraggingInRecents(float distanceFromTop) {