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.devicelock;
20
21import "frameworks/proto_logging/stats/atom_field_options.proto";
22import "frameworks/proto_logging/stats/atoms.proto";
23
24option java_package = "com.android.os.devicelock";
25option java_multiple_files = true;
26
27extend Atom {
28  optional DeviceLockCheckInRequestReported device_lock_check_in_request_reported = 726
29          [(module) = "devicelock"];
30  optional DeviceLockProvisioningCompleteReported device_lock_provisioning_complete_reported = 727
31          [(module) = "devicelock"];
32  optional DeviceLockKioskAppRequestReported device_lock_kiosk_app_request_reported = 728
33          [(module) = "devicelock"];
34  optional CheckInRetryReported device_lock_check_in_retry_reported = 789
35          [(module) = "devicelock"];
36  optional ProvisionFailureReported device_lock_provision_failure_reported = 790
37          [(module) = "devicelock"];
38  optional LockUnlockDeviceFailureReported device_lock_lock_unlock_device_failure_reported = 791
39          [(module) = "devicelock"];
40}
41
42message DeviceLockCheckInRequestReported {
43  enum RequestType {
44    // Default value for the request type
45    UNKNOWN = 0;
46    // The Check-in request is getDeviceCheckInStatus
47    GET_DEVICE_CHECK_IN_STATUS = 1;
48    // The Check-in request is pauseDeviceProvisioning
49    PAUSE_DEVICE_PROVISIONING = 2;
50    // The Check-in request is reportDeviceProvisioningComplete
51    // DEPRECATED, because the gRPC call for this log type is removed
52    REPORT_DEVICE_PROVISIONING_COMPLETE = 3 [deprecated = true];
53    // The Check-in request is reportDeviceProvisionState
54    REPORT_DEVICE_PROVISION_STATE = 4;
55    // The Check-in request is isDeviceInApprovedCountry
56    IS_DEVICE_IN_APPROVED_COUNTRY = 5;
57  }
58
59  optional RequestType type = 1;
60}
61
62message DeviceLockProvisioningCompleteReported {
63  optional int64 time_spent_on_provisioning_seconds = 1;
64}
65
66message DeviceLockKioskAppRequestReported {
67  optional int32 kiosk_app_uid = 1 [(is_uid) = true];
68}
69
70message CheckInRetryReported {
71  enum RetryReason {
72    // Check-in retry happens because server did not specify next step.
73    RESPONSE_UNSPECIFIED = 0;
74    // Check-in retry happens due to provisioning configuration unavailable
75    COUNFIGURATION_UNAVAILABLE = 1;
76    // Check-in retry happens due to network time being unavailable
77    NETWORK_TIME_UNAVAILABLE = 2;
78    // Check-in retry happens due to an failure in the previous RPC
79    RPC_FAILURE = 3;
80  }
81
82  optional RetryReason reason= 1;
83}
84
85message ProvisionFailureReported {
86  enum FailureReason {
87    // Reason is unknown
88    UNKNOWN = 0;
89    // Failed due to play task unavailable
90    PLAY_TASK_UNAVAILABLE = 1;
91    // Failed due to installation from play unsuccessful
92    PLAY_INSTALLATION_FAILED = 2;
93    // Failed due to country eligibility unknown
94    COUNTRY_INFO_UNAVAILABLE = 3;
95    // Failed due to country not eligible
96    NOT_IN_ELIGIBLE_COUNTRY = 4;
97    // Failed due to unable to enforce policies
98    POLICY_ENFORCEMENT_FAILED = 5;
99  }
100
101  optional FailureReason reason = 1;
102}
103
104message LockUnlockDeviceFailureReported {
105  enum DeviceState {
106    // Device state is undefined.
107    UNDEFINED = 0;
108    // Device state is unlocked.
109    UNLOCKED = 1;
110    // Device state is locked.
111    LOCKED = 2;
112    // Device state is cleared.
113    CLEARED = 3;
114  }
115
116  // True if the command is lock; false if it is unlock.
117  optional bool is_lock = 1;
118  optional DeviceState state_post_command = 2;
119}
120