Loading PREUPLOAD.cfg +2 −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 preupload-checks.xml 0 → 100644 +27 −0 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> src/com/android/documentsui/AbstractActionHandler.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -19,8 +19,8 @@ package com.android.documentsui; import static com.android.documentsui.base.DocumentInfo.getCursorInt; import static com.android.documentsui.base.DocumentInfo.getCursorInt; import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.flags.Flags.desktopFileHandling; import static com.android.documentsui.util.FlagUtils.isDesktopFileHandlingFlagEnabled; import static com.android.documentsui.flags.Flags.useSearchV2Rw; import static com.android.documentsui.util.FlagUtils.isUseSearchV2RwFlagEnabled; import android.app.PendingIntent; import android.app.PendingIntent; import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException; Loading Loading @@ -576,7 +576,7 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION; flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION; } } // On desktop users expect files to open in a new window. // On desktop users expect files to open in a new window. if (desktopFileHandling()) { if (isDesktopFileHandlingFlagEnabled()) { // The combination of NEW_DOCUMENT and MULTIPLE_TASK allows multiple instances of the // The combination of NEW_DOCUMENT and MULTIPLE_TASK allows multiple instances of the // same activity to open in separate windows. // same activity to open in separate windows. flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK; flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK; Loading Loading @@ -916,7 +916,7 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA mState.stack.changeRoot(mActivity.getCurrentRoot()); mState.stack.changeRoot(mActivity.getCurrentRoot()); } } if (useSearchV2Rw()) { if (isUseSearchV2RwFlagEnabled()) { return onCreateLoaderV2(id, args); return onCreateLoaderV2(id, args); } } return onCreateLoaderV1(id, args); return onCreateLoaderV1(id, args); Loading src/com/android/documentsui/ActionModeController.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.documentsui; package com.android.documentsui; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.flags.Flags.useMaterial3; import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled; import android.app.Activity; import android.app.Activity; import android.util.Log; import android.util.Log; Loading Loading @@ -138,7 +138,7 @@ public class ActionModeController extends SelectionObserver<String> // Re-enable TalkBack for the toolbars, as they are no longer covered by action mode. // Re-enable TalkBack for the toolbars, as they are no longer covered by action mode. int[] toolbarIds = int[] toolbarIds = useMaterial3() isUseMaterial3FlagEnabled() ? new int[] {R.id.toolbar} ? new int[] {R.id.toolbar} : new int[] {R.id.toolbar, R.id.roots_toolbar}; : new int[] {R.id.toolbar, R.id.roots_toolbar}; mScope.accessibilityImportanceSetter.setAccessibilityImportance( mScope.accessibilityImportanceSetter.setAccessibilityImportance( Loading @@ -159,7 +159,7 @@ public class ActionModeController extends SelectionObserver<String> // Hide the toolbars if action mode is enabled, so TalkBack doesn't navigate to // Hide the toolbars if action mode is enabled, so TalkBack doesn't navigate to // these controls when using linear navigation. // these controls when using linear navigation. int[] toolbarIds = int[] toolbarIds = useMaterial3() isUseMaterial3FlagEnabled() ? new int[] {R.id.toolbar} ? new int[] {R.id.toolbar} : new int[] {R.id.toolbar, R.id.roots_toolbar}; : new int[] {R.id.toolbar, R.id.roots_toolbar}; mScope.accessibilityImportanceSetter.setAccessibilityImportance( mScope.accessibilityImportanceSetter.setAccessibilityImportance( Loading src/com/android/documentsui/BaseActivity.java +12 −12 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ package com.android.documentsui; import static com.android.documentsui.base.Shared.EXTRA_BENCHMARK; import static com.android.documentsui.base.Shared.EXTRA_BENCHMARK; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.State.MODE_GRID; import static com.android.documentsui.base.State.MODE_GRID; import static com.android.documentsui.flags.Flags.useMaterial3; import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; Loading Loading @@ -184,7 +184,7 @@ public abstract class BaseActivity // in case Activity continuously encounter resource not found exception. // in case Activity continuously encounter resource not found exception. getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); if (useMaterial3() && SdkLevel.isAtLeastS()) { if (isUseMaterial3FlagEnabled() && SdkLevel.isAtLeastS()) { DynamicColors.applyToActivityIfAvailable(this); DynamicColors.applyToActivityIfAvailable(this); } } Loading @@ -205,7 +205,7 @@ public abstract class BaseActivity mDrawer = DrawerController.create(this, mInjector.config); mDrawer = DrawerController.create(this, mInjector.config); Metrics.logActivityLaunch(mState, intent); Metrics.logActivityLaunch(mState, intent); if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { View navRailRoots = findViewById(R.id.nav_rail_container_roots); View navRailRoots = findViewById(R.id.nav_rail_container_roots); if (navRailRoots != null) { if (navRailRoots != null) { // Bind event listener for the burger menu on nav rail. // Bind event listener for the burger menu on nav rail. Loading Loading @@ -369,7 +369,7 @@ public abstract class BaseActivity if (roots != null) { if (roots != null) { roots.onSelectedUserChanged(); roots.onSelectedUserChanged(); } } if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { final RootsFragment navRailRoots = final RootsFragment navRailRoots = RootsFragment.getNavRail(getSupportFragmentManager()); RootsFragment.getNavRail(getSupportFragmentManager()); if (navRailRoots != null) { if (navRailRoots != null) { Loading Loading @@ -397,7 +397,7 @@ public abstract class BaseActivity }); }); mSortController = SortController.create(this, mState.derivedMode, mState.sortModel); mSortController = SortController.create(this, mState.derivedMode, mState.sortModel); if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { View previewIconPlaceholder = findViewById(R.id.preview_icon_placeholder); View previewIconPlaceholder = findViewById(R.id.preview_icon_placeholder); if (previewIconPlaceholder != null) { if (previewIconPlaceholder != null) { previewIconPlaceholder.setVisibility( previewIconPlaceholder.setVisibility( Loading Loading @@ -454,7 +454,7 @@ public abstract class BaseActivity super.onPostCreate(savedInstanceState); super.onPostCreate(savedInstanceState); Runnable finishActionMode = Runnable finishActionMode = (useMaterial3()) (isUseMaterial3FlagEnabled()) ? mNavigator::closeSelectionBar ? mNavigator::closeSelectionBar : mInjector.actionModeController::finishActionMode; : mInjector.actionModeController::finishActionMode; Loading @@ -479,7 +479,7 @@ public abstract class BaseActivity @Override @Override public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) { if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { // In Material3 the menu is now inflated in the `NavigationViewMenu`. This is currently // In Material3 the menu is now inflated in the `NavigationViewMenu`. This is currently // to allow for us to inflate between the action_menu and the activity menu. Once the // to allow for us to inflate between the action_menu and the activity menu. Once the // Material 3 flag is removed, the menus will be merged and we can rely on this single // Material 3 flag is removed, the menus will be merged and we can rely on this single Loading Loading @@ -510,7 +510,7 @@ public abstract class BaseActivity public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); super.onPrepareOptionsMenu(menu); // Remove the subMenu when material3 is launched b/379776735. // Remove the subMenu when material3 is launched b/379776735. if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { if (mNavigator != null) { if (mNavigator != null) { mNavigator.updateActionMenu(); mNavigator.updateActionMenu(); } } Loading Loading @@ -574,7 +574,7 @@ public abstract class BaseActivity insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), 0); insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), 0); // in M3, no additional bottom gap in full screen mode. // in M3, no additional bottom gap in full screen mode. if (!useMaterial3()) { if (!isUseMaterial3FlagEnabled()) { View saveContainer = findViewById(R.id.container_save); View saveContainer = findViewById(R.id.container_save); saveContainer.setPadding( saveContainer.setPadding( 0, 0, 0, insets.getSystemWindowInsetBottom()); 0, 0, 0, insets.getSystemWindowInsetBottom()); Loading Loading @@ -617,7 +617,7 @@ public abstract class BaseActivity return; return; } } if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { mNavigator.closeSelectionBar(); mNavigator.closeSelectionBar(); } else { } else { mInjector.actionModeController.finishActionMode(); mInjector.actionModeController.finishActionMode(); Loading Loading @@ -759,7 +759,7 @@ public abstract class BaseActivity if (roots != null) { if (roots != null) { roots.onCurrentRootChanged(); roots.onCurrentRootChanged(); } } if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { final RootsFragment navRailRoots = final RootsFragment navRailRoots = RootsFragment.getNavRail(getSupportFragmentManager()); RootsFragment.getNavRail(getSupportFragmentManager()); if (navRailRoots != null) { if (navRailRoots != null) { Loading Loading @@ -843,7 +843,7 @@ public abstract class BaseActivity mState.derivedMode = mode; mState.derivedMode = mode; // Remove the subMenu when material3 is launched b/379776735. // Remove the subMenu when material3 is launched b/379776735. if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { mInjector.menuManager.updateSubMenu(null); mInjector.menuManager.updateSubMenu(null); } else { } else { final ActionMenuView subMenuView = findViewById(R.id.sub_menu); final ActionMenuView subMenuView = findViewById(R.id.sub_menu); Loading Loading
PREUPLOAD.cfg +2 −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
preupload-checks.xml 0 → 100644 +27 −0 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>
src/com/android/documentsui/AbstractActionHandler.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -19,8 +19,8 @@ package com.android.documentsui; import static com.android.documentsui.base.DocumentInfo.getCursorInt; import static com.android.documentsui.base.DocumentInfo.getCursorInt; import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.flags.Flags.desktopFileHandling; import static com.android.documentsui.util.FlagUtils.isDesktopFileHandlingFlagEnabled; import static com.android.documentsui.flags.Flags.useSearchV2Rw; import static com.android.documentsui.util.FlagUtils.isUseSearchV2RwFlagEnabled; import android.app.PendingIntent; import android.app.PendingIntent; import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException; Loading Loading @@ -576,7 +576,7 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION; flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION; } } // On desktop users expect files to open in a new window. // On desktop users expect files to open in a new window. if (desktopFileHandling()) { if (isDesktopFileHandlingFlagEnabled()) { // The combination of NEW_DOCUMENT and MULTIPLE_TASK allows multiple instances of the // The combination of NEW_DOCUMENT and MULTIPLE_TASK allows multiple instances of the // same activity to open in separate windows. // same activity to open in separate windows. flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK; flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK; Loading Loading @@ -916,7 +916,7 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA mState.stack.changeRoot(mActivity.getCurrentRoot()); mState.stack.changeRoot(mActivity.getCurrentRoot()); } } if (useSearchV2Rw()) { if (isUseSearchV2RwFlagEnabled()) { return onCreateLoaderV2(id, args); return onCreateLoaderV2(id, args); } } return onCreateLoaderV1(id, args); return onCreateLoaderV1(id, args); Loading
src/com/android/documentsui/ActionModeController.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.documentsui; package com.android.documentsui; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.flags.Flags.useMaterial3; import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled; import android.app.Activity; import android.app.Activity; import android.util.Log; import android.util.Log; Loading Loading @@ -138,7 +138,7 @@ public class ActionModeController extends SelectionObserver<String> // Re-enable TalkBack for the toolbars, as they are no longer covered by action mode. // Re-enable TalkBack for the toolbars, as they are no longer covered by action mode. int[] toolbarIds = int[] toolbarIds = useMaterial3() isUseMaterial3FlagEnabled() ? new int[] {R.id.toolbar} ? new int[] {R.id.toolbar} : new int[] {R.id.toolbar, R.id.roots_toolbar}; : new int[] {R.id.toolbar, R.id.roots_toolbar}; mScope.accessibilityImportanceSetter.setAccessibilityImportance( mScope.accessibilityImportanceSetter.setAccessibilityImportance( Loading @@ -159,7 +159,7 @@ public class ActionModeController extends SelectionObserver<String> // Hide the toolbars if action mode is enabled, so TalkBack doesn't navigate to // Hide the toolbars if action mode is enabled, so TalkBack doesn't navigate to // these controls when using linear navigation. // these controls when using linear navigation. int[] toolbarIds = int[] toolbarIds = useMaterial3() isUseMaterial3FlagEnabled() ? new int[] {R.id.toolbar} ? new int[] {R.id.toolbar} : new int[] {R.id.toolbar, R.id.roots_toolbar}; : new int[] {R.id.toolbar, R.id.roots_toolbar}; mScope.accessibilityImportanceSetter.setAccessibilityImportance( mScope.accessibilityImportanceSetter.setAccessibilityImportance( Loading
src/com/android/documentsui/BaseActivity.java +12 −12 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ package com.android.documentsui; import static com.android.documentsui.base.Shared.EXTRA_BENCHMARK; import static com.android.documentsui.base.Shared.EXTRA_BENCHMARK; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.State.MODE_GRID; import static com.android.documentsui.base.State.MODE_GRID; import static com.android.documentsui.flags.Flags.useMaterial3; import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; Loading Loading @@ -184,7 +184,7 @@ public abstract class BaseActivity // in case Activity continuously encounter resource not found exception. // in case Activity continuously encounter resource not found exception. getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); if (useMaterial3() && SdkLevel.isAtLeastS()) { if (isUseMaterial3FlagEnabled() && SdkLevel.isAtLeastS()) { DynamicColors.applyToActivityIfAvailable(this); DynamicColors.applyToActivityIfAvailable(this); } } Loading @@ -205,7 +205,7 @@ public abstract class BaseActivity mDrawer = DrawerController.create(this, mInjector.config); mDrawer = DrawerController.create(this, mInjector.config); Metrics.logActivityLaunch(mState, intent); Metrics.logActivityLaunch(mState, intent); if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { View navRailRoots = findViewById(R.id.nav_rail_container_roots); View navRailRoots = findViewById(R.id.nav_rail_container_roots); if (navRailRoots != null) { if (navRailRoots != null) { // Bind event listener for the burger menu on nav rail. // Bind event listener for the burger menu on nav rail. Loading Loading @@ -369,7 +369,7 @@ public abstract class BaseActivity if (roots != null) { if (roots != null) { roots.onSelectedUserChanged(); roots.onSelectedUserChanged(); } } if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { final RootsFragment navRailRoots = final RootsFragment navRailRoots = RootsFragment.getNavRail(getSupportFragmentManager()); RootsFragment.getNavRail(getSupportFragmentManager()); if (navRailRoots != null) { if (navRailRoots != null) { Loading Loading @@ -397,7 +397,7 @@ public abstract class BaseActivity }); }); mSortController = SortController.create(this, mState.derivedMode, mState.sortModel); mSortController = SortController.create(this, mState.derivedMode, mState.sortModel); if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { View previewIconPlaceholder = findViewById(R.id.preview_icon_placeholder); View previewIconPlaceholder = findViewById(R.id.preview_icon_placeholder); if (previewIconPlaceholder != null) { if (previewIconPlaceholder != null) { previewIconPlaceholder.setVisibility( previewIconPlaceholder.setVisibility( Loading Loading @@ -454,7 +454,7 @@ public abstract class BaseActivity super.onPostCreate(savedInstanceState); super.onPostCreate(savedInstanceState); Runnable finishActionMode = Runnable finishActionMode = (useMaterial3()) (isUseMaterial3FlagEnabled()) ? mNavigator::closeSelectionBar ? mNavigator::closeSelectionBar : mInjector.actionModeController::finishActionMode; : mInjector.actionModeController::finishActionMode; Loading @@ -479,7 +479,7 @@ public abstract class BaseActivity @Override @Override public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) { if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { // In Material3 the menu is now inflated in the `NavigationViewMenu`. This is currently // In Material3 the menu is now inflated in the `NavigationViewMenu`. This is currently // to allow for us to inflate between the action_menu and the activity menu. Once the // to allow for us to inflate between the action_menu and the activity menu. Once the // Material 3 flag is removed, the menus will be merged and we can rely on this single // Material 3 flag is removed, the menus will be merged and we can rely on this single Loading Loading @@ -510,7 +510,7 @@ public abstract class BaseActivity public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); super.onPrepareOptionsMenu(menu); // Remove the subMenu when material3 is launched b/379776735. // Remove the subMenu when material3 is launched b/379776735. if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { if (mNavigator != null) { if (mNavigator != null) { mNavigator.updateActionMenu(); mNavigator.updateActionMenu(); } } Loading Loading @@ -574,7 +574,7 @@ public abstract class BaseActivity insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), 0); insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), 0); // in M3, no additional bottom gap in full screen mode. // in M3, no additional bottom gap in full screen mode. if (!useMaterial3()) { if (!isUseMaterial3FlagEnabled()) { View saveContainer = findViewById(R.id.container_save); View saveContainer = findViewById(R.id.container_save); saveContainer.setPadding( saveContainer.setPadding( 0, 0, 0, insets.getSystemWindowInsetBottom()); 0, 0, 0, insets.getSystemWindowInsetBottom()); Loading Loading @@ -617,7 +617,7 @@ public abstract class BaseActivity return; return; } } if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { mNavigator.closeSelectionBar(); mNavigator.closeSelectionBar(); } else { } else { mInjector.actionModeController.finishActionMode(); mInjector.actionModeController.finishActionMode(); Loading Loading @@ -759,7 +759,7 @@ public abstract class BaseActivity if (roots != null) { if (roots != null) { roots.onCurrentRootChanged(); roots.onCurrentRootChanged(); } } if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { final RootsFragment navRailRoots = final RootsFragment navRailRoots = RootsFragment.getNavRail(getSupportFragmentManager()); RootsFragment.getNavRail(getSupportFragmentManager()); if (navRailRoots != null) { if (navRailRoots != null) { Loading Loading @@ -843,7 +843,7 @@ public abstract class BaseActivity mState.derivedMode = mode; mState.derivedMode = mode; // Remove the subMenu when material3 is launched b/379776735. // Remove the subMenu when material3 is launched b/379776735. if (useMaterial3()) { if (isUseMaterial3FlagEnabled()) { mInjector.menuManager.updateSubMenu(null); mInjector.menuManager.updateSubMenu(null); } else { } else { final ActionMenuView subMenuView = findViewById(R.id.sub_menu); final ActionMenuView subMenuView = findViewById(R.id.sub_menu); Loading