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

Commit 7d5dba0a authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Fix back callback not unregistered by RemoteInputView

Bug: 424009004
Test: Manual, i.e. verified with numerous RemoteInputView use cases
      that back callback is correctly unregistered
Flag: EXEMPT bugfix
Change-Id: If732b51e8c849b39e3a23768cc4e1625663a311b
parent d40f9b88
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ import com.android.systemui.Dependency;
import com.android.systemui.Flags;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.RemoteInputEntryAdapter;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.wrapper.NotificationViewWrapper;
@@ -535,6 +534,8 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        if (mRow.isChangingPosition() || isTemporarilyDetached()) {
            return;
        }
        unregisterBackCallback();

        // RemoteInputView can be detached from window before IME close event in some cases like
        // remote input view removal with notification update. As a result of this, RemoteInputView
        // will stop ime animation updates, which results in never removing remote input. That's why
@@ -1014,6 +1015,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
                        mRemoteInputView.mRemoteInputEntryAdapter.setRemoteInputText(getText());
                    }
                }
                if (mRemoteInputView != null) {
                    mRemoteInputView.unregisterBackCallback();
                }
                return;
            }
            if (isFocusable() && isEnabled()) {