• 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     /** @hide */
92     @Override
onCarDisconnected()93     public void onCarDisconnected() {
94         //nothing to do
95     }
96 }
97