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

Commit 54337055 authored by Ben Reich's avatar Ben Reich
Browse files

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
parent 725f07ab
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
[Hook Scripts]
[Hook Scripts]
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT}
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT}
ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py -f ${PREUPLOAD_FILES}
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
+10 −5
Original line number Original line Diff line number Diff line
@@ -17,31 +17,35 @@ flag {
}
}


flag {
flag {
    name: "zip_ng"
    name: "zip_ng_ro"
    namespace: "documentsui"
    namespace: "documentsui"
    description: "Enables the next generation ZIP functionality."
    description: "Enables the next generation ZIP functionality."
    bug: "382550591"
    bug: "382550591"
    is_fixed_read_only: true
}
}


flag {
flag {
    name: "desktop_file_handling"
    name: "desktop_file_handling_ro"
    namespace: "documentsui"
    namespace: "documentsui"
    description: "Enables desktop file handling."
    description: "Enables desktop file handling."
    bug: "381778967"
    bug: "381778967"
    is_fixed_read_only: true
}
}


flag {
flag {
    name: "visual_signals"
    name: "visual_signals_ro"
    namespace: "documentsui"
    namespace: "documentsui"
    description: "Enables in-app progress display of file operations"
    description: "Enables in-app progress display of file operations"
    bug: "378011512"
    bug: "378011512"
    is_fixed_read_only: true
}
}


flag {
flag {
    name: "hide_roots_on_desktop"
    name: "hide_roots_on_desktop_ro"
    namespace: "documentsui"
    namespace: "documentsui"
    description: "Enables the hiding of the Images/Videos/Audio/Documents roots on desktop."
    description: "Enables the hiding of the Images/Videos/Audio/Documents roots on desktop."
    bug: "381959330"
    bug: "381959330"
    is_fixed_read_only: true
}
}


flag {
flag {
@@ -53,8 +57,9 @@ flag {
}
}


flag {
flag {
    name: "use_peek_preview"
    name: "use_peek_preview_ro"
    namespace: "documentsui"
    namespace: "documentsui"
    description: "Enables the Peek previewing capability as a substitute for the Inspector."
    description: "Enables the Peek previewing capability as a substitute for the Inspector."
    bug: "373242058"
    bug: "373242058"
    is_fixed_read_only: true
}
}

preupload-checks.xml

deleted100644 → 0
+0 −27
Original line number Original line Diff line number Diff line
<?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>
+4 −4
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ class FlagUtils {


        @JvmStatic
        @JvmStatic
        fun isZipNgFlagEnabled(): Boolean {
        fun isZipNgFlagEnabled(): Boolean {
            return Flags.zipNg()
            return Flags.zipNgRo()
        }
        }


        @JvmStatic
        @JvmStatic
@@ -41,17 +41,17 @@ class FlagUtils {


        @JvmStatic
        @JvmStatic
        fun isDesktopFileHandlingFlagEnabled(): Boolean {
        fun isDesktopFileHandlingFlagEnabled(): Boolean {
            return Flags.desktopFileHandling()
            return Flags.desktopFileHandlingRo()
        }
        }


        @JvmStatic
        @JvmStatic
        fun isHideRootsOnDesktopFlagEnabled(): Boolean {
        fun isHideRootsOnDesktopFlagEnabled(): Boolean {
            return Flags.hideRootsOnDesktop()
            return Flags.hideRootsOnDesktopRo()
        }
        }


        @JvmStatic
        @JvmStatic
        fun isUsePeekPreviewFlagEnabled(): Boolean {
        fun isUsePeekPreviewFlagEnabled(): Boolean {
            return Flags.usePeekPreview()
            return Flags.usePeekPreviewRo()
        }
        }
    }
    }
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.documentsui;


import static com.android.documentsui.StubProvider.ROOT_0_ID;
import static com.android.documentsui.StubProvider.ROOT_0_ID;
import static com.android.documentsui.StubProvider.ROOT_1_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.content.pm.PackageManager;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.platform.test.annotations.RequiresFlagsDisabled;
@@ -82,7 +82,7 @@ public class FilesActivityDefaultsUiTest extends ActivityTestJunit4<FilesActivit


    @Test
    @Test
    @HugeLongTest
    @HugeLongTest
    @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP)
    @RequiresFlagsDisabled(FLAG_HIDE_ROOTS_ON_DESKTOP_RO)
    public void testDefaultRoots_hideRootsOnDesktopFlagDisabled() throws Exception {
    public void testDefaultRoots_hideRootsOnDesktopFlagDisabled() throws Exception {
        device.waitForIdle();
        device.waitForIdle();


@@ -99,7 +99,7 @@ public class FilesActivityDefaultsUiTest extends ActivityTestJunit4<FilesActivit


    @Test
    @Test
    @HugeLongTest
    @HugeLongTest
    @RequiresFlagsEnabled(FLAG_HIDE_ROOTS_ON_DESKTOP)
    @RequiresFlagsEnabled(FLAG_HIDE_ROOTS_ON_DESKTOP_RO)
    public void testDefaultRoots_hideRootsOnDesktopFlagEnabled() throws Exception {
    public void testDefaultRoots_hideRootsOnDesktopFlagEnabled() throws Exception {
        device.waitForIdle();
        device.waitForIdle();


Loading