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

Commit 238af256 authored by Ivan Chiang's avatar Ivan Chiang
Browse files

Hide the hide internal storage menu in tree mode

Change-Id: I921184f719846982cafa081dcea35c8529944e8e
Fix: 141598381
Test: manual
parent 30414eba
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.documentsui;

import static com.android.documentsui.base.Shared.EXTRA_BENCHMARK;
import static com.android.documentsui.base.SharedMinimal.DEBUG;
import static com.android.documentsui.base.State.ACTION_OPEN_TREE;
import static com.android.documentsui.base.State.MODE_GRID;

import android.content.Intent;
@@ -360,11 +361,13 @@ public abstract class BaseActivity

        includeState(state);

        state.showAdvanced = Shared.mustShowDeviceRoot(intent)
                || mInjector.prefs.getShowDeviceRoot();
        // always show device root in tree mode
        final boolean mustShowDeviceRoot =
                state.action == ACTION_OPEN_TREE || Shared.mustShowDeviceRoot(intent);
        state.showAdvanced = mustShowDeviceRoot || mInjector.prefs.getShowDeviceRoot();

        // Only show the toggle if advanced isn't forced enabled.
        state.showDeviceStorageOption = !Shared.mustShowDeviceRoot(intent);
        state.showDeviceStorageOption = !mustShowDeviceRoot;

        if (DEBUG) {
            Log.d(mTag, "Created new state object: " + state);