X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Service%2Fsrc%2Forg%2Fandroid_x86%2Fanalytics%2FFields.java;fp=Service%2Fsrc%2Forg%2Fandroid_x86%2Fanalytics%2FFields.java;h=95fb97f4fa5029420970e8525c69d42b4a44d31c;hb=bafb078d9cdec28c16553de479e413229e7bcad2;hp=0000000000000000000000000000000000000000;hpb=1e4bc49f0f1339d7c9f417b73ff359daf5dd1468;p=android-x86%2Fpackages-services-Analytics.git diff --git a/Service/src/org/android_x86/analytics/Fields.java b/Service/src/org/android_x86/analytics/Fields.java new file mode 100644 index 0000000..95fb97f --- /dev/null +++ b/Service/src/org/android_x86/analytics/Fields.java @@ -0,0 +1,76 @@ +/* + * Copyright 2016 Jide Technology Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.android_x86.analytics; + +class Fields { + + enum Metric { + METRIC_POWER_ON_NOT_INCLUDE_SLEEP(1); + + private final int value; + Metric(int value) { this.value = value; } + public int getValue() { return value; } + } + + enum FieldEnum { + // Google analytics fields, see http://goo.gl/M6dK2U + // Common fields + APP_ID(1), + APP_VERSION(2), + APP_NAME(3), + SCREEN_NAME(4); + + private final int value; + FieldEnum(int value) { this.value = value; } + public int getValue() { return value; } + } + + // Custom dimension + enum Dimension { + DIMENSION_BUILD_TYPE(1), + DIMENSION_BUILD_FLAVOR(2), + DIMENSION_DEVICE(3), + DIMENSION_MODEL(4), + DIMENSION_BUILD_VERSION(5), + DIMENSION_POWER_TYPE(6), + DIMENSION_INPUT_TYPE(7), + DIMENSION_DISPLAY_TYPE(8), + DIMENSION_TAG(9), + DIMENSION_NETWORK_TYPE(10), + DIMENSION_RESERVED(11), + DIMENSION_RESOLUTION(12), + DIMENSION_DENSITY(13); + + private final int value; + Dimension(int value) { this.value = value; } + public int getValue() { return value; } + } + + enum Type { + // Use int_key, see FieldEnum + DEFAULT(0), + // Use int_key, correspond to google analytics' custom dimension + CUSTOM_DIMENSION(1), + // Use int_key, correspond to google analytics' custom metric + CUSTOM_METRIC(2), + // Use keys + CUSTOM_GENERAL_LOG(3); + + private final int value; + Type(int value) { this.value = value; } + public int getValue() { return value; } + } +}