summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/documentsui/dirlist/DirectoryFragment.java6
-rw-r--r--tests/functional/com/android/documentsui/FileManagementUiTest.java15
2 files changed, 20 insertions, 1 deletions
diff --git a/src/com/android/documentsui/dirlist/DirectoryFragment.java b/src/com/android/documentsui/dirlist/DirectoryFragment.java
index 078498153..9cd7c2f7c 100644
--- a/src/com/android/documentsui/dirlist/DirectoryFragment.java
+++ b/src/com/android/documentsui/dirlist/DirectoryFragment.java
@@ -1535,7 +1535,11 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On
// For orientation changed case, sometimes the docs loading comes after the menu
// update. We need to update the menu here to ensure the status is correct.
mInjector.menuManager.updateModel(mModel);
- mInjector.menuManager.updateOptionMenu();
+ if (useMaterial3()) {
+ mActivity.getNavigator().updateActionMenu();
+ } else {
+ mInjector.menuManager.updateOptionMenu();
+ }
if (VersionUtils.isAtLeastS()) {
mActivity.updateHeader(update.hasCrossProfileException());
} else {
diff --git a/tests/functional/com/android/documentsui/FileManagementUiTest.java b/tests/functional/com/android/documentsui/FileManagementUiTest.java
index 4bbd8c6eb..43b74bd33 100644
--- a/tests/functional/com/android/documentsui/FileManagementUiTest.java
+++ b/tests/functional/com/android/documentsui/FileManagementUiTest.java
@@ -124,6 +124,21 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> {
bots.directory.waitForDocument("file1.png");
}
+ @HugeLongTest
+ public void testKeyboard_PasteDocumentWhileSelectionActive() throws Exception {
+ bots.directory.selectDocument("file1.png", 1);
+ bots.keyboard.pressKey(KeyEvent.KEYCODE_C, KeyEvent.META_CTRL_ON);
+
+ device.waitForIdle();
+ bots.directory.openDocument("Dir1");
+ bots.directory.selectDocument("ChildDir1", 1);
+
+ bots.keyboard.pressKey(KeyEvent.KEYCODE_V, KeyEvent.META_CTRL_ON);
+ device.waitForIdle();
+
+ bots.directory.assertDocumentsPresent("file1.png");
+ }
+
public void testDeleteDocument_Cancel() throws Exception {
bots.directory.selectDocument("file1.png", 1);
device.waitForIdle();