• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023 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.os.statsd.location;
20
21import "frameworks/proto_logging/stats/atoms.proto";
22import "frameworks/proto_logging/stats/atom_field_options.proto";
23import "frameworks/proto_logging/stats/enums/contexthub/enums.proto";
24
25option java_package = "com.android.os.location";
26option java_multiple_files = true;
27
28extend Atom {
29  optional EmergencyStateChanged emergency_state_changed = 633
30      [(module) = "framework"];
31
32 optional ChreSignificantMotionStateChanged
33      chre_significant_motion_state_changed = 868 [(module) = "chre"];
34
35  optional PopulationDensityProviderLoadingReported
36      population_density_provider_loading_reported = 1002
37      [(module) = "framework"];
38
39  optional DensityBasedCoarseLocationsUsageReported
40      density_based_coarse_locations_usage_reported = 1003
41      [(module) = "framework"];
42
43  optional DensityBasedCoarseLocationsProviderQueryReported
44      density_based_coarse_locations_provider_query_reported = 1004
45      [(module) = "framework"];
46}
47
48/**
49 * Logs when emergency state changes
50 *
51 * Logged from:
52 *   frameworks/base/services/core/java/com/android/server/location/LocationManagerService.java
53 */
54message EmergencyStateChanged {
55  optional bool is_in_emergency = 1 [
56     (state_field_option).exclusive_state = true,
57     (state_field_option).nested = false
58  ];
59}
60
61/**
62 * Logs when the significant motion state changed. Motion is detected in the
63 * CHRE nanoapp. Significant motion has a specific definition "a motion that
64 * might lead to a change in the user location"
65 */
66message ChreSignificantMotionStateChanged {
67  optional android.contexthub.ContextHubSignificantMotionState state = 1;
68}
69
70/**
71 * Logs when the LocationManagerService finds and instantiates a
72 * IPopulationDensityProvider, based on the XML configuration.
73 * Logged from:
74 *    frameworks/base/services/core/java/com/android/server/location/
75 *    LocationManagerService.java
76 * Estimated Logging Rate:
77 *    Peak: 1 times in 5 min (once per boot) | Avg: ~1 per device per day
78 */
79message PopulationDensityProviderLoadingReported {
80
81  // Is true if the provider isn't found, or if any error occurs when creating
82  // the provider.
83  optional bool provider_null = 1;
84
85  // The latency between the framework creating the
86  // ProxyPopulationDensityProvider and the Binder interface being ready.
87  optional int32 provider_start_time_millis = 2;
88}
89
90/**
91 * Logs when the LocationFudger uses the new density-based coarse locations.
92 * Logged from:
93 *    frameworks/base/services/core/java/com/android/server/location/fudger/
94 *    LocationFudgerCache.java
95 * Estimated Logging Rate:
96 *    Peak: 1 times in 10 min (rate-limited) | Avg: ~100 per device per day
97 */
98message DensityBasedCoarseLocationsUsageReported {
99
100  // If the new algo is skipped because the cache has no default.
101  optional bool skipped_no_default = 1;
102
103  // If the answer to the query was already in cache (default isn't used).
104  optional bool is_cache_hit = 2;
105
106  // Returns the default stored in the cache (used on cache miss).
107  optional int32 default_coarsening_level = 3;
108}
109
110/**
111 * Logs when the LocationFudger uses the new density-based coarse locations.
112 * Logged from:
113 *    frameworks/base/services/core/java/com/android/server/location/fudger/
114 *    LocationFudgerCache.java
115 * Estimated Logging Rate:
116 *    Peak: 1 times in 10 min (once per S2 cell at level 12. Peak is if the
117 *    device is continually changing cells, which are ~6km²).
118 *    Avg: ~100 per device per day
119 */
120 message DensityBasedCoarseLocationsProviderQueryReported {
121
122  // The latency between firing the query and receiving an answer.
123  optional int32 query_duration_millis = 1;
124
125  // Is true if querying the provider returned any error.
126  optional bool is_error = 2;
127}
128