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

Commit a550f9bd authored by Gavin Williams's avatar Gavin Williams
Browse files

Autoclick: Fix panel closing logic

Update to correct method for closing the panel on any outside
clicks.

ABTD run with 20 passing attempts: http://b/435284589#comment4

Bug: 435284589
Test: AutoclickPanelTests
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: I31f42e775324ebbdff376dfb215a73b3eeac93a8
parent a666e955
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -371,6 +371,12 @@ public class AutoclickTypePanel {

    /** Reset panel as collapsed state and only displays selected button. */
    public void collapsePanelWithClickType(@AutoclickType int clickType) {
        // When collapsing the panel show these buttons again.
        if (mIsExpandedPanelWiderThanScreen) {
            mPauseButton.setVisibility(View.VISIBLE);
            mPositionButton.setVisibility(View.VISIBLE);
        }

        hideAllClickTypeButtons();
        final ImageButton selectedButton = getButtonFromClickType(clickType);
        selectedButton.setVisibility(View.VISIBLE);
@@ -486,12 +492,6 @@ public class AutoclickTypePanel {
    /** Toggles the panel expanded or collapsed state. */
    private void togglePanelExpansion(@AutoclickType int clickType) {
        if (mExpanded) {
            // When collapsing the panel show these buttons again.
            if (mIsExpandedPanelWiderThanScreen) {
                mPauseButton.setVisibility(View.VISIBLE);
                mPositionButton.setVisibility(View.VISIBLE);
            }

            // If the panel is already in expanded state, we should collapse it by hiding all
            // buttons except the one user selected.
            collapsePanelWithClickType(clickType);
+0 −2
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -42,7 +41,6 @@ import platform.test.desktop.DesktopMouseTestRule

@RunWith(AndroidJUnit4::class)
@RequiresFlagsEnabled(Flags.FLAG_ENABLE_AUTOCLICK_INDICATOR)
@Ignore("b/435284589")
class AutoclickPanelTests {
    @Rule(order = 0)
    @JvmField