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

Commit 534e8549 authored by Matthew Ng's avatar Matthew Ng
Browse files

Prevent dismiss divider going minimized to recents for other users

The bus event DockedFirstAnimationFrameEvent was not fired to
DividerView from secondary to system user so the last snap target for
DividerView was not recorded instead the bottom of the screen was the
last target. Since the bottom of the screen is last recorded, when
unminimizing, the dividerview goes to the bottom of the screen and
dismisses. This is fixed by piping the event from the secondary to
system user so that DividerView can get the event.

Fixes: 67326180
Test: manual - go to secondary user, drag to dock and minimize, press
recents button
Change-Id: Icd7497c49826d04dc907ef2eff3a5248e78ef67b
parent 959516a8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,5 +31,6 @@ oneway interface IRecentsSystemUserCallbacks {
    void sendRecentsDrawnEvent();
    void sendDockingTopTaskEvent(int dragMode, in Rect initialRect);
    void sendLaunchRecentsEvent();
    void sendDockedFirstAnimationFrameEvent();
    void setWaitingForTransitionStartEvent(boolean waitingForTransitionStart);
}
+18 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.systemui.RecentsComponent;
import com.android.systemui.SystemUI;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
import com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent;
import com.android.systemui.recents.events.activity.DockedTopTaskEvent;
import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
import com.android.systemui.recents.events.activity.RecentsActivityStartingEvent;
@@ -596,6 +597,23 @@ public class Recents extends SystemUI
        }
    }

    public final void onBusEvent(DockedFirstAnimationFrameEvent event) {
        SystemServicesProxy ssp = Recents.getSystemServices();
        int processUser = ssp.getProcessUser();
        if (!ssp.isSystemUser(processUser)) {
            postToSystemUser(new Runnable() {
                @Override
                public void run() {
                    try {
                        mUserToSystemCallbacks.sendDockedFirstAnimationFrameEvent();
                    } catch (RemoteException e) {
                        Log.e(TAG, "Callback failed", e);
                    }
                }
            });
        }
    }

    /**
     * Handle screen pinning request.
     */
+6 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.util.SparseArray;
import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
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.component.SetWaitingForTransitionStartEvent;
@@ -107,6 +108,11 @@ public class RecentsSystemUser extends IRecentsSystemUserCallbacks.Stub {
        EventBus.getDefault().post(new RecentsActivityStartingEvent());
    }

    @Override
    public void sendDockedFirstAnimationFrameEvent() throws RemoteException {
        EventBus.getDefault().post(new DockedFirstAnimationFrameEvent());
    }

    @Override
    public void setWaitingForTransitionStartEvent(boolean waitingForTransitionStart) {
        EventBus.getDefault().post(new SetWaitingForTransitionStartEvent(