Loading res/values/config.xml +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ <bool name="feature_job_progress_dialog">true</bool> <bool name="feature_launch_to_document">true</bool> <bool name="feature_notification_channel">true</bool> <bool name="feature_overwrite_confirmation">true</bool> <bool name="feature_remote_actions">true</bool> <bool name="feature_system_keyboard_navigation">true</bool> <bool name="feature_virtual_files_sharing">true</bool> Loading src/com/android/documentsui/base/Features.java +6 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public interface Features { boolean isJobProgressDialogEnabled(); boolean isLaunchToDocumentEnabled(); boolean isNotificationChannelEnabled(); boolean isOverwriteConfirmationEnabled(); boolean isRemoteActionsEnabled(); boolean isSystemKeyboardNavigationEnabled(); boolean isVirtualFilesSharingEnabled(); Loading Loading @@ -134,6 +135,11 @@ public interface Features { return isEnabled(R.bool.feature_notification_channel); } @Override public boolean isOverwriteConfirmationEnabled() { return isEnabled(R.bool.feature_overwrite_confirmation); } @Override public boolean isRemoteActionsEnabled() { return isEnabled(R.bool.feature_remote_actions); Loading src/com/android/documentsui/picker/ActionHandler.java +7 −1 Original line number Diff line number Diff line Loading @@ -301,7 +301,13 @@ class ActionHandler<T extends Activity & Addons> extends AbstractActionHandler<T assert(mState.action == ACTION_CREATE); assert(replaceTarget != null); // Adding a confirmation dialog breaks an inherited CTS test (testCreateExisting), so we // need to add a feature flag to bypass this feature in ARC++ environment. if (mFeatures.isOverwriteConfirmationEnabled()) { mInjector.dialogs.confirmOverwrite(fm, replaceTarget); } else { finishPicking(replaceTarget.derivedUri); } } void finishPicking(Uri... docs) { Loading tests/common/com/android/documentsui/testing/TestFeatures.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public class TestFeatures implements Features { public boolean jobProgressDialog = false; public boolean launchToDocument = true; public boolean notificationChannel = true; public boolean overwriteConfirmation = true; public boolean remoteActions = true; public boolean systemKeyboardNavigation = true; public boolean virtualFilesSharing = true; Loading Loading @@ -85,6 +86,11 @@ public class TestFeatures implements Features { return notificationChannel; } @Override public boolean isOverwriteConfirmationEnabled() { return overwriteConfirmation; } @Override public boolean isRemoteActionsEnabled() { return remoteActions; Loading tests/unit/com/android/documentsui/picker/ActionHandlerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,10 @@ public class ActionHandlerTest { @Test public void testSaveDocument_ConfirmsOverwrite() { if (!mEnv.features.isOverwriteConfirmationEnabled()) { return; } mEnv.state.action = State.ACTION_CREATE; mEnv.state.stack.changeRoot(TestProvidersAccess.HOME); mEnv.state.stack.push(TestEnv.FOLDER_1); Loading Loading
res/values/config.xml +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ <bool name="feature_job_progress_dialog">true</bool> <bool name="feature_launch_to_document">true</bool> <bool name="feature_notification_channel">true</bool> <bool name="feature_overwrite_confirmation">true</bool> <bool name="feature_remote_actions">true</bool> <bool name="feature_system_keyboard_navigation">true</bool> <bool name="feature_virtual_files_sharing">true</bool> Loading
src/com/android/documentsui/base/Features.java +6 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public interface Features { boolean isJobProgressDialogEnabled(); boolean isLaunchToDocumentEnabled(); boolean isNotificationChannelEnabled(); boolean isOverwriteConfirmationEnabled(); boolean isRemoteActionsEnabled(); boolean isSystemKeyboardNavigationEnabled(); boolean isVirtualFilesSharingEnabled(); Loading Loading @@ -134,6 +135,11 @@ public interface Features { return isEnabled(R.bool.feature_notification_channel); } @Override public boolean isOverwriteConfirmationEnabled() { return isEnabled(R.bool.feature_overwrite_confirmation); } @Override public boolean isRemoteActionsEnabled() { return isEnabled(R.bool.feature_remote_actions); Loading
src/com/android/documentsui/picker/ActionHandler.java +7 −1 Original line number Diff line number Diff line Loading @@ -301,7 +301,13 @@ class ActionHandler<T extends Activity & Addons> extends AbstractActionHandler<T assert(mState.action == ACTION_CREATE); assert(replaceTarget != null); // Adding a confirmation dialog breaks an inherited CTS test (testCreateExisting), so we // need to add a feature flag to bypass this feature in ARC++ environment. if (mFeatures.isOverwriteConfirmationEnabled()) { mInjector.dialogs.confirmOverwrite(fm, replaceTarget); } else { finishPicking(replaceTarget.derivedUri); } } void finishPicking(Uri... docs) { Loading
tests/common/com/android/documentsui/testing/TestFeatures.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public class TestFeatures implements Features { public boolean jobProgressDialog = false; public boolean launchToDocument = true; public boolean notificationChannel = true; public boolean overwriteConfirmation = true; public boolean remoteActions = true; public boolean systemKeyboardNavigation = true; public boolean virtualFilesSharing = true; Loading Loading @@ -85,6 +86,11 @@ public class TestFeatures implements Features { return notificationChannel; } @Override public boolean isOverwriteConfirmationEnabled() { return overwriteConfirmation; } @Override public boolean isRemoteActionsEnabled() { return remoteActions; Loading
tests/unit/com/android/documentsui/picker/ActionHandlerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,10 @@ public class ActionHandlerTest { @Test public void testSaveDocument_ConfirmsOverwrite() { if (!mEnv.features.isOverwriteConfirmationEnabled()) { return; } mEnv.state.action = State.ACTION_CREATE; mEnv.state.stack.changeRoot(TestProvidersAccess.HOME); mEnv.state.stack.push(TestEnv.FOLDER_1); Loading