• 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 import android.annotation.SystemApi;
20 
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.RetentionPolicy;
23 
24 /**
25  * Units used for int or float type with no attached enum types.
26  * @hide
27  */
28 @SystemApi
29 public final class VehicleUnit {
30     /**
31      * List of Unit Types from VHAL
32      */
33     public static final int SHOULD_NOT_USE = 0x000;
34 
35     public static final int RPM = 0x02;
36 
37     public static final int HERTZ = 0x03;
38 
39     public static final int PERCENTILE = 0x10;
40 
41     public static final int MILLIMETER = 0x20;
42     public static final int METER = 0x21;
43     public static final int KILOMETER = 0x23;
44     public static final int MILE = 0x24;
45 
46     public static final int METER_PER_SEC = 0x01;
47 
48     public static final int CELSIUS = 0x30;
49     public static final int FAHRENHEIT = 0x31;
50     public static final int KELVIN = 0x32;
51 
52     public static final int MILLILITER = 0x40;
53     public static final int LITER = 0x41;
54     public static final int US_GALLON  = 0x42;
55     public static final int IMPERIAL_GALLON = 0x43;
56 
57     public static final int NANO_SECS = 0x50;
58     public static final int SECS = 0x53;
59     public static final int YEAR = 0x59;
60 
61     public static final int MILLIAMPERE = 0x61;
62     public static final int MILLIVOLT = 0x62;
63     public static final int MILLIWATTS = 0x63;
64     public static final int WATT_HOUR = 0x60;
65     public static final int AMPERE_HOURS = 0x64;
66     public static final int KILOWATT_HOUR = 0x65;
67 
68     public static final int KILOPASCAL = 0x70;
69     public static final int PSI = 0x71;
70     public static final int BAR = 0x72;
71 
72     public static final int DEGREES = 0x80;
73 
74     /** @hide */
75     public static final int MILES_PER_HOUR = 0x90;
76 
77     /** @hide */
78     public static final int KILOMETERS_PER_HOUR = 0x91;
79 
80     /** @hide */
81     @Retention(RetentionPolicy.SOURCE)
82     @IntDef({
83             SHOULD_NOT_USE,
84             METER_PER_SEC,
85             RPM,
86             HERTZ,
87             PERCENTILE,
88             MILLIMETER,
89             METER,
90             KILOMETER,
91             MILE,
92             CELSIUS,
93             FAHRENHEIT,
94             KELVIN,
95             MILLILITER,
96             LITER,
97             US_GALLON,
98             IMPERIAL_GALLON,
99             NANO_SECS,
100             SECS,
101             YEAR,
102             KILOPASCAL,
103             WATT_HOUR,
104             MILLIAMPERE,
105             MILLIVOLT,
106             MILLIWATTS,
107             AMPERE_HOURS,
108             KILOWATT_HOUR,
109             PSI,
110             BAR,
111             DEGREES,
112             MILES_PER_HOUR,
113             KILOMETERS_PER_HOUR
114     })
115     public @interface Enum {}
116 
VehicleUnit()117     private VehicleUnit() {}
118 }
119