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 
21 /**
22  * System-level, car-related settings.
23  *
24  * @hide
25  */
26 @SystemApi
27 public class CarSettings {
28 
CarSettings()29     private CarSettings() {
30         throw new UnsupportedOperationException("this class only provide constants");
31     }
32 
33     /**
34      * Global car settings, containing preferences that always apply identically
35      * to all defined users.  Applications can read these but are not allowed to write;
36      * like the "Secure" settings, these are for preferences that the user must
37      * explicitly modify through the system UI or specialized APIs for those values.
38      *
39      * <p>To read/write the global car settings, use {@link android.provider.Settings.Global}
40      * with the keys defined here.
41      *
42      * @hide
43      */
44     public static final class Global {
45 
Global()46         private Global() {
47             throw new UnsupportedOperationException("this class only provide constants");
48         }
49 
50         /**
51          * Whether default restrictions for users have been set.
52          *
53          * @hide
54          */
55         public static final String DEFAULT_USER_RESTRICTIONS_SET =
56                 "android.car.DEFAULT_USER_RESTRICTIONS_SET";
57 
58         /**
59          * Developer settings String used to explicitly disable the instrumentation service (when
60          * set to {@code "true"}.
61          *
62          * @hide
63          */
64         public static final String DISABLE_INSTRUMENTATION_SERVICE =
65                 "android.car.DISABLE_INSTRUMENTATION_SERVICE";
66 
67         /**
68          * Developer settings String used to explicitly enable the user switch message when
69          * set to {@code "true"}.
70          *
71          * @hide
72          */
73         public static final String ENABLE_USER_SWITCH_DEVELOPER_MESSAGE =
74                 "android.car.ENABLE_USER_SWITCH_DEVELOPER_MESSAGE";
75 
76         /**
77          * User id of the last foreground user
78          *
79          * @hide
80          */
81         public static final String LAST_ACTIVE_USER_ID =
82                         "android.car.LAST_ACTIVE_USER_ID";
83 
84         /**
85          * User id of the last persistent (i.e, not counting ephemeral guests) foreground user
86          *
87          * @hide
88          */
89         public static final String LAST_ACTIVE_PERSISTENT_USER_ID =
90                         "android.car.LAST_ACTIVE_PERSISTENT_USER_ID";
91 
92         /**
93          * Defines global runtime overrides to system bar policy.
94          *
95          * See {@link com.android.systemui.wm.BarControlPolicy} for value format.
96          *
97          * @hide
98          */
99         public static final String SYSTEM_BAR_VISIBILITY_OVERRIDE =
100                 "android.car.SYSTEM_BAR_VISIBILITY_OVERRIDE";
101     }
102 
103     /**
104      * Default garage mode wake up time 00:00
105      *
106      * @hide
107      */
108     public static final int[] DEFAULT_GARAGE_MODE_WAKE_UP_TIME = {0, 0};
109 
110     /**
111      * Default garage mode maintenance window 10 mins.
112      *
113      * @hide
114      */
115     public static final int DEFAULT_GARAGE_MODE_MAINTENANCE_WINDOW = 10 * 60 * 1000; // 10 mins
116 
117     /**
118      * @hide
119      */
120     @SystemApi
121     public static final class Secure {
122 
Secure()123         private Secure() {
124             throw new UnsupportedOperationException("this class only provide constants");
125         }
126 
127         /**
128          * Key to indicate whether audio focus requests for
129          * {@link android.hardware.automotive.audiocontrol.V1_0.ContextNumber.NAVIGATION} should
130          * be rejected if focus is currently held by
131          * {@link android.hardware.automotive.audiocontrol.V1_0.ContextNumber.CALL}.
132          * <p>The value is a boolean (1 or 0) where:
133          * <ul>
134          * <li>1 indicates {@code NAVIGATION} should be rejected when a {@code CALL} is in progress.
135          * <li>0 indicates {@code NAVIGATION} and {@code CALL} should be allowed to hold focus
136          * concurrently.
137          * </ul>
138          *
139          * <p>Recommended {@code false} as default value.
140          *
141          * @hide
142          */
143         @SystemApi
144         public static final String KEY_AUDIO_FOCUS_NAVIGATION_REJECTED_DURING_CALL =
145                 "android.car.KEY_AUDIO_FOCUS_NAVIGATION_REJECTED_DURING_CALL";
146 
147         /**
148          * Key for a list of devices to automatically connect on Bluetooth A2DP Sink profile
149          * Written to and read by {@link com.android.car.BluetoothDeviceConnectionPolicy}
150          * @hide
151          */
152         public static final String KEY_BLUETOOTH_A2DP_SINK_DEVICES =
153                 "android.car.KEY_BLUETOOTH_A2DP_SINK_DEVICES";
154 
155         /**
156          * Key for a list of devices to automatically connect on Bluetooth PAN profile
157          * Written to and read by {@link com.android.car.BluetoothDeviceConnectionPolicy}
158          * @hide
159          */
160         public static final String KEY_BLUETOOTH_PAN_DEVICES =
161                 "android.car.KEY_BLUETOOTH_PAN_DEVICES";
162 
163         /**
164          * Key for a list of devices to automatically connect on Bluetooth HFP Client profile
165          * Written to and read by {@link com.android.car.BluetoothDeviceConnectionPolicy}
166          * @hide
167          */
168         public static final String KEY_BLUETOOTH_HFP_CLIENT_DEVICES =
169                 "android.car.KEY_BLUETOOTH_HFP_CLIENT_DEVICES";
170 
171         /**
172          * Key for a list of devices to automatically connect on Bluetooth MAP Client profile
173          * Written to and read by {@link com.android.car.BluetoothDeviceConnectionPolicy}
174          * @hide
175          */
176         public static final String KEY_BLUETOOTH_MAP_CLIENT_DEVICES =
177                 "android.car.KEY_BLUETOOTH_MAP_CLIENT_DEVICES";
178 
179         /**
180          * Key for a list of devices to automatically connect on Bluetooth PBAP Client profile
181          * Written to and read by {@link com.android.car.BluetoothDeviceConnectionPolicy}
182          * @hide
183          */
184         public static final String KEY_BLUETOOTH_PBAP_CLIENT_DEVICES =
185                 "android.car.KEY_BLUETOOTH_PBAP_CLIENT_DEVICES";
186 
187         /**
188          * Key for storing temporarily-disconnected devices and profiles.
189          * Read and written by {@link com.android.car.BluetoothDeviceConnectionPolicy}.
190          * @hide
191          */
192         public static final String KEY_BLUETOOTH_PROFILES_INHIBITED =
193                 "android.car.BLUETOOTH_PROFILES_INHIBITED";
194 
195         /**
196          * Key to enable / disable initial notice screen that will be shown for all user-starting
197          * moments including cold boot, wake up from suspend, and user switching.
198          * The value is boolean (1 or 0).
199          * @hide
200          */
201         public static final String KEY_ENABLE_INITIAL_NOTICE_SCREEN_TO_USER =
202                 "android.car.ENABLE_INITIAL_NOTICE_SCREEN_TO_USER";
203 
204         /**
205          * Key to indicate Setup Wizard is in progress. It differs from USER_SETUP_COMPLETE in
206          * that this flag can be reset to 0 in deferred Setup Wizard flow.
207          * The value is boolean (1 or 0).
208          * @hide
209          */
210         public static final String KEY_SETUP_WIZARD_IN_PROGRESS =
211                 "android.car.SETUP_WIZARD_IN_PROGRESS";
212     }
213 }
214