• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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 android.support.car;
18 
19 import androidx.annotation.IntDef;
20 import androidx.annotation.Nullable;
21 
22 import java.lang.annotation.Retention;
23 import java.lang.annotation.RetentionPolicy;
24 
25 /**
26  * Utility to retrieve various static information from car.
27  */
28 public abstract class CarInfoManager implements CarManagerBase {
29 
30     /** Location of the driver is unknown. */
31     public static final int DRIVER_SIDE_UNKNOWN = 0;
32     /** Location of the driver: left. */
33     public static final int DRIVER_SIDE_LEFT   = 1;
34     /** Location of the driver: right. */
35     public static final int DRIVER_SIDE_RIGHT  = 2;
36     /** Location of the driver: center. */
37     public static final int DRIVER_SIDE_CENTER = 3;
38 
39     /** @hide */
40     @IntDef({
41         DRIVER_SIDE_UNKNOWN,
42         DRIVER_SIDE_LEFT,
43         DRIVER_SIDE_RIGHT,
44         DRIVER_SIDE_CENTER
45     })
46     @Retention(RetentionPolicy.SOURCE)
47     public @interface DriverSide {}
48 
49     /**
50      * Return manufacturer of the car.
51      * @return null if information is not available.
52      */
getManufacturer()53     public abstract @Nullable String getManufacturer() throws CarNotConnectedException;
54 
55     /**
56      * Return model name of the car. This information may not necessarily allow distinguishing
57      * different car models as the same name may be used for different cars depending on
58      * manufacturers.
59      * @return null if information is not available.
60      */
getModel()61     public abstract @Nullable String getModel() throws CarNotConnectedException;
62 
63     /**
64      * Return model year of the car in AC.
65      * @return null if information is not available.
66      */
getModelYear()67     public abstract @Nullable String getModelYear() throws CarNotConnectedException;
68 
69     /**
70      * Return unique identifier for the car. This is not VIN, and id is persistent until user
71      * resets it.
72      * @return null if information is not available.
73      */
getVehicleId()74     public abstract @Nullable String getVehicleId() throws CarNotConnectedException;
75 
76     /**
77      * Return manufacturer of the head unit.
78      * @return null if information is not available.
79      */
getHeadunitManufacturer()80     public abstract @Nullable String getHeadunitManufacturer() throws CarNotConnectedException;
81 
82     /**
83      * Return model of the headunit.
84      * @return null if information is not available.
85      */
getHeadunitModel()86     public abstract @Nullable String getHeadunitModel() throws CarNotConnectedException;
87 
88     /**
89      * Return S/W build of the headunit.
90      * @return null if information is not available.
91      */
getHeadunitSoftwareBuild()92     public abstract @Nullable String getHeadunitSoftwareBuild() throws CarNotConnectedException;
93 
94     /**
95      * Return S/W version of the headunit.
96      * @return null if information is not available.
97      */
getHeadunitSoftwareVersion()98     public abstract @Nullable String getHeadunitSoftwareVersion() throws CarNotConnectedException;
99 
100     /**
101      * Return driver side of the car.
102      * @return {@link #DRIVER_SIDE_UNKNOWN} if information is not available.
103      */
getDriverPosition()104     public abstract @DriverSide int getDriverPosition() throws CarNotConnectedException;
105 
106     /**
107      * Return fuel capacity of the car in milliliters.
108      * @return 0 if car doesn't run on fuel.
109      */
getFuelCapacity()110     public abstract float getFuelCapacity() throws CarNotConnectedException;
111 
112     /**
113      * Return array of fuel types available in the car, defined in
114      * android.hardware.automotive.vehicle.V2_0.FuelType
115      * @return empty array if no fuel types available.
116      */
getFuelTypes()117     public abstract int[] getFuelTypes() throws CarNotConnectedException;
118 
119     /**
120      * Return battery capacity of the car in WH.
121      * @return 0 if car doesn't run on battery.
122      */
getEvBatteryCapacity()123     public abstract float getEvBatteryCapacity() throws CarNotConnectedException;
124 
125     /**
126      * Return array of EV connector types available in the car, defined in
127      * android.hardware.automotive.vehicle.V2_0.EvConnectorType
128      * @return empty array if no connector types available.
129      */
getEvConnectorTypes()130     public abstract int[] getEvConnectorTypes() throws CarNotConnectedException;
131 }
132