• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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 android.car.settings;
18 
19 import android.annotation.SystemApi;
20 import android.car.annotation.AddedInOrBefore;
21 
22 /**
23  * System-level, car-related settings.
24  *
25  * @hide
26  */
27 @SystemApi
28 public class CarSettings {
29 
CarSettings()30     private CarSettings() {
31         throw new UnsupportedOperationException("this class only provide constants");
32     }
33 
34     /**
35      * Global car settings, containing preferences that always apply identically
36      * to all defined users.  Applications can read these but are not allowed to write;
37      * like the "Secure" settings, these are for preferences that the user must
38      * explicitly modify through the system UI or specialized APIs for those values.
39      *
40      * <p>To read/write the global car settings, use {@link android.provider.Settings.Global}
41      * with the keys defined here.
42      *
43      * @hide
44      */
45     public static final class Global {
46 
Global()47         private Global() {
48             throw new UnsupportedOperationException("this class only provide constants");
49         }
50 
51         /**
52          * Whether default restrictions for users have been set.
53          *
54          * @hide
55          */
56         @AddedInOrBefore(majorVersion = 33)
57         public static final String DEFAULT_USER_RESTRICTIONS_SET =
58                 "android.car.DEFAULT_USER_RESTRICTIONS_SET";
59 
60         /**
61          * Developer settings String used to explicitly disable the instrumentation service (when
62          * set to {@code "true"}.
63          *
64          * @hide
65          */
66         @AddedInOrBefore(majorVersion = 33)
67         public static final String DISABLE_INSTRUMENTATION_SERVICE =
68                 "android.car.DISABLE_INSTRUMENTATION_SERVICE";
69 
70         /**
71          * Developer settings String used to explicitly enable the user switch message when
72          * set to {@code "true"}.
73          *
74          * @hide
75          */
76         @AddedInOrBefore(majorVersion = 33)
77         public static final String ENABLE_USER_SWITCH_DEVELOPER_MESSAGE =
78                 "android.car.ENABLE_USER_SWITCH_DEVELOPER_MESSAGE";
79 
80         /**
81          * User id of the last foreground user
82          *
83          * @hide
84          */
85         @AddedInOrBefore(majorVersion = 33)
86         public static final String LAST_ACTIVE_USER_ID =
87                         "android.car.LAST_ACTIVE_USER_ID";
88 
89         /**
90          * User id of the last persistent (i.e, not counting ephemeral guests) foreground user
91          *
92          * @hide
93          */
94         @AddedInOrBefore(majorVersion = 33)
95         public static final String LAST_ACTIVE_PERSISTENT_USER_ID =
96                         "android.car.LAST_ACTIVE_PERSISTENT_USER_ID";
97 
98         /**
99          * Defines global runtime overrides to system bar policy.
100          *
101          * See {@link com.android.systemui.wm.BarControlPolicy} for value format.
102          *
103          * @hide
104          */
105         @AddedInOrBefore(majorVersion = 33)
106         public static final String SYSTEM_BAR_VISIBILITY_OVERRIDE =
107                 "android.car.SYSTEM_BAR_VISIBILITY_OVERRIDE";
108     }
109 
110     /**
111      * Default garage mode wake up time 00:00
112      *
113      * @hide
114      */
115     @AddedInOrBefore(majorVersion = 33)
116     public static final int[] DEFAULT_GARAGE_MODE_WAKE_UP_TIME = {0, 0};
117 
118     /**
119      * Default garage mode maintenance window 10 mins.
120      *
121      * @hide
122      */
123     @AddedInOrBefore(majorVersion = 33)
124     public static final int DEFAULT_GARAGE_MODE_MAINTENANCE_WINDOW = 10 * 60 * 1000; // 10 mins
125 
126     /**
127      * @hide
128      */
129     @SystemApi
130     public static final class Secure {
131 
Secure()132         private Secure() {
133             throw new UnsupportedOperationException("this class only provide constants");
134         }
135 
136         /**
137          * Key to indicate whether audio focus requests for
138          * {@link android.hardware.automotive.audiocontrol.V1_0.ContextNumber.NAVIGATION} should
139          * be rejected if focus is currently held by
140          * {@link android.hardware.automotive.audiocontrol.V1_0.ContextNumber.CALL}.
141          * <p>The value is a boolean (1 or 0) where:
142          * <ul>
143          * <li>1 indicates {@code NAVIGATION} should be rejected when a {@code CALL} is in progress.
144          * <li>0 indicates {@code NAVIGATION} and {@code CALL} should be allowed to hold focus
145          * concurrently.
146          * </ul>
147          *
148          * <p>Recommended {@code false} as default value.
149          *
150          * @hide
151          */
152         @SystemApi
153         @AddedInOrBefore(majorVersion = 33)
154         public static final String KEY_AUDIO_FOCUS_NAVIGATION_REJECTED_DURING_CALL =
155                 "android.car.KEY_AUDIO_FOCUS_NAVIGATION_REJECTED_DURING_CALL";
156 
157         /**
158          * Key to indicate if mute state should be persisted across boot cycles.
159          * <p>The value is a boolean (1 or 0) where:
160          * <ul>
161          * <li>1 indicates volume group mute states should be persisted across boot cycles.
162          * <li>0 indicates volume group mute states should not be persisted across boot cycles.
163          * </ul>
164          *
165          * @hide
166          */
167         @SystemApi
168         @AddedInOrBefore(majorVersion = 33)
169         public static final String KEY_AUDIO_PERSIST_VOLUME_GROUP_MUTE_STATES =
170                 "android.car.KEY_AUDIO_PERSIST_VOLUME_GROUP_MUTE_STATES";
171 
172         /**
173          * Key for a list of devices to automatically connect on Bluetooth.
174          * Written to and read by {@link com.android.car.BluetoothDeviceManager}
175          * @hide
176          */
177         @AddedInOrBefore(majorVersion = 33)
178         public static final String KEY_BLUETOOTH_DEVICES =
179                 "android.car.KEY_BLUETOOTH_DEVICES";
180 
181         /**
182          * Key for storing temporarily-disconnected devices and profiles.
183          * Read and written by {@link com.android.car.BluetoothProfileInhibitManager}.
184          * @hide
185          */
186         @AddedInOrBefore(majorVersion = 33)
187         public static final String KEY_BLUETOOTH_PROFILES_INHIBITED =
188                 "android.car.BLUETOOTH_PROFILES_INHIBITED";
189 
190         /**
191          * Key to enable / disable rotary key event filtering. When enabled, a USB keyboard can be
192          * used as a stand-in for a rotary controller.
193          * The value is boolean (1 or 0).
194          * @hide
195          */
196         @SystemApi
197         @AddedInOrBefore(majorVersion = 33)
198         public static final String KEY_ROTARY_KEY_EVENT_FILTER =
199                 "android.car.ROTARY_KEY_EVENT_FILTER";
200 
201         /**
202          * Key to enable / disable initial notice screen that will be shown for all user-starting
203          * moments including cold boot, wake up from suspend, and user switching.
204          * The value is boolean (1 or 0).
205          * @hide
206          */
207         @SystemApi
208         @AddedInOrBefore(majorVersion = 33)
209         public static final String KEY_ENABLE_INITIAL_NOTICE_SCREEN_TO_USER =
210                 "android.car.ENABLE_INITIAL_NOTICE_SCREEN_TO_USER";
211 
212         /**
213          * Key to indicate Setup Wizard is in progress. It differs from USER_SETUP_COMPLETE in
214          * that this flag can be reset to 0 in deferred Setup Wizard flow.
215          * The value is boolean (1 or 0).
216          * @hide
217          */
218         @SystemApi
219         @AddedInOrBefore(majorVersion = 33)
220         public static final String KEY_SETUP_WIZARD_IN_PROGRESS =
221                 "android.car.SETUP_WIZARD_IN_PROGRESS";
222 
223         /**
224          * Key for a {@code ;} separated list of packages disabled on resource overuse.
225          *
226          * <p>The value is written by {@link com.android.car.watchdog.CarWatchdogService}.
227          *
228          * <p>The value is read by user interfaces (such as launcher) that show applications
229          * disabled on resource overuse. When a user selects any application from this list,
230          * the user interface should either enable the application immediately or provide user
231          * affordance to enable the application when the driving conditions are safe.
232          *
233          * <p>When an application (which is on this list) is enabled, CarService will immediately
234          * remove the application's package name form the list.
235          * @hide
236          */
237         @SystemApi
238         @AddedInOrBefore(majorVersion = 33)
239         public static final String KEY_PACKAGES_DISABLED_ON_RESOURCE_OVERUSE =
240                 "android.car.KEY_PACKAGES_DISABLED_ON_RESOURCE_OVERUSE";
241     }
242 }
243