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
17syntax = "proto2";
18package android.app.time;
19
20import "frameworks/base/core/proto/android/privacy.proto";
21
22option java_multiple_files = true;
23option java_outer_classname = "TimeZoneDetectorProto";
24
25// Represents a GeolocationTimeZoneSuggestion that can be / has been passed to the time zone
26// detector.
27message GeolocationTimeZoneSuggestionProto {
28  option (android.msg_privacy).dest = DEST_AUTOMATIC;
29
30  repeated string zone_ids = 1;
31  repeated string debug_info = 2;
32}
33
34/*
35 * An obfuscated and simplified time zone suggestion for metrics use.
36 *
37 * The suggestion's time zone IDs (which relate to location) are obfuscated by
38 * mapping them to an ordinal. When the ordinal is assigned consistently across
39 * several objects (i.e. so the same time zone ID is always mapped to the same
40 * ordinal), this allows comparisons between those objects. For example, we can
41 * answer "did these two suggestions agree?", "does the suggestion match the
42 * device's current time zone?", without leaking knowledge of location. Ordinals
43 * are also significantly more compact than full IANA TZDB IDs, albeit highly
44 * unstable and of limited use.
45 */
46message MetricsTimeZoneSuggestion {
47  option (android.msg_privacy).dest = DEST_AUTOMATIC;
48
49  enum Type {
50    CERTAIN = 1;
51    UNCERTAIN = 2;
52  }
53  optional Type type = 1;
54
55  // The ordinals for time zone(s) in the suggestion. Always empty for
56  // UNCERTAIN, and can be empty for CERTAIN, for example when the device is in
57  // a disputed area / on an ocean.
58  repeated uint32 time_zone_ordinals = 2;
59}
60