• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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 
20 /** @hide */
21 public class CarInfoManagerEmbedded extends CarInfoManager {
22 
23     private final android.car.CarInfoManager mManager;
24 
25     /** @hide */
CarInfoManagerEmbedded(Object manager)26     CarInfoManagerEmbedded(Object manager) {
27         mManager = (android.car.CarInfoManager) manager;
28     }
29 
30     @Override
getManufacturer()31     public String getManufacturer() throws CarNotConnectedException {
32         try {
33             return mManager.getManufacturer();
34         } catch (android.car.CarNotConnectedException e) {
35             throw new CarNotConnectedException(e);
36         }
37     }
38 
39     @Override
getModel()40     public String getModel() throws CarNotConnectedException {
41         try {
42             return mManager.getModel();
43         } catch (android.car.CarNotConnectedException e) {
44             throw new CarNotConnectedException(e);
45         }
46     }
47 
48     @Override
getModelYear()49     public String getModelYear() throws CarNotConnectedException {
50         try {
51             return mManager.getModelYear();
52         } catch (android.car.CarNotConnectedException e) {
53             throw new CarNotConnectedException(e);
54         }
55     }
56 
57     @Override
getVehicleId()58     public String getVehicleId() throws CarNotConnectedException {
59         try {
60             return mManager.getVehicleId();
61         } catch (android.car.CarNotConnectedException e) {
62             throw new CarNotConnectedException(e);
63         }
64     }
65 
66     @Override
getHeadunitManufacturer()67     public String getHeadunitManufacturer() throws CarNotConnectedException {
68         return null;
69     }
70 
71     @Override
getHeadunitModel()72     public String getHeadunitModel() throws CarNotConnectedException {
73         return null; // N/A
74     }
75 
76     @Override
getHeadunitSoftwareBuild()77     public String getHeadunitSoftwareBuild() throws CarNotConnectedException {
78         return null; // N/A
79     }
80 
81     @Override
getHeadunitSoftwareVersion()82     public String getHeadunitSoftwareVersion() throws CarNotConnectedException {
83         return null; // N/A
84     }
85 
86     @Override
getDriverPosition()87     public int getDriverPosition() throws CarNotConnectedException {
88         return CarInfoManager.DRIVER_SIDE_UNKNOWN; // N/A
89     }
90 
91     @Override
getFuelCapacity()92     public float getFuelCapacity() throws CarNotConnectedException {
93         try {
94             return mManager.getFuelCapacity();
95         } catch (android.car.CarNotConnectedException e) {
96             throw new CarNotConnectedException(e);
97         }
98     }
99 
100     @Override
getFuelTypes()101     public int[] getFuelTypes() throws CarNotConnectedException {
102         try {
103             return mManager.getFuelTypes();
104         } catch (android.car.CarNotConnectedException e) {
105             throw new CarNotConnectedException(e);
106         }
107     }
108 
109     @Override
getEvBatteryCapacity()110     public float getEvBatteryCapacity() throws CarNotConnectedException {
111         try {
112             return mManager.getEvBatteryCapacity();
113         } catch (android.car.CarNotConnectedException e) {
114             throw new CarNotConnectedException(e);
115         }
116     }
117 
118     @Override
getEvConnectorTypes()119     public int[] getEvConnectorTypes() throws CarNotConnectedException {
120         try {
121             return mManager.getEvConnectorTypes();
122         } catch (android.car.CarNotConnectedException e) {
123             throw new CarNotConnectedException(e);
124         }
125     }
126 
127     /** @hide */
128     @Override
onCarDisconnected()129     public void onCarDisconnected() {
130         //nothing to do
131     }
132 }
133