• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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 package android.car;
17 
18 import android.annotation.IntDef;
19 
20 import java.lang.annotation.Retention;
21 import java.lang.annotation.RetentionPolicy;
22 
23 /**
24  * Units used for int or float type with no attached enum types.
25  * @hide
26  */
27 public final class VehicleUnit {
28     /**
29      * List of Unit Types from VHAL
30      */
31     public static final int SHOULD_NOT_USE = 0x000;
32 
33     public static final int METER_PER_SEC = 0x01;
34     public static final int RPM = 0x02;
35     public static final int HERTZ = 0x03;
36     public static final int PERCENTILE = 0x10;
37     public static final int MILLIMETER = 0x20;
38     public static final int METER = 0x21;
39     public static final int KILOMETER = 0x23;
40     public static final int CELSIUS = 0x30;
41     public static final int FAHRENHEIT = 0x31;
42     public static final int KELVIN = 0x32;
43     public static final int MILLILITER = 0x40;
44     public static final int NANO_SECS = 0x50;
45     public static final int SECS = 0x53;
46     public static final int YEAR = 0x59;
47     public static final int KILOPASCAL = 0x70;
48     public static final int WATT_HOUR = 0x60;
49     public static final int MILLIAMPERE = 0x61;
50     public static final int MILLIVOLT = 0x62;
51     public static final int MILLIWATTS = 0x63;
52 
53     /** @hide */
54     @Retention(RetentionPolicy.SOURCE)
55     @IntDef({
56             SHOULD_NOT_USE,
57             METER_PER_SEC,
58             RPM,
59             HERTZ,
60             PERCENTILE,
61             MILLIMETER,
62             METER,
63             KILOMETER,
64             CELSIUS,
65             FAHRENHEIT,
66             KELVIN,
67             MILLILITER,
68             NANO_SECS,
69             SECS,
70             YEAR,
71             KILOPASCAL,
72             WATT_HOUR,
73             MILLIAMPERE,
74             MILLIVOLT,
75             MILLIWATTS
76     })
77     public @interface Enum {}
78 
VehicleUnit()79     private VehicleUnit() {}
80 }
81