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

Commit 7cd86981 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Fix RemoteInputView not visible when Reply tapped from AOD" into main

parents c3d7b636 150e981c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -453,6 +453,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
                        setTopMargin(0);
                        if (grandParent != null) grandParent.setClipChildren(true);
                        setVisibility(GONE);
                        setAlpha(1f);
                        if (mWrapper != null) {
                            mWrapper.setRemoteInputVisible(false);
                        }
+29 −1
Original line number Diff line number Diff line
@@ -67,10 +67,10 @@ import androidx.test.filters.SmallTest;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.systemui.Dependency;
import com.android.systemui.res.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.animation.AnimatorTestRule;
import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -448,6 +448,34 @@ public class RemoteInputViewTest extends SysuiTestCase {
        assertEquals(1f, fadeInView.getAlpha());
    }

    @Test
    public void testUnanimatedFocusAfterDefocusAnimation() throws Exception {
        NotificationTestHelper helper = new NotificationTestHelper(
                mContext,
                mDependency,
                TestableLooper.get(this));
        ExpandableNotificationRow row = helper.createRow();
        RemoteInputView view = RemoteInputView.inflate(mContext, null, row.getEntry(), mController);
        bindController(view, row.getEntry());

        FrameLayout parent = new FrameLayout(mContext);
        parent.addView(view);

        // Play defocus animation
        view.onDefocus(true /* animate */, false /* logClose */, null /* doAfterDefocus */);
        mAnimatorTestRule.advanceTimeBy(ANIMATION_DURATION_STANDARD);

        // assert that RemoteInputView is no longer visible, but alpha is reset to 1f
        assertEquals(View.GONE, view.getVisibility());
        assertEquals(1f, view.getAlpha());

        // focus RemoteInputView without an animation
        view.focus();
        // assert that RemoteInputView is visible, and alpha is 1f
        assertEquals(View.VISIBLE, view.getVisibility());
        assertEquals(1f, view.getAlpha());
    }

    // NOTE: because we're refactoring the RemoteInputView and moving logic into the
    // RemoteInputViewController, it's easiest to just test the system of the two classes together.
    @NonNull