• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.documentsui.testing;
18 
19 import com.android.documentsui.ActivityConfig;
20 import com.android.documentsui.base.DocumentStack;
21 import com.android.documentsui.base.State;
22 
23 public class TestActivityConfig extends ActivityConfig {
24 
25     public boolean nextSelectType = false;
26     public boolean nextDocumentEnabled = false;
27     public boolean nextManagedModeEnabled = false;
28     public boolean nextDragAndDropEnabled = false;
29 
canSelectType(String docMimeType, int docFlags, State state)30     public boolean canSelectType(String docMimeType, int docFlags, State state) {
31         return nextSelectType;
32     }
33 
isDocumentEnabled(String docMimeType, int docFlags, State state)34     public boolean isDocumentEnabled(String docMimeType, int docFlags, State state) {
35         return nextDocumentEnabled;
36     }
37 
38     /**
39      * When managed mode is enabled, active downloads will be visible in the UI.
40      * Presumably this should only be true when in the downloads directory.
41      */
managedModeEnabled(DocumentStack stack)42     public boolean managedModeEnabled(DocumentStack stack) {
43         return nextManagedModeEnabled;
44     }
45 
46     /**
47      * Whether drag n' drop is allowed in this context
48      */
dragAndDropEnabled()49     public boolean dragAndDropEnabled() {
50         return nextDragAndDropEnabled;
51     }
52 }
53