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

Commit f82bbcda authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[Inline Reply] Stop inflating remote input view for heads up

RemoteInputView is not needed since we only want to show it on expanded. This CL stops inflating and using remote input view on heads up.

Bug: 346976443
Test: Presubmit and manual. Send a heads up notification with Notify. Click Reply and observe notification is expanded and remote input view is activated. Click collapse button and observe keyboard is closed.
Flag: com.android.systemui.expand_heads_up_on_inline_reply
Change-Id: I4c65a713ae7fad63fe4cb33f01d91a723b599cec
parent 6daed618
Loading
Loading
Loading
Loading
+34 −22
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import com.android.systemui.statusbar.notification.row.shared.AsyncHybridViewInf
import com.android.systemui.statusbar.notification.row.wrapper.NotificationCustomViewWrapper;
import com.android.systemui.statusbar.notification.row.wrapper.NotificationHeaderViewWrapper;
import com.android.systemui.statusbar.notification.row.wrapper.NotificationViewWrapper;
import com.android.systemui.statusbar.phone.ExpandHeadsUpOnInlineReply;
import com.android.systemui.statusbar.policy.InflatedSmartReplyState;
import com.android.systemui.statusbar.policy.InflatedSmartReplyViewHolder;
import com.android.systemui.statusbar.policy.RemoteInputView;
@@ -913,8 +914,10 @@ public class NotificationContentView extends FrameLayout implements Notification
                View visibleView = getViewForVisibleType(visibleType);
                if (visibleView != null) {
                    visibleView.setVisibility(VISIBLE);
                    if (!ExpandHeadsUpOnInlineReply.isEnabled()) {
                        transferRemoteInputFocus(visibleType);
                    }
                }

                if (animate && ((visibleType == VISIBLE_TYPE_EXPANDED && mExpandedChild != null)
                        || (visibleType == VISIBLE_TYPE_HEADSUP && mHeadsUpChild != null)
@@ -1397,8 +1400,16 @@ public class NotificationContentView extends FrameLayout implements Notification
        mCachedExpandedRemoteInput = null;
        mCachedExpandedRemoteInputViewController = null;

        if (ExpandHeadsUpOnInlineReply.isEnabled()) {
            mHeadsUpRemoteInput = null;
            mHeadsUpRemoteInputController = null;
            mCachedHeadsUpRemoteInput = null;
            mCachedHeadsUpRemoteInputViewController = null;
        } else {
            ExpandHeadsUpOnInlineReply.assertInLegacyMode();
            if (mHeadsUpChild != null) {
            RemoteInputViewData headsUpData = applyRemoteInput(mHeadsUpChild, mNotificationEntry,
                RemoteInputViewData headsUpData = applyRemoteInput(mHeadsUpChild,
                        mNotificationEntry,
                        hasFreeformRemoteInput, mPreviousHeadsUpRemoteInputIntent,
                        mCachedHeadsUpRemoteInput, mCachedHeadsUpRemoteInputViewController,
                        mHeadsUpWrapper);
@@ -1422,6 +1433,7 @@ public class NotificationContentView extends FrameLayout implements Notification
            mCachedHeadsUpRemoteInput = null;
            mCachedHeadsUpRemoteInputViewController = null;
        }
    }

    private RemoteInputViewData applyRemoteInput(View view, NotificationEntry entry,
            boolean hasRemoteInput, PendingIntent existingPendingIntent, RemoteInputView cachedView,