Home | History | Annotate | Download | only in car
      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 android.support.annotation.IntDef;
     20 import android.support.annotation.Nullable;
     21 import java.lang.annotation.Retention;
     22 import java.lang.annotation.RetentionPolicy;
     23 
     24 /**
     25  * Utility to retrieve various static information from car.
     26  */
     27 public abstract class CarInfoManager implements CarManagerBase {
     28 
     29     /** Location of the driver is unknown. */
     30     public static final int DRIVER_SIDE_UNKNOWN = 0;
     31     /** Location of the driver: left. */
     32     public static final int DRIVER_SIDE_LEFT   = 1;
     33     /** Location of the driver: right. */
     34     public static final int DRIVER_SIDE_RIGHT  = 2;
     35     /** Location of the driver: center. */
     36     public static final int DRIVER_SIDE_CENTER = 3;
     37 
     38     /** @hide */
     39     @IntDef({
     40         DRIVER_SIDE_UNKNOWN,
     41         DRIVER_SIDE_LEFT,
     42         DRIVER_SIDE_RIGHT,
     43         DRIVER_SIDE_CENTER
     44     })
     45     @Retention(RetentionPolicy.SOURCE)
     46     public @interface DriverSide {}
     47 
     48     /**
     49      * Return manufacturer of the car.
     50      * @return null if information is not available.
     51      */
     52     public abstract @Nullable String getManufacturer() throws CarNotConnectedException;
     53 
     54     /**
     55      * Return model name of the car. This information may not necessarily allow distinguishing
     56      * different car models as the same name may be used for different cars depending on
     57      * manufacturers.
     58      * @return null if information is not available.
     59      */
     60     public abstract @Nullable String getModel() throws CarNotConnectedException;
     61 
     62     /**
     63      * Return model year of the car in AC.
     64      * @return null if information is not available.
     65      */
     66     public abstract @Nullable String getModelYear() throws CarNotConnectedException;
     67 
     68     /**
     69      * Return unique identifier for the car. This is not VIN, and id is persistent until user
     70      * resets it.
     71      * @return null if information is not available.
     72      */
     73     public abstract @Nullable String getVehicleId() throws CarNotConnectedException;
     74 
     75     /**
     76      * Return manufacturer of the head unit.
     77      * @return null if information is not available.
     78      */
     79     public abstract @Nullable String getHeadunitManufacturer() throws CarNotConnectedException;
     80 
     81     /**
     82      * Return model of the headunit.
     83      * @return null if information is not available.
     84      */
     85     public abstract @Nullable String getHeadunitModel() throws CarNotConnectedException;
     86 
     87     /**
     88      * Return S/W build of the headunit.
     89      * @return null if information is not available.
     90      */
     91     public abstract @Nullable String getHeadunitSoftwareBuild() throws CarNotConnectedException;
     92 
     93     /**
     94      * Return S/W version of the headunit.
     95      * @return null if information is not available.
     96      */
     97     public abstract @Nullable String getHeadunitSoftwareVersion() throws CarNotConnectedException;
     98 
     99     /**
    100      * Return driver side of the car.
    101      * @return {@link #DRIVER_SIDE_UNKNOWN} if information is not available.
    102      */
    103     public abstract @DriverSide int getDriverPosition() throws CarNotConnectedException;
    104 }
    105