From 5433705512a9e668324946e3f48d00690accb378 Mon Sep 17 00:00:00 2001 From: Ben Reich Date: Tue, 4 Mar 2025 16:01:57 +1100 Subject: Update multiple flags to read-only This updates the following flags to be read-only - zip_ng -> zip_ng_ro - desktop_file_handling -> desktop_file_handling_ro - visual_signals -> visual_signals_ro - hide_roots_on_desktop -> hide_roots_on_desktop_ro - use_peek_preview -> use_peek_preview_ro It also removes the existing preupload check. Unfortunately this check doesn't work on kotlin files so it's kind of only semi-useful. Bug: 400475579 Test: m DocumentsUIGoogle Flag: EXEMPT update flags to be read-only Change-Id: I117a0e460beb488313ece178349058f5aa2e956e --- .../documentsui/FilesActivityDefaultsUiTest.java | 6 +++--- .../android/documentsui/FilesActivityUiTest.java | 6 +++--- .../documentsui/files/ActionHandlerTest.java | 22 +++++++++++----------- .../android/documentsui/files/MenuManagerTest.java | 4 ++-- .../documentsui/sidebar/RootsFragmentTest.java | 6 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java b/tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java index 2cea176ba..e6538966f 100644 --- a/tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java +++ b/tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java @@ -18,7 +18,7 @@ package com.android.documentsui; import static com.android.documentsui.StubProvider.ROOT_0_ID; import static com.android.documentsui.StubProvider.ROOT_1_ID; -import static com.android.documentsui.flags.Flags.FLAG_HIDE_ROOTS_ON_DESKTOP; +import static com.android.documentsui.flags.Flags.FLAG_HIDE_ROOTS_ON_DESKTOP_RO; import android.content.pm.PackageManager; import android.platform.test.annotations.RequiresFlagsDisabled; @@ -82,7 +82,7 @@ public class FilesActivityDefaultsUiTest extends ActivityTestJunit4 { } @Test - @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP) + @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP_RO) public void testRootClick_SetsWindowTitle() throws Exception { bots.roots.openRoot("Images"); bots.main.assertWindowTitle("Images"); @@ -145,7 +145,7 @@ public class FilesActivityUiTest extends ActivityTestJunit4 { @Test @HugeLongTest - @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP) + @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP_RO) public void testRootChange_UpdatesSortHeader() throws Exception { // switch to separate display modes for two separate roots. Each diff --git a/tests/unit/com/android/documentsui/files/ActionHandlerTest.java b/tests/unit/com/android/documentsui/files/ActionHandlerTest.java index 54a685776..1d6ef1fd6 100644 --- a/tests/unit/com/android/documentsui/files/ActionHandlerTest.java +++ b/tests/unit/com/android/documentsui/files/ActionHandlerTest.java @@ -181,7 +181,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsDisabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testOpenFileFlags() { mHandler.onDocumentOpened(TestEnv.FILE_GIF, com.android.documentsui.files.ActionHandler.VIEW_TYPE_PREVIEW, @@ -194,7 +194,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testOpenFileFlagsDesktop() { mHandler.onDocumentOpened(TestEnv.FILE_GIF, com.android.documentsui.files.ActionHandler.VIEW_TYPE_PREVIEW, @@ -478,7 +478,7 @@ public class ActionHandlerTest { // Require desktop file handling flag because when it's disabled proguard strips the // openDocumentViewOnly function because it's not used anywhere reachable by production code. @Test - @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testDocumentContextMenuOpen() throws Exception { mActivity.resources.setQuickViewerPackage("corptropolis.viewer"); mActivity.currentRoot = TestProvidersAccess.HOME; @@ -494,7 +494,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsDisabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testShowChooser() throws Exception { mActivity.currentRoot = TestProvidersAccess.DOWNLOADS; @@ -503,7 +503,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testShowChooserDesktop() throws Exception { mActivity.currentRoot = TestProvidersAccess.DOWNLOADS; @@ -739,7 +739,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsEnabled({Flags.FLAG_USE_MATERIAL3, Flags.FLAG_USE_PEEK_PREVIEW}) + @RequiresFlagsEnabled({Flags.FLAG_USE_MATERIAL3, Flags.FLAG_USE_PEEK_PREVIEW_RO}) public void testShowPeek() throws Exception { mHandler.showPreview(TestEnv.FILE_GIF); // The inspector activity is not called. @@ -747,7 +747,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW}) + @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW_RO}) public void testShowInspector() throws Exception { mHandler.showPreview(TestEnv.FILE_GIF); @@ -761,7 +761,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW}) + @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW_RO}) public void testShowInspector_DebugDisabled() throws Exception { mFeatures.debugSupport = false; @@ -773,7 +773,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW}) + @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW_RO}) public void testShowInspector_DebugEnabled() throws Exception { mFeatures.debugSupport = true; DebugFlags.setDocumentDetailsEnabled(true); @@ -787,7 +787,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW}) + @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW_RO}) public void testShowInspector_OverridesRootDocumentName() throws Exception { mActivity.currentRoot = TestProvidersAccess.PICKLES; mEnv.populateStack(); @@ -807,7 +807,7 @@ public class ActionHandlerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW}) + @RequiresFlagsDisabled({Flags.FLAG_USE_PEEK_PREVIEW_RO}) public void testShowInspector_OverridesRootDocumentNameX() throws Exception { mActivity.currentRoot = TestProvidersAccess.PICKLES; mEnv.populateStack(); diff --git a/tests/unit/com/android/documentsui/files/MenuManagerTest.java b/tests/unit/com/android/documentsui/files/MenuManagerTest.java index f9737dc39..ac7b1c4f7 100644 --- a/tests/unit/com/android/documentsui/files/MenuManagerTest.java +++ b/tests/unit/com/android/documentsui/files/MenuManagerTest.java @@ -619,7 +619,7 @@ public final class MenuManagerTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsDisabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testContextMenu_OnFile_CanOpen() { selectionDetails.canOpen = true; mgr.updateContextMenuForFiles(testMenu, selectionDetails); @@ -628,7 +628,7 @@ public final class MenuManagerTest { } @Test - @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING}) + @RequiresFlagsEnabled({Flags.FLAG_DESKTOP_FILE_HANDLING_RO}) public void testContextMenu_OnFile_CanOpenDesktop() { selectionDetails.canOpen = true; mgr.updateContextMenuForFiles(testMenu, selectionDetails); diff --git a/tests/unit/com/android/documentsui/sidebar/RootsFragmentTest.java b/tests/unit/com/android/documentsui/sidebar/RootsFragmentTest.java index 2f91a0f0f..26512cc22 100644 --- a/tests/unit/com/android/documentsui/sidebar/RootsFragmentTest.java +++ b/tests/unit/com/android/documentsui/sidebar/RootsFragmentTest.java @@ -138,7 +138,7 @@ public class RootsFragmentTest { } @Test - @RequiresFlagsDisabled({Flags.FLAG_HIDE_ROOTS_ON_DESKTOP}) + @RequiresFlagsDisabled({Flags.FLAG_HIDE_ROOTS_ON_DESKTOP_RO}) public void testSortLoadResult_WithCorrectOrder_hideRootsOnDesktopFlagDisable() { List items = mRootsFragment.sortLoadResult( mContext, @@ -152,7 +152,7 @@ public class RootsFragmentTest { } @Test - @RequiresFlagsEnabled({Flags.FLAG_HIDE_ROOTS_ON_DESKTOP}) + @RequiresFlagsEnabled({Flags.FLAG_HIDE_ROOTS_ON_DESKTOP_RO}) public void testSortLoadResult_WithCorrectOrder_onNonDesktop() { when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_PC)).thenReturn(false); List items = mRootsFragment.sortLoadResult( @@ -167,7 +167,7 @@ public class RootsFragmentTest { } @Test - @RequiresFlagsEnabled({Flags.FLAG_HIDE_ROOTS_ON_DESKTOP}) + @RequiresFlagsEnabled({Flags.FLAG_HIDE_ROOTS_ON_DESKTOP_RO}) public void testSortLoadResult_WithCorrectOrder_onDesktop() { when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_PC)).thenReturn(true); List items = mRootsFragment.sortLoadResult( -- cgit v1.2.3-59-g8ed1b