1 /*
2  * Copyright (C) 2022 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;
18 
19 import android.app.admin.DevicePolicyManager;
20 
21 /**
22  * Class containing the required identifiers to update device management resources.
23  *
24  * <p>See {@link DevicePolicyManager#getDrawable} and {@link DevicePolicyManager#getString}.
25  */
26 public class DevicePolicyResources {
27 
28     /**
29      * Class containing the identifiers used to update device management-related system strings.
30      */
31     public static final class Strings {
32         private static final String PREFIX = "DocumentsUi.";
33 
34         /**
35          * An ID for any string that can't be updated.
36          */
37         public static final String UNDEFINED = "UNDEFINED";
38 
39         /**
40          * Title for error message shown when work profile is turned off.
41          */
42         public static final String WORK_PROFILE_OFF_ERROR_TITLE =
43                 PREFIX + "WORK_PROFILE_OFF_ERROR_TITLE";
44 
45         /**
46          * Button text shown when work profile is turned off.
47          */
48         public static final String WORK_PROFILE_OFF_ENABLE_BUTTON =
49                 PREFIX + "WORK_PROFILE_OFF_ENABLE_BUTTON";
50 
51         /**
52          * Title for error message shown when a user's IT admin does not allow the user to
53          * select work files from a personal app.
54          */
55         public static final String CANT_SELECT_WORK_FILES_TITLE =
56                 PREFIX + "CANT_SELECT_WORK_FILES_TITLE";
57 
58         /**
59          * Message shown when a user's IT admin does not allow the user to select work files
60          * from a personal app.
61          */
62         public static final String CANT_SELECT_WORK_FILES_MESSAGE =
63                 PREFIX + "CANT_SELECT_WORK_FILES_MESSAGE";
64 
65         /**
66          * Title for error message shown when a user's IT admin does not allow the user to
67          * select personal files from a work app.
68          */
69         public static final String CANT_SELECT_PERSONAL_FILES_TITLE =
70                 PREFIX + "CANT_SELECT_PERSONAL_FILES_TITLE";
71 
72         /**
73          * Message shown when a user's IT admin does not allow the user to select personal files
74          * from a work app.
75          */
76         public static final String CANT_SELECT_PERSONAL_FILES_MESSAGE =
77                 PREFIX + "CANT_SELECT_PERSONAL_FILES_MESSAGE";
78 
79         /**
80          * Title for error message shown when a user's IT admin does not allow the user to save
81          * files from their personal profile to their work profile.
82          */
83         public static final String CANT_SAVE_TO_WORK_TITLE =
84                 PREFIX + "CANT_SAVE_TO_WORK_TITLE";
85 
86         /**
87          * Message shown when a user's IT admin does not allow the user to save files from their
88          * personal profile to their work profile.
89          */
90         public static final String CANT_SAVE_TO_WORK_MESSAGE =
91                 PREFIX + "CANT_SAVE_TO_WORK_MESSAGE";
92 
93         /**
94          * Title for error message shown when a user's IT admin does not allow the user to save
95          * files from their work profile to their personal profile.
96          */
97         public static final String CANT_SAVE_TO_PERSONAL_TITLE =
98                 PREFIX + "CANT_SAVE_TO_PERSONAL_TITLE";
99 
100         /**
101          * Message shown when a user's IT admin does not allow the user to save files from their
102          * work profile to their personal profile.
103          */
104         public static final String CANT_SAVE_TO_PERSONAL_MESSAGE =
105                 PREFIX + "CANT_SAVE_TO_PERSONAL_MESSAGE";
106 
107         /**
108          * Title for error message shown when a user tries to do something on their work
109          * device, but that action isn't allowed by their IT admin.
110          */
111         public static final String CROSS_PROFILE_NOT_ALLOWED_TITLE =
112                 PREFIX + "CROSS_PROFILE_NOT_ALLOWED_TITLE";
113 
114         /**
115          * Message shown when a user tries to do something on their work device, but that action
116          * isn't allowed by their IT admin.
117          */
118         public static final String CROSS_PROFILE_NOT_ALLOWED_MESSAGE =
119                 PREFIX + "CROSS_PROFILE_NOT_ALLOWED_MESSAGE";
120 
121         /**
122          * Content description text that's spoken by a screen reader for previewing a work file
123          * before opening it. Accepts file name as a param.
124          */
125         public static final String PREVIEW_WORK_FILE_ACCESSIBILITY =
126                 PREFIX + "PREVIEW_WORK_FILE_ACCESSIBILITY";
127 
128         /**
129          * Label for tab and sidebar to indicate personal content.
130          */
131         public static final String PERSONAL_TAB = PREFIX + "PERSONAL_TAB";
132 
133         /**
134          * Label for tab and sidebar tab to indicate work content
135          */
136         public static final String WORK_TAB = PREFIX + "WORK_TAB";
137 
138     }
139 
140     /**
141      * Class containing the identifiers used to update device management-related system drawable.
142      */
143     public static final class Drawables {
144         /**
145          * Specifically used to badge work profile app icons.
146          */
147         public static final String WORK_PROFILE_ICON_BADGE = "WORK_PROFILE_ICON_BADGE";
148 
149         /**
150          * General purpose work profile icon (i.e. generic icon badging). For badging app icons
151          * specifically, see {@link #WORK_PROFILE_ICON_BADGE}.
152          */
153         public static final String WORK_PROFILE_ICON = "WORK_PROFILE_ICON";
154 
155         /**
156          * General purpose icon representing the work profile off state.
157          */
158         public static final String WORK_PROFILE_OFF_ICON = "WORK_PROFILE_OFF_ICON";
159 
160         /**
161          * General purpose icon for the work profile user avatar.
162          */
163         public static final String WORK_PROFILE_USER_ICON = "WORK_PROFILE_USER_ICON";
164 
165         /**
166          * Class containing the style identifiers used to update device management-related system
167          * drawable.
168          */
169         public static final class Style {
170 
171             /**
172              * A style identifier indicating that the updatable drawable should use the default
173              * style.
174              */
175             public static final String DEFAULT = "DEFAULT";
176 
177             /**
178              * A style identifier indicating that the updatable drawable has a solid color fill.
179              */
180             public static final String SOLID_COLORED = "SOLID_COLORED";
181 
182             /**
183              * A style identifier indicating that the updatable drawable has a solid non-colored
184              * fill.
185              */
186             public static final String SOLID_NOT_COLORED = "SOLID_NOT_COLORED";
187 
188             /**
189              * A style identifier indicating that the updatable drawable is an outline.
190              */
191             public static final String OUTLINE = "OUTLINE";
192         }
193     }
194 }
195