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

Commit 4d4e94ca authored by Julia Tuttle's avatar Julia Tuttle
Browse files

New Pipeline: plumb isChangingPosition

ExpandableNotificationRow has an isChangingPosition flag that's used to
inform the remote input code of when a view is being detached only
briefly as the shade is rearranged, to give it a chance to save and
restore state that would otherwise be discarded.

The new pipeline doesn't currently set and clear this flag, which broke
lifetime extension for notifications with a remote input history (one or
more replies sent), but also kept input focus from being preserved when
a notification is moved.

This change sets and clears the flag in the relevant NodeControllers. It
may or may not render ag/16749051 redundant.

Bug: 211161595
Test: manual, after locally reverting ag/16749051
Change-Id: Ie808a854f6a0bc523dffcc2787818e5765d507ec
parent f278d2d7
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification.collection.render
package com.android.systemui.statusbar.notification.collection.render


import android.view.View
import android.view.View
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
import com.android.systemui.statusbar.notification.stack.NotificationListContainer


@@ -41,6 +42,7 @@ class RootNodeController(
    override fun addChildAt(child: NodeController, index: Int) {
    override fun addChildAt(child: NodeController, index: Int) {
        listContainer.addContainerViewAt(child.view, index)
        listContainer.addContainerViewAt(child.view, index)
        listContainer.onNotificationViewUpdateFinished()
        listContainer.onNotificationViewUpdateFinished()
        (child.view as? ExpandableNotificationRow)?.isChangingPosition = false
    }
    }


    override fun moveChildTo(child: NodeController, index: Int) {
    override fun moveChildTo(child: NodeController, index: Int) {
@@ -50,6 +52,7 @@ class RootNodeController(
    override fun removeChild(child: NodeController, isTransfer: Boolean) {
    override fun removeChild(child: NodeController, isTransfer: Boolean) {
        if (isTransfer) {
        if (isTransfer) {
            listContainer.setChildTransferInProgress(true)
            listContainer.setChildTransferInProgress(true)
            (child.view as? ExpandableNotificationRow)?.isChangingPosition = true
        }
        }
        listContainer.removeContainerView(child.view)
        listContainer.removeContainerView(child.view)
        if (isTransfer) {
        if (isTransfer) {
+6 −0
Original line number Original line Diff line number Diff line
@@ -248,19 +248,25 @@ public class ExpandableNotificationRowController implements NotifViewController


        mView.addChildNotification((ExpandableNotificationRow) child.getView(), index);
        mView.addChildNotification((ExpandableNotificationRow) child.getView(), index);
        mListContainer.notifyGroupChildAdded(childView);
        mListContainer.notifyGroupChildAdded(childView);
        childView.setChangingPosition(false);
    }
    }


    @Override
    @Override
    public void moveChildTo(NodeController child, int index) {
    public void moveChildTo(NodeController child, int index) {
        ExpandableNotificationRow childView = (ExpandableNotificationRow) child.getView();
        ExpandableNotificationRow childView = (ExpandableNotificationRow) child.getView();
        childView.setChangingPosition(true);
        mView.removeChildNotification(childView);
        mView.removeChildNotification(childView);
        mView.addChildNotification(childView, index);
        mView.addChildNotification(childView, index);
        childView.setChangingPosition(false);
    }
    }


    @Override
    @Override
    public void removeChild(NodeController child, boolean isTransfer) {
    public void removeChild(NodeController child, boolean isTransfer) {
        ExpandableNotificationRow childView = (ExpandableNotificationRow) child.getView();
        ExpandableNotificationRow childView = (ExpandableNotificationRow) child.getView();


        if (isTransfer) {
            childView.setChangingPosition(true);
        }
        mView.removeChildNotification(childView);
        mView.removeChildNotification(childView);
        if (!isTransfer) {
        if (!isTransfer) {
            mListContainer.notifyGroupChildRemoved(childView, mView);
            mListContainer.notifyGroupChildRemoved(childView, mView);