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

Commit 24dfabc8 authored by Steve McKay's avatar Steve McKay
Browse files

Always show new window command.

Was behind flag, but should be generally accessible.

Change-Id: I32cbc3f34bd5f209552ef994abb95cc3fe347009
parent f414bbae
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -303,12 +303,6 @@ public abstract class MenuManager {
            mActivity = activity;
        }

        // TODO: Inject necessary deps directly into MenuManager, rather than
        // getting this info indirectly via DirectoryDetails.
        public boolean isProductivityModeEnabled() {
            return Shared.isProductivityMode(mActivity);
        }

        public boolean hasRootSettings() {
            return mActivity.getCurrentRoot().hasSettings();
        }
+1 −8
Original line number Diff line number Diff line
@@ -230,18 +230,11 @@ public final class Shared {
        }
    }

    /*
     * Returns true if app is running in "productivity mode".
     */
    public static boolean isProductivityMode(Context context) {
        return context.getResources().getBoolean(R.bool.productivity_device);
    }

    /*
     * Returns true if "Documents" root should be shown.
     */
    public static boolean shouldShowDocumentsRoot(Context context) {
        return isProductivityMode(context);
        return context.getResources().getBoolean(R.bool.productivity_device);
    }

    /*
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public final class MenuManager extends com.android.documentsui.MenuManager {

    @Override
    protected void updateNewWindow(MenuItem newWindow) {
        newWindow.setVisible(mDirDetails.isProductivityModeEnabled());
        newWindow.setVisible(true);
    }

    @Override
+0 −6
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import com.android.documentsui.MenuManager.DirectoryDetails;
 */
public class TestDirectoryDetails extends DirectoryDetails {

    public boolean shouldShowFancyFeatures;
    public boolean isInRecents;
    public boolean hasRootSettings;
    public boolean hasItemsToPaste;
@@ -34,11 +33,6 @@ public class TestDirectoryDetails extends DirectoryDetails {
        super(null);
    }

    @Override
    public boolean isProductivityModeEnabled() {
        return shouldShowFancyFeatures;
    }

    @Override
    public boolean hasRootSettings() {
        return hasRootSettings;
+0 −8
Original line number Diff line number Diff line
@@ -196,14 +196,6 @@ public final class MenuManagerTest {
        settings.assertVisible();
    }

    @Test
    public void testOptionMenu_shouldShowFancyFeatures() {
        dirDetails.shouldShowFancyFeatures = true;
        mgr.updateOptionMenu(testMenu);

        newWindow.assertVisible();
    }

    @Test
    public void testInflateContextMenu_Files() {
        TestMenuInflater inflater = new TestMenuInflater();