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

Commit ba64bbe3 authored by Riley Jones's avatar Riley Jones
Browse files

Removing title argument for shortcut edit page

Bug: 323388734
Test: Tests adjusted to avoid navigating to shortcut edit page
Flag: NONE
Change-Id: I27472abe3a22a28ea4222481ad5ecb42ffd8a055
parent c2e6798e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -111,8 +111,9 @@ public final class AccessibilityTargetHelper {
     * @param context The context of the application.
     * @param shortcutType The shortcut type.
     * @return The list of {@link AccessibilityTarget}.
     * @hide
     */
    static List<AccessibilityTarget> getInstalledTargets(Context context,
    public static List<AccessibilityTarget> getInstalledTargets(Context context,
            @ShortcutType int shortcutType) {
        final List<AccessibilityTarget> targets = new ArrayList<>();
        targets.addAll(getAccessibilityFilteredTargets(context, shortcutType));
+0 −3
Original line number Diff line number Diff line
@@ -464,9 +464,6 @@ class MenuView extends FrameLayout implements
        Bundle fragmentArgs = new Bundle();
        fragmentArgs.putStringArray("targets", targets.toArray(new String[0]));
        args.putBundle(":settings:show_fragment_args", fragmentArgs);
        // TODO: b/318748373 - The fragment should set its own title using the targets
        args.putString(
                ":settings:show_fragment_title", "Accessibility Shortcut");
        intent.replaceExtras(args);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        return intent;
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.ACTIO

import static com.google.common.truth.Truth.assertThat;

import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -89,6 +90,7 @@ public class MenuItemAccessibilityDelegateTest extends SysuiTestCase {
        mMenuView = spy(new MenuView(mContext, stubMenuViewModel, stubMenuViewAppearance,
                mSecureSettings));
        mMenuView.setTranslationY(halfScreenHeight);
        doNothing().when(mMenuView).gotoEditScreen();

        mMenuViewLayer = spy(new MenuViewLayer(
                mContext, stubWindowManager, mAccessibilityManager,
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ public class MenuViewLayerTest extends SysuiTestCase {
                new MenuView(mSpyContext, mMenuViewModel, menuViewAppearance, mSecureSettings));
        // Ensure tests don't actually update metrics.
        doNothing().when(mMenuView).incrementTexMetric(any(), anyInt());
        doNothing().when(mMenuView).gotoEditScreen();

        mMenuViewLayer = spy(new MenuViewLayer(mSpyContext, mStubWindowManager,
                mStubAccessibilityManager, mMenuViewModel, menuViewAppearance, mMenuView,
+2 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.app.UiModeManager.MODE_NIGHT_YES;
import static com.google.common.truth.Truth.assertThat;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;

@@ -80,6 +81,7 @@ public class MenuViewTest extends SysuiTestCase {
        mUiModeManager.setNightMode(MODE_NIGHT_YES);

        mSpyContext = spy(mContext);
        doNothing().when(mSpyContext).startActivity(any());
        final SecureSettings secureSettings = TestUtils.mockSecureSettings();
        final MenuViewModel stubMenuViewModel = new MenuViewModel(mContext, mAccessibilityManager,
                secureSettings);
@@ -179,8 +181,6 @@ public class MenuViewTest extends SysuiTestCase {
    @Test
    @EnableFlags(Flags.FLAG_FLOATING_MENU_DRAG_TO_EDIT)
    public void gotoEditScreen_sendsIntent() {
        // Notably, this shouldn't crash the settings app,
        // because the button target args are configured.
        mMenuView.gotoEditScreen();
        verify(mSpyContext).startActivity(any());
    }