summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PREUPLOAD.cfg1
-rw-r--r--flags.aconfig15
-rw-r--r--preupload-checks.xml27
-rw-r--r--src/com/android/documentsui/util/FlagUtils.kt8
-rw-r--r--tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java6
-rw-r--r--tests/functional/com/android/documentsui/FilesActivityUiTest.java6
-rw-r--r--tests/unit/com/android/documentsui/files/ActionHandlerTest.java22
-rw-r--r--tests/unit/com/android/documentsui/files/MenuManagerTest.java4
-rw-r--r--tests/unit/com/android/documentsui/sidebar/RootsFragmentTest.java6
9 files changed, 36 insertions, 59 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 8f318d23d..edf1ee5a3 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -1,5 +1,4 @@
[Hook Scripts]
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT}
ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py -f ${PREUPLOAD_FILES}
-docsui_checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT} --config_xml ${REPO_ROOT}/packages/apps/DocumentsUI/preupload-checks.xml
diff --git a/flags.aconfig b/flags.aconfig
index 165253b1e..21fc9567c 100644
--- a/flags.aconfig
+++ b/flags.aconfig
@@ -17,31 +17,35 @@ flag {
}
flag {
- name: "zip_ng"
+ name: "zip_ng_ro"
namespace: "documentsui"
description: "Enables the next generation ZIP functionality."
bug: "382550591"
+ is_fixed_read_only: true
}
flag {
- name: "desktop_file_handling"
+ name: "desktop_file_handling_ro"
namespace: "documentsui"
description: "Enables desktop file handling."
bug: "381778967"
+ is_fixed_read_only: true
}
flag {
- name: "visual_signals"
+ name: "visual_signals_ro"
namespace: "documentsui"
description: "Enables in-app progress display of file operations"
bug: "378011512"
+ is_fixed_read_only: true
}
flag {
- name: "hide_roots_on_desktop"
+ name: "hide_roots_on_desktop_ro"
namespace: "documentsui"
description: "Enables the hiding of the Images/Videos/Audio/Documents roots on desktop."
bug: "381959330"
+ is_fixed_read_only: true
}
flag {
@@ -53,8 +57,9 @@ flag {
}
flag {
- name: "use_peek_preview"
+ name: "use_peek_preview_ro"
namespace: "documentsui"
description: "Enables the Peek previewing capability as a substitute for the Inspector."
bug: "373242058"
+ is_fixed_read_only: true
}
diff --git a/preupload-checks.xml b/preupload-checks.xml
deleted file mode 100644
index b30b4240b..000000000
--- a/preupload-checks.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (C) 2025 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
-<module name="Checker">
- <module name="TreeWalker">
- <module name="RegexpSinglelineJava">
- <property name="ignoreComments" value="true" />
- <property name="severity" value="error" />
- <property name="format" value="com.android.documentsui.flags.Flags" />
- <property name="message" value="Please don't use Flags.* directly, instead add the flag to FlagUtils and use that instead." />
- </module>
- </module>
-</module>
diff --git a/src/com/android/documentsui/util/FlagUtils.kt b/src/com/android/documentsui/util/FlagUtils.kt
index 49c55de57..606f071f2 100644
--- a/src/com/android/documentsui/util/FlagUtils.kt
+++ b/src/com/android/documentsui/util/FlagUtils.kt
@@ -31,7 +31,7 @@ class FlagUtils {
@JvmStatic
fun isZipNgFlagEnabled(): Boolean {
- return Flags.zipNg()
+ return Flags.zipNgRo()
}
@JvmStatic
@@ -41,17 +41,17 @@ class FlagUtils {
@JvmStatic
fun isDesktopFileHandlingFlagEnabled(): Boolean {
- return Flags.desktopFileHandling()
+ return Flags.desktopFileHandlingRo()
}
@JvmStatic
fun isHideRootsOnDesktopFlagEnabled(): Boolean {
- return Flags.hideRootsOnDesktop()
+ return Flags.hideRootsOnDesktopRo()
}
@JvmStatic
fun isUsePeekPreviewFlagEnabled(): Boolean {
- return Flags.usePeekPreview()
+ return Flags.usePeekPreviewRo()
}
}
}
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<FilesActivit
@Test
@HugeLongTest
- @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP)
+ @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP_RO)
public void testDefaultRoots_hideRootsOnDesktopFlagDisabled() throws Exception {
device.waitForIdle();
@@ -99,7 +99,7 @@ public class FilesActivityDefaultsUiTest extends ActivityTestJunit4<FilesActivit
@Test
@HugeLongTest
- @RequiresFlagsEnabled(FLAG_HIDE_ROOTS_ON_DESKTOP)
+ @RequiresFlagsEnabled(FLAG_HIDE_ROOTS_ON_DESKTOP_RO)
public void testDefaultRoots_hideRootsOnDesktopFlagEnabled() throws Exception {
device.waitForIdle();
diff --git a/tests/functional/com/android/documentsui/FilesActivityUiTest.java b/tests/functional/com/android/documentsui/FilesActivityUiTest.java
index 1a160c130..f1f505235 100644
--- a/tests/functional/com/android/documentsui/FilesActivityUiTest.java
+++ b/tests/functional/com/android/documentsui/FilesActivityUiTest.java
@@ -16,7 +16,7 @@
package com.android.documentsui;
-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.app.Instrumentation;
import android.net.Uri;
@@ -86,7 +86,7 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> {
}
@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<FilesActivity> {
@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<Item> 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<Item> 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<Item> items = mRootsFragment.sortLoadResult(