• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 com.android.ondevicepersonalization.services.policyengine.data
18 
19 import com.android.libraries.pcc.chronicle.api.DataTypeDescriptor
20 import com.android.libraries.pcc.chronicle.api.FieldType
21 import com.android.libraries.pcc.chronicle.api.dataTypeDescriptor
22 
23 /** User Data DTD. */
24 public val USER_DATA_GENERATED_DTD: DataTypeDescriptor = dataTypeDescriptor(name =
<lambda>null25     "chronicle_dtd.UserData", cls = UserData::class) {
26       "timeSec" to FieldType.Long
27       "timezone" to FieldType.Integer
28       "orientation" to FieldType.Integer
29       "availableBytesMB" to FieldType.Integer
30       "batteryPct" to FieldType.Integer
31       "country" to FieldType.Integer
32       "language" to FieldType.Integer
33       "carrier" to FieldType.Integer
34       "osVersions" to dataTypeDescriptor(name = "chronicle_dtd.OSVersion", cls = OSVersion::class) {
35         "major" to FieldType.Integer
36         "minor" to FieldType.Integer
37         "micro" to FieldType.Integer
38       }
39       "connectionType" to FieldType.Integer
40       "connectionSpeedKbps" to FieldType.Integer
41       "networkMetered" to FieldType.Boolean
42       "deviceMetrics" to dataTypeDescriptor(name = "chronicle_dtd.DeviceMetrics", cls =
43           DeviceMetrics::class) {
44         "make" to FieldType.Integer
45         "model" to FieldType.Integer
46         "screenHeightDp" to FieldType.Integer
47         "screenWidthDp" to FieldType.Integer
48         "xdpi" to FieldType.Float
49         "ydpi" to FieldType.Float
50         "pxRatio" to FieldType.Float
51       }
52       "appInstalledHistory" to FieldType.List(dataTypeDescriptor(name =
53           "chronicle_dtd.AppInstallStatus", cls = AppInstallStatus::class) {
54         "packageName" to FieldType.String
55         "installed" to FieldType.Boolean
56       })
57       "appUsageHistory" to FieldType.List(dataTypeDescriptor(name = "chronicle_dtd.AppUsageStatus",
58           cls = AppUsageStatus::class) {
59         "packageName" to FieldType.String
60         "totalTimeUsedMillis" to FieldType.Long
61       })
62       "currentLocation" to dataTypeDescriptor(name = "chronicle_dtd.Location", cls =
63           Location::class) {
64         "timeSec" to FieldType.Long
65         "latitude" to FieldType.Double
66         "longitude" to FieldType.Double
67         "locationProvider" to FieldType.Integer
68         "preciseLocation" to FieldType.Boolean
69       }
70       "locationHistory" to FieldType.List(dataTypeDescriptor(name = "chronicle_dtd.LocationStatus",
71           cls = LocationStatus::class) {
72         "latitude" to FieldType.Double
73         "longitude" to FieldType.Double
74         "durationMillis" to FieldType.Long
75       })
76     }
77