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

Commit 8f625d37 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix up crash in MenuManager when selection is active" into main

parents 185a8dd9 d5be7d23
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1535,7 +1535,11 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On
                // For orientation changed case, sometimes the docs loading comes after the menu
                // update. We need to update the menu here to ensure the status is correct.
                mInjector.menuManager.updateModel(mModel);
                if (useMaterial3()) {
                    mActivity.getNavigator().updateActionMenu();
                } else {
                    mInjector.menuManager.updateOptionMenu();
                }
                if (VersionUtils.isAtLeastS()) {
                    mActivity.updateHeader(update.hasCrossProfileException());
                } else {
+15 −0
Original line number Diff line number Diff line
@@ -124,6 +124,21 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> {
        bots.directory.waitForDocument("file1.png");
    }

    @HugeLongTest
    public void testKeyboard_PasteDocumentWhileSelectionActive() throws Exception {
        bots.directory.selectDocument("file1.png", 1);
        bots.keyboard.pressKey(KeyEvent.KEYCODE_C, KeyEvent.META_CTRL_ON);

        device.waitForIdle();
        bots.directory.openDocument("Dir1");
        bots.directory.selectDocument("ChildDir1", 1);

        bots.keyboard.pressKey(KeyEvent.KEYCODE_V, KeyEvent.META_CTRL_ON);
        device.waitForIdle();

        bots.directory.assertDocumentsPresent("file1.png");
    }

    public void testDeleteDocument_Cancel() throws Exception {
        bots.directory.selectDocument("file1.png", 1);
        device.waitForIdle();