1 /*
2  * Copyright (C) 2021 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.app.time.cts.shell;
18 
19 /** Constants for interacting with the device_config service. */
20 public final class DeviceConfigKeys {
21 
22     /**
23      * The DeviceConfig namespace used for the time_detector, time_zone_detector and
24      * location_time_zone_manager.
25      */
26     public static final String NAMESPACE_SYSTEM_TIME = "system_time";
27 
DeviceConfigKeys()28     private DeviceConfigKeys() {
29         // No need to instantiate.
30     }
31 
32     /**
33      * Keys and values associated with the location_time_zone_manager.
34      * See also {@link LocationTimeZoneManagerShellHelper}.
35      */
36     final class LocationTimeZoneManager {
37 
LocationTimeZoneManager()38         private LocationTimeZoneManager() {
39             // No need to instantiate.
40         }
41 
42         /**
43          * The key for the server flag that can override the device config for whether the primary
44          * location time zone provider is enabled, disabled, or (for testing) in simulation mode.
45          */
46         static final String KEY_PRIMARY_LOCATION_TIME_ZONE_PROVIDER_MODE_OVERRIDE =
47                 "primary_location_time_zone_provider_mode_override";
48 
49         /**
50          * The key for the server flag that can override the device config for whether the secondary
51          * location time zone provider is enabled or disabled, or (for testing) in simulation mode.
52          */
53         static final String KEY_SECONDARY_LOCATION_TIME_ZONE_PROVIDER_MODE_OVERRIDE =
54                 "secondary_location_time_zone_provider_mode_override";
55 
56         /**
57          * The "simulated" provider mode.
58          * For use with {@link #KEY_PRIMARY_LOCATION_TIME_ZONE_PROVIDER_MODE_OVERRIDE} and {@link
59          * #KEY_SECONDARY_LOCATION_TIME_ZONE_PROVIDER_MODE_OVERRIDE}.
60          */
61         static final String PROVIDER_MODE_SIMULATED = "simulated";
62 
63         /**
64          * The "disabled" provider mode (equivalent to there being no provider configured).
65          * For use with {@link #KEY_PRIMARY_LOCATION_TIME_ZONE_PROVIDER_MODE_OVERRIDE} and {@link
66          * #KEY_SECONDARY_LOCATION_TIME_ZONE_PROVIDER_MODE_OVERRIDE}.
67          */
68         static final String PROVIDER_MODE_DISABLED = "disabled";
69 
70         /**
71          * The key for the server flag that can override the device config for the package name of
72          * the primary provider (when enabled).
73          */
74         static final String KEY_PRIMARY_LOCATION_TIME_ZONE_PROVIDER_PACKAGE_NAME_OVERRIDE =
75                 "primary_location_time_zone_provider_package_name_override";
76 
77         /**
78          * The key for the server flag that can override the device config for the package name of
79          * the secondary provider (when enabled).
80          */
81         static final String KEY_SECONDARY_LOCATION_TIME_ZONE_PROVIDER_PACKAGE_NAME_OVERRIDE =
82                 "secondary_location_time_zone_provider_package_name_override";
83     }
84 
85     /**
86      * Keys and values associated with the time_detector. See also {@link
87      * TimeZoneDetectorShellHelper}.
88      */
89     public final class TimeDetector {
90 
TimeDetector()91         private TimeDetector() {
92             // No need to instantiate.
93         }
94 
95         /**
96          * See {@link
97          * com.android.server.timedetector.ServerFlags#KEY_TIME_DETECTOR_ORIGIN_PRIORITIES_OVERRIDE}
98          */
99         public static final String KEY_TIME_DETECTOR_ORIGIN_PRIORITIES_OVERRIDE =
100                 "time_detector_origin_priorities_override";
101 
102         /**
103          * See {@link com.android.server.timedetector.TimeDetectorStrategy#ORIGIN_NETWORK}.
104          */
105         public static final String ORIGIN_NETWORK = "network";
106 
107         /**
108          * See {@link com.android.server.timedetector.TimeDetectorStrategy#ORIGIN_EXTERNAL}.
109          */
110         public static final String ORIGIN_EXTERNAL = "external";
111     }
112 }
113