1/*
2 * Copyright (C) 2019 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
17syntax = "proto2";
18
19package android.stats.location;
20option java_outer_classname = "LocationStatsEnums";
21
22
23// APIs from LocationManagerService
24enum LocationManagerServiceApi {
25    API_UNKNOWN = 0;
26    API_REQUEST_LOCATION_UPDATES = 1;
27    API_ADD_GNSS_MEASUREMENTS_LISTENER = 2;
28    API_REGISTER_GNSS_STATUS_CALLBACK = 3;
29    API_REQUEST_GEOFENCE = 4;
30    API_SEND_EXTRA_COMMAND = 5;
31}
32
33enum UsageState {
34    USAGE_STARTED = 0;
35    USAGE_ENDED = 1;
36}
37
38// Type of location providers
39enum ProviderType {
40    PROVIDER_UNKNOWN = 0;
41    PROVIDER_NETWORK = 1;
42    PROVIDER_GPS = 2;
43    PROVIDER_PASSIVE = 3;
44    PROVIDER_FUSED = 4;
45}
46
47// Type of Callback passed in for this API
48enum CallbackType {
49    CALLBACK_UNKNOWN = 0;
50    // Current API does not need a callback, e.g. sendExtraCommand
51    CALLBACK_NOT_APPLICABLE = 1;
52    CALLBACK_LISTENER = 2;
53    CALLBACK_PENDING_INTENT = 3;
54}
55
56// Possible values for mQuality field in
57// frameworks/base/location/java/android/location/LocationRequest.java
58enum LocationRequestQuality {
59    QUALITY_UNKNOWN = 0;
60    ACCURACY_FINE = 100;
61    ACCURACY_BLOCK = 102;
62    ACCURACY_CITY = 104;
63    POWER_NONE = 200;
64    POWER_LOW = 201;
65    POWER_HIGH = 203;
66}
67
68// Bucketized values for interval field in
69// frameworks/base/location/java/android/location/LocationRequest.java
70enum LocationRequestIntervalBucket {
71    INTERVAL_UNKNOWN = 0;
72    INTERVAL_BETWEEN_0_SEC_AND_1_SEC = 1;
73    INTERVAL_BETWEEN_1_SEC_AND_5_SEC = 2;
74    INTERVAL_BETWEEN_5_SEC_AND_1_MIN = 3;
75    INTERVAL_BETWEEN_1_MIN_AND_10_MIN = 4;
76    INTERVAL_BETWEEN_10_MIN_AND_1_HOUR = 5;
77    INTERVAL_LARGER_THAN_1_HOUR = 6;
78}
79
80// Bucketized values for small displacement field in
81// frameworks/base/location/java/android/location/LocationRequest.java
82// Value in meters.
83enum SmallestDisplacementBucket {
84    DISTANCE_UNKNOWN = 0;
85    DISTANCE_ZERO = 1;
86    DISTANCE_BETWEEN_0_AND_100 = 2;
87    DISTANCE_LARGER_THAN_100 = 3;
88}
89
90// Bucketized values for expire_in field in
91// frameworks/base/location/java/android/location/LocationRequest.java
92enum ExpirationBucket {
93    EXPIRATION_UNKNOWN = 0;
94    EXPIRATION_BETWEEN_0_AND_20_SEC = 1;
95    EXPIRATION_BETWEEN_20_SEC_AND_1_MIN = 2;
96    EXPIRATION_BETWEEN_1_MIN_AND_10_MIN = 3;
97    EXPIRATION_BETWEEN_10_MIN_AND_1_HOUR = 4;
98    EXPIRATION_LARGER_THAN_1_HOUR = 5;
99    EXPIRATION_NO_EXPIRY = 6;
100}
101
102// Bucketized values for radius field in
103// frameworks/base/location/java/android/location/Geofence.java
104// Value in meters.
105enum GeofenceRadiusBucket {
106    RADIUS_UNKNOWN = 0;
107    RADIUS_BETWEEN_0_AND_100 = 1;
108    RADIUS_BETWEEN_100_AND_200 = 2;
109    RADIUS_BETWEEN_200_AND_300 = 3;
110    RADIUS_BETWEEN_300_AND_1000 = 4;
111    RADIUS_BETWEEN_1000_AND_10000 = 5;
112    RADIUS_LARGER_THAN_100000 = 6;
113    RADIUS_NEGATIVE = 7;
114}
115
116// Caller Activity Importance.
117enum ActivityImportance {
118    IMPORTANCE_UNKNOWN = 0;
119    IMPORTANCE_TOP = 1;
120    IMPORTANCE_FORGROUND_SERVICE = 2;
121    IMPORTANCE_BACKGROUND = 3;
122}
123