OSDN Git Service

AnalyticsService: send anonymous usage information to GA
[android-x86/packages-services-Analytics.git] / Service / src / org / android_x86 / analytics / Fields.java
1 /*
2  * Copyright 2016 Jide Technology Ltd.
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 package org.android_x86.analytics;
17
18 class Fields {
19
20     enum Metric {
21         METRIC_POWER_ON_NOT_INCLUDE_SLEEP(1);
22
23         private final int value;
24         Metric(int value) { this.value = value; }
25         public int getValue() { return value; }
26     }
27
28     enum FieldEnum {
29         // Google analytics fields, see http://goo.gl/M6dK2U
30         // Common fields
31         APP_ID(1),
32         APP_VERSION(2),
33         APP_NAME(3),
34         SCREEN_NAME(4);
35
36         private final int value;
37         FieldEnum(int value) { this.value = value; }
38         public int getValue() { return value; }
39     }
40
41     // Custom dimension
42     enum Dimension {
43         DIMENSION_BUILD_TYPE(1),
44         DIMENSION_BUILD_FLAVOR(2),
45         DIMENSION_DEVICE(3),
46         DIMENSION_MODEL(4),
47         DIMENSION_BUILD_VERSION(5),
48         DIMENSION_POWER_TYPE(6),
49         DIMENSION_INPUT_TYPE(7),
50         DIMENSION_DISPLAY_TYPE(8),
51         DIMENSION_TAG(9),
52         DIMENSION_NETWORK_TYPE(10),
53         DIMENSION_RESERVED(11),
54         DIMENSION_RESOLUTION(12),
55         DIMENSION_DENSITY(13);
56
57         private final int value;
58         Dimension(int value) { this.value = value; }
59         public int getValue() { return value; }
60     }
61
62     enum Type {
63         // Use int_key, see FieldEnum
64         DEFAULT(0),
65         // Use int_key, correspond to google analytics' custom dimension
66         CUSTOM_DIMENSION(1),
67         // Use int_key, correspond to google analytics' custom metric
68         CUSTOM_METRIC(2),
69         // Use keys
70         CUSTOM_GENERAL_LOG(3);
71
72         private final int value;
73         Type(int value) { this.value = value; }
74         public int getValue() { return value; }
75     }
76 }