diff options
author | 2020-01-10 17:10:04 +0800 | |
---|---|---|
committer | 2020-02-03 15:53:06 +0800 | |
commit | 7e43bf156fbbe2328676f37c61db9bbbcf39efa9 (patch) | |
tree | ebe4e4031bd5d250cd9feac3bffbb32e1e925e6e | |
parent | 2fe45775d8b410e2689edac06a1e43fbcb26d49b (diff) |
Remove show internal storage menu item
Remove it and always show internal storage on drawer.
For global search, let it search all providers but exclude storage
providers to avoid duplicate content.
Bug: 142034844
Test: manual
Test: atest DocumentsUIGoogleTests
Change-Id: I6faff4d9a295df762710033b292fdb8610701e17
15 files changed, 20 insertions, 179 deletions
diff --git a/res/menu/activity.xml b/res/menu/activity.xml index 9e2fdd66f..e6fc1d4a2 100644 --- a/res/menu/activity.xml +++ b/res/menu/activity.xml @@ -67,10 +67,6 @@ android:visible="false" app:showAsAction="never"/> <item - android:id="@+id/option_menu_advanced" - android:visible="false" - app:showAsAction="never"/> - <item android:id="@+id/option_menu_settings" android:title="@string/menu_settings" android:visible="false" diff --git a/src/com/android/documentsui/BaseActivity.java b/src/com/android/documentsui/BaseActivity.java index fe903a4e1..b5340b95b 100644 --- a/src/com/android/documentsui/BaseActivity.java +++ b/src/com/android/documentsui/BaseActivity.java @@ -18,7 +18,6 @@ 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; @@ -65,7 +64,6 @@ import com.android.documentsui.dirlist.DirectoryFragment; import com.android.documentsui.prefs.LocalPreferences; import com.android.documentsui.prefs.Preferences; import com.android.documentsui.prefs.PreferencesMonitor; -import com.android.documentsui.prefs.ScopedPreferences; import com.android.documentsui.queries.CommandInterceptor; import com.android.documentsui.queries.SearchChipData; import com.android.documentsui.queries.SearchFragment; @@ -281,11 +279,6 @@ public abstract class BaseActivity // just limits the scope of what we expect to come flowing // through here until we know we want more and fancier options. assert(Preferences.shouldBackup(pref)); - - switch (pref) { - case ScopedPreferences.INCLUDE_DEVICE_ROOT: - updateDisplayAdvancedDevices(mInjector.prefs.getShowDeviceRoot()); - } } @Override @@ -360,14 +353,6 @@ public abstract class BaseActivity includeState(state); - // 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 = !mustShowDeviceRoot; - if (DEBUG) { Log.d(mTag, "Created new state object: " + state); } @@ -460,10 +445,6 @@ public abstract class BaseActivity // SearchViewManager listens for this directly. return false; - case R.id.option_menu_advanced: - onDisplayAdvancedDevices(); - return true; - case R.id.option_menu_select_all: getInjector().actions.selectAllFiles(); return true; @@ -602,28 +583,6 @@ public abstract class BaseActivity } /** - * Set internal storage visible based on explicit user action. - */ - private void onDisplayAdvancedDevices() { - boolean display = !mState.showAdvanced; - Metrics.logUserAction(display - ? MetricConsts.USER_ACTION_SHOW_ADVANCED : MetricConsts.USER_ACTION_HIDE_ADVANCED); - - mInjector.prefs.setShowDeviceRoot(display); - updateDisplayAdvancedDevices(display); - } - - private void updateDisplayAdvancedDevices(boolean display) { - mState.showAdvanced = display; - @Nullable RootsFragment fragment = RootsFragment.get(getSupportFragmentManager()); - if (fragment != null) { - // This also takes care of updating launcher shortcuts (which are roots :) - fragment.onDisplayStateChanged(); - } - invalidateOptionsMenu(); - } - - /** * Set mode based on explicit user action. */ void setViewMode(@ViewMode int mode) { diff --git a/src/com/android/documentsui/GlobalSearchLoader.java b/src/com/android/documentsui/GlobalSearchLoader.java index 073b3d0f3..a8eca057d 100644 --- a/src/com/android/documentsui/GlobalSearchLoader.java +++ b/src/com/android/documentsui/GlobalSearchLoader.java @@ -69,13 +69,9 @@ public class GlobalSearchLoader extends MultiRootDocumentsLoader { return true; } - // If the value of showAdvanced is true, - // don't query media roots and downloads root to avoid showing - // duplicated files. - if (mState.showAdvanced && (root.isLibrary() || root.isDownloads())) { - return true; - } - return false; + // To prevent duplicate files on search result, ignore storage root because its almost + // files include in media root. + return root.isStorage(); } @Override diff --git a/src/com/android/documentsui/MenuManager.java b/src/com/android/documentsui/MenuManager.java index 505cb3727..ce8dee530 100644 --- a/src/com/android/documentsui/MenuManager.java +++ b/src/com/android/documentsui/MenuManager.java @@ -92,7 +92,6 @@ public abstract class MenuManager { updateSettings(mOptionMenu.findItem(R.id.option_menu_settings)); updateSelectAll(mOptionMenu.findItem(R.id.option_menu_select_all)); updateNewWindow(mOptionMenu.findItem(R.id.option_menu_new_window)); - updateAdvanced(mOptionMenu.findItem(R.id.option_menu_advanced)); updateDebug(mOptionMenu.findItem(R.id.option_menu_debug)); updateInspect(mOptionMenu.findItem(R.id.option_menu_inspect)); updateSort(mOptionMenu.findItem(R.id.option_menu_sort)); @@ -258,12 +257,6 @@ public abstract class MenuManager { list.setVisible(mState.derivedMode != State.MODE_LIST); } - protected void updateAdvanced(MenuItem advanced) { - advanced.setVisible(mState.showDeviceStorageOption); - advanced.setTitle(mState.showDeviceStorageOption && mState.showAdvanced - ? R.string.menu_advanced_hide : R.string.menu_advanced_show); - } - protected void updateSort(MenuItem sort) { sort.setVisible(true); } diff --git a/src/com/android/documentsui/ShortcutsUpdater.java b/src/com/android/documentsui/ShortcutsUpdater.java index 7da937159..4fe490727 100644 --- a/src/com/android/documentsui/ShortcutsUpdater.java +++ b/src/com/android/documentsui/ShortcutsUpdater.java @@ -15,14 +15,14 @@ */ package com.android.documentsui; -import androidx.annotation.DrawableRes; import android.content.Context; import android.content.Intent; import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutManager; import android.graphics.drawable.Icon; -import com.android.documentsui.R; +import androidx.annotation.DrawableRes; + import com.android.documentsui.base.Providers; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.Shared; @@ -93,9 +93,7 @@ public final class ShortcutsUpdater { // } else if (root.isAdvanced() && root.authority.equals(Providers.AUTHORITY_STORAGE)) { // internal storage - if (mPrefs.getShowDeviceRoot()) { - devices.add(0, createShortcut(root, R.drawable.ic_advanced_shortcut)); - } + devices.add(0, createShortcut(root, R.drawable.ic_advanced_shortcut)); } else if (root.isAdvanced()) { // probably just bugreports provider devices.add(0, createShortcut(root, R.drawable.ic_folder_shortcut)); diff --git a/src/com/android/documentsui/base/Shared.java b/src/com/android/documentsui/base/Shared.java index 1ac4b32b8..b3c830ab0 100644 --- a/src/com/android/documentsui/base/Shared.java +++ b/src/com/android/documentsui/base/Shared.java @@ -289,14 +289,6 @@ public final class Shared { return !TextUtils.isEmpty(context.getString(R.string.trusted_quick_viewer_package)); } - /* - * Returns true if the local/device storage root must be visible (this also hides - * the option to toggle visibility in the menu.) - */ - public static boolean mustShowDeviceRoot(Intent intent) { - return intent.getBooleanExtra(DocumentsContract.EXTRA_SHOW_ADVANCED, false); - } - public static String getDeviceName(ContentResolver resolver) { // We match the value supplied by ExternalStorageProvider for // the internal storage root. diff --git a/src/com/android/documentsui/base/State.java b/src/com/android/documentsui/base/State.java index 0a575794a..acea81cd9 100644 --- a/src/com/android/documentsui/base/State.java +++ b/src/com/android/documentsui/base/State.java @@ -81,8 +81,6 @@ public class State implements android.os.Parcelable { public boolean allowMultiple; public boolean localOnly; - public boolean showDeviceStorageOption; - public boolean showAdvanced; public boolean openableOnly; @@ -150,8 +148,6 @@ public class State implements android.os.Parcelable { out.writeStringArray(acceptMimes); out.writeInt(allowMultiple ? 1 : 0); out.writeInt(localOnly ? 1 : 0); - out.writeInt(showDeviceStorageOption ? 1 : 0); - out.writeInt(showAdvanced ? 1 : 0); DurableUtils.writeToParcel(out, stack); out.writeMap(dirConfigs); out.writeList(excludedAuthorities); @@ -166,8 +162,6 @@ public class State implements android.os.Parcelable { + ", acceptMimes=" + Arrays.toString(acceptMimes) + ", allowMultiple=" + allowMultiple + ", localOnly=" + localOnly - + ", showDeviceStorageOption=" + showDeviceStorageOption - + ", showAdvanced=" + showAdvanced + ", stack=" + stack + ", dirConfigs=" + dirConfigs + ", excludedAuthorities=" + excludedAuthorities @@ -189,8 +183,6 @@ public class State implements android.os.Parcelable { state.acceptMimes = in.createStringArray(); state.allowMultiple = in.readInt() != 0; state.localOnly = in.readInt() != 0; - state.showDeviceStorageOption = in.readInt() != 0; - state.showAdvanced = in.readInt() != 0; DurableUtils.readFromParcel(in, state.stack); in.readMap(state.dirConfigs, loader); in.readList(state.excludedAuthorities, loader); diff --git a/src/com/android/documentsui/roots/ProvidersAccess.java b/src/com/android/documentsui/roots/ProvidersAccess.java index 822ce4ddc..ed8e097c0 100644 --- a/src/com/android/documentsui/roots/ProvidersAccess.java +++ b/src/com/android/documentsui/roots/ProvidersAccess.java @@ -98,11 +98,6 @@ public interface ProvidersAccess { continue; } - if (!state.showAdvanced && root.isAdvanced()) { - if (VERBOSE) Log.v(tag, "Excluding root because: unwanted advanced device."); - continue; - } - if (state.localOnly && !root.isLocalOnly()) { if (VERBOSE) Log.v(tag, "Excluding root because: unwanted non-local device."); continue; diff --git a/tests/common/com/android/documentsui/testing/TestMenu.java b/tests/common/com/android/documentsui/testing/TestMenu.java index e55a9aeb5..3ee4b3cbc 100644 --- a/tests/common/com/android/documentsui/testing/TestMenu.java +++ b/tests/common/com/android/documentsui/testing/TestMenu.java @@ -77,7 +77,6 @@ public abstract class TestMenu implements Menu { R.id.option_menu_new_window, R.id.option_menu_create_dir, R.id.option_menu_select_all, - R.id.option_menu_advanced, R.id.option_menu_settings, R.id.option_menu_inspect, R.id.option_menu_sort, diff --git a/tests/functional/com/android/documentsui/FileCopyUiTest.java b/tests/functional/com/android/documentsui/FileCopyUiTest.java index c616eda1f..a3282c0fc 100644 --- a/tests/functional/com/android/documentsui/FileCopyUiTest.java +++ b/tests/functional/com/android/documentsui/FileCopyUiTest.java @@ -37,7 +37,6 @@ import androidx.test.filters.LargeTest; import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.base.RootInfo; -import com.android.documentsui.base.State; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; @@ -137,13 +136,6 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { // If null or empty, use default name. mDeviceLabel = TextUtils.isEmpty(mDeviceLabel) ? "Internal Storage" : mDeviceLabel; - // If Internal Storage is not shown, turn on. - State state = ((FilesActivity) getActivity()).getDisplayState(); - if (!state.showAdvanced) { - bots.main.clickToolbarOverflowItem( - context.getResources().getString(R.string.menu_advanced_show)); - } - try { bots.notifications.setNotificationAccess(getActivity(), true); } catch (Exception e) { diff --git a/tests/functional/com/android/documentsui/InternalStorageUiTest.java b/tests/functional/com/android/documentsui/InternalStorageUiTest.java index 04b511dd3..5b2b18d93 100644 --- a/tests/functional/com/android/documentsui/InternalStorageUiTest.java +++ b/tests/functional/com/android/documentsui/InternalStorageUiTest.java @@ -20,7 +20,6 @@ import androidx.test.filters.LargeTest; import com.android.documentsui.base.Providers; import com.android.documentsui.base.RootInfo; -import com.android.documentsui.base.State; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; @@ -48,13 +47,6 @@ public class InternalStorageUiTest extends ActivityTest<FilesActivity> { Providers.AUTHORITY_STORAGE); rootPrimary = mDocsHelper.getRoot(Providers.ROOT_ID_DEVICE); - // If Internal Storage is not shown, turn on. - State state = ((FilesActivity) getActivity()).getDisplayState(); - if (!state.showAdvanced) { - bots.main.clickToolbarOverflowItem( - context.getResources().getString(R.string.menu_advanced_show)); - } - bots.roots.openRoot(rootPrimary.title); deleteTestFiles(); } diff --git a/tests/unit/com/android/documentsui/GlobalSearchLoaderTest.java b/tests/unit/com/android/documentsui/GlobalSearchLoaderTest.java index 0770e02de..701d22109 100644 --- a/tests/unit/com/android/documentsui/GlobalSearchLoaderTest.java +++ b/tests/unit/com/android/documentsui/GlobalSearchLoaderTest.java @@ -70,17 +70,15 @@ public class GlobalSearchLoaderTest { final DocumentInfo doc = mEnv.model.createFile(SEARCH_STRING + ".jpg", FILE_FLAG); doc.lastModified = System.currentTimeMillis(); - mEnv.mockProviders.get(TestProvidersAccess.HOME.authority) + mEnv.mockProviders.get(TestProvidersAccess.DOWNLOADS.authority) .setNextChildDocumentsReturns(doc); - TestProvidersAccess.HOME.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; - mEnv.state.showAdvanced = true; + TestProvidersAccess.DOWNLOADS.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; } @After public void tearDown() { - TestProvidersAccess.HOME.flags &= ~DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; - mEnv.state.showAdvanced = false; + TestProvidersAccess.DOWNLOADS.flags &= ~DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; } @Test @@ -98,44 +96,10 @@ public class GlobalSearchLoaderTest { } @Test - public void testShowAdvance_recentRoot_beIgnored() { - TestProvidersAccess.IMAGE.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; - assertTrue(mLoader.shouldIgnoreRoot(TestProvidersAccess.IMAGE)); - TestProvidersAccess.IMAGE.flags &= ~DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; - } - - @Test - public void testShowAdvance_imageRoot_beIgnored() { - TestProvidersAccess.IMAGE.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH - | DocumentsContract.Root.FLAG_LOCAL_ONLY; - assertTrue(mLoader.shouldIgnoreRoot(TestProvidersAccess.IMAGE)); - TestProvidersAccess.IMAGE.flags &= ~(DocumentsContract.Root.FLAG_SUPPORTS_SEARCH - | DocumentsContract.Root.FLAG_LOCAL_ONLY); - } - - @Test - public void testShowAdvance_videoRoot_beIgnored() { - TestProvidersAccess.VIDEO.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH - | DocumentsContract.Root.FLAG_LOCAL_ONLY; - assertTrue(mLoader.shouldIgnoreRoot(TestProvidersAccess.VIDEO)); - TestProvidersAccess.VIDEO.flags &= ~(DocumentsContract.Root.FLAG_SUPPORTS_SEARCH - | DocumentsContract.Root.FLAG_LOCAL_ONLY); - } - - @Test - public void testShowAdvance_audioRoot_beIgnored() { - TestProvidersAccess.AUDIO.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH - | DocumentsContract.Root.FLAG_LOCAL_ONLY; - assertTrue(mLoader.shouldIgnoreRoot(TestProvidersAccess.AUDIO)); - TestProvidersAccess.AUDIO.flags &= ~(DocumentsContract.Root.FLAG_SUPPORTS_SEARCH - | DocumentsContract.Root.FLAG_LOCAL_ONLY); - } - - @Test - public void testShowAdvance_downloadRoot_beIgnored() { - TestProvidersAccess.DOWNLOADS.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; - assertTrue(mLoader.shouldIgnoreRoot(TestProvidersAccess.DOWNLOADS)); - TestProvidersAccess.DOWNLOADS.flags &= ~DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; + public void testShowAdvance_storageRoot_beIgnored() { + TestProvidersAccess.HOME.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; + assertTrue(mLoader.shouldIgnoreRoot(TestProvidersAccess.HOME)); + TestProvidersAccess.HOME.flags &= ~(DocumentsContract.Root.FLAG_SUPPORTS_SEARCH); } @Test @@ -143,7 +107,7 @@ public class GlobalSearchLoaderTest { final DocumentInfo doc = mEnv.model.createFolder(SEARCH_STRING); doc.lastModified = System.currentTimeMillis(); - mEnv.mockProviders.get(TestProvidersAccess.HOME.authority) + mEnv.mockProviders.get(TestProvidersAccess.DOWNLOADS.authority) .setNextChildDocumentsReturns(doc); final DirectoryResult result = mLoader.loadInBackground(); @@ -181,7 +145,7 @@ public class GlobalSearchLoaderTest { final DocumentInfo testApkDoc = mEnv.model.createFile("test.apk"); testApkDoc.lastModified = System.currentTimeMillis(); - mEnv.mockProviders.get(TestProvidersAccess.HOME.authority) + mEnv.mockProviders.get(TestProvidersAccess.DOWNLOADS.authority) .setNextChildDocumentsReturns(pdfDoc, apkDoc, testApkDoc); mEnv.state.sortModel.sortByUser( @@ -212,10 +176,11 @@ public class GlobalSearchLoaderTest { final DocumentInfo testApkDoc = mEnv.model.createFile("test.apk"); testApkDoc.lastModified = System.currentTimeMillis(); - mEnv.mockProviders.get(TestProvidersAccess.HAMMY.authority) + mEnv.mockProviders.get(TestProvidersAccess.PICKLES.authority) .setNextChildDocumentsReturns(pdfDoc, apkDoc, testApkDoc); - TestProvidersAccess.HAMMY.flags |= DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; + TestProvidersAccess.PICKLES.flags |= (DocumentsContract.Root.FLAG_SUPPORTS_SEARCH + | DocumentsContract.Root.FLAG_LOCAL_ONLY); mEnv.state.sortModel.sortByUser( SortModel.SORT_DIMENSION_ID_TITLE, SortDimension.SORT_DIRECTION_ASCENDING); @@ -225,6 +190,7 @@ public class GlobalSearchLoaderTest { assertEquals(3, c.getCount()); - TestProvidersAccess.HAMMY.flags &= ~DocumentsContract.Root.FLAG_SUPPORTS_SEARCH; + TestProvidersAccess.PICKLES.flags &= ~(DocumentsContract.Root.FLAG_SUPPORTS_SEARCH + | DocumentsContract.Root.FLAG_LOCAL_ONLY); } } diff --git a/tests/unit/com/android/documentsui/files/MenuManagerTest.java b/tests/unit/com/android/documentsui/files/MenuManagerTest.java index 744c9ca1a..2c1b5ac45 100644 --- a/tests/unit/com/android/documentsui/files/MenuManagerTest.java +++ b/tests/unit/com/android/documentsui/files/MenuManagerTest.java @@ -100,7 +100,6 @@ public final class MenuManagerTest { private TestMenuItem optionNewWindow; private TestMenuItem optionCreateDir; private TestMenuItem optionSelectAll; - private TestMenuItem optionAdvanced; private TestMenuItem optionSettings; private TestMenuItem optionInspector; private TestMenuItem optionSort; @@ -171,7 +170,6 @@ public final class MenuManagerTest { optionNewWindow = testMenu.findItem(R.id.option_menu_new_window); optionCreateDir = testMenu.findItem(R.id.option_menu_create_dir); optionSelectAll = testMenu.findItem(R.id.option_menu_select_all); - optionAdvanced = testMenu.findItem(R.id.option_menu_advanced); optionSettings = testMenu.findItem(R.id.option_menu_settings); optionInspector = testMenu.findItem(R.id.option_menu_inspect); optionSort = testMenu.findItem(R.id.option_menu_sort); @@ -449,8 +447,6 @@ public final class MenuManagerTest { public void testOptionMenu() { mgr.updateOptionMenu(testMenu); - optionAdvanced.assertInvisible(); - optionAdvanced.assertTitle(R.string.menu_advanced_show); optionCreateDir.assertDisabled(); optionDebug.assertInvisible(); optionSort.assertEnabled(); @@ -460,16 +456,6 @@ public final class MenuManagerTest { } @Test - public void testOptionMenu_ShowAdvanced() { - state.showAdvanced = true; - state.showDeviceStorageOption = true; - mgr.updateOptionMenu(testMenu); - - optionAdvanced.assertVisible(); - optionAdvanced.assertTitle(R.string.menu_advanced_hide); - } - - @Test public void testOptionMenu_CanCreateDirectory() { dirDetails.canCreateDirectory = true; mgr.updateOptionMenu(testMenu); diff --git a/tests/unit/com/android/documentsui/picker/MenuManagerTest.java b/tests/unit/com/android/documentsui/picker/MenuManagerTest.java index 3e1344071..7ebf1feb9 100644 --- a/tests/unit/com/android/documentsui/picker/MenuManagerTest.java +++ b/tests/unit/com/android/documentsui/picker/MenuManagerTest.java @@ -98,7 +98,6 @@ public final class MenuManagerTest { private TestMenuItem optionNewWindow; private TestMenuItem optionCreateDir; private TestMenuItem optionSelectAll; - private TestMenuItem optionAdvanced; private TestMenuItem optionSettings; private TestMenuItem optionSort; private TestMenuItem mOptionLauncher; @@ -158,7 +157,6 @@ public final class MenuManagerTest { optionNewWindow = testMenu.findItem(R.id.option_menu_new_window); optionCreateDir = testMenu.findItem(R.id.option_menu_create_dir); optionSelectAll = testMenu.findItem(R.id.option_menu_select_all); - optionAdvanced = testMenu.findItem(R.id.option_menu_advanced); optionSettings = testMenu.findItem(R.id.option_menu_settings); optionSort = testMenu.findItem(R.id.option_menu_sort); mOptionLauncher = testMenu.findItem(R.id.option_menu_launcher); @@ -264,8 +262,6 @@ public final class MenuManagerTest { public void testOptionMenu() { mgr.updateOptionMenu(testMenu); - optionAdvanced.assertInvisible(); - optionAdvanced.assertTitle(R.string.menu_advanced_show); optionCreateDir.assertDisabled(); optionDebug.assertInvisible(); optionSort.assertEnabled(); @@ -296,16 +292,6 @@ public final class MenuManagerTest { } @Test - public void testOptionMenu_showAdvanced() { - state.showAdvanced = true; - state.showDeviceStorageOption = true; - mgr.updateOptionMenu(testMenu); - - optionAdvanced.assertVisible(); - optionAdvanced.assertTitle(R.string.menu_advanced_hide); - } - - @Test public void testOptionMenu_inRecents() { dirDetails.isInRecents = true; mgr.updateOptionMenu(testMenu); diff --git a/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java b/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java index a52f2b6cf..ff737a101 100644 --- a/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java +++ b/tests/unit/com/android/documentsui/roots/ProvidersAccessTest.java @@ -57,7 +57,6 @@ public class ProvidersAccessTest extends AndroidTestCase { mState = new State(); mState.action = State.ACTION_OPEN; - mState.showAdvanced = true; mState.localOnly = false; } |