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

Commit 353dbba5 authored by Ben Lin's avatar Ben Lin
Browse files

Proper shutdown of ActionMode when selecting roots.

When going to other roots, we refresh the whole directory, which will
also refresh ActionMode. The assertion will fail if there was a previous
selection, and if we didn't do proper shut down beforehand.

Bug: 34771762
Bug: 34712136

Test: New FilesActivityUiTest#testNavigate_whileHasSelection
Change-Id: I3cfe094ccaa5d4f343f91e469791e7d1ebfe792f
parent 4ffb79a4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -268,6 +268,7 @@ public abstract class BaseActivity
            return;
        }

        mInjector.actionModeController.finishActionMode();
        mState.derivedMode = LocalPreferences.getViewMode(this, root, MODE_GRID);
        mSortController.onViewModeChanged(mState.derivedMode);

+10 −0
Original line number Diff line number Diff line
@@ -86,6 +86,16 @@ public class FilesActivityUiTest extends ActivityTest<FilesActivity> {
        bots.directory.waitForDocument(dirName1);
    }

    public void testNavigate_whileHasSelection() throws Exception {

        bots.roots.openRoot(rootDir0.title);
        device.waitForIdle();
        bots.directory.selectDocument("file0.log", 1);

        // ensure no exception is thrown while navigating to a different root
        bots.roots.openRoot(rootDir1.title);
    }

    public void testRootChange_UpdatesSortHeader() throws Exception {

        // switch to separate display modes for two separate roots. Each