diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-05-10 19:34:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-05-10 19:34:53 +0000 |
commit | 1c94fa08318c8b8a75d9f299a60abe2f867da4fc (patch) | |
tree | b43df9fcc22ebca32d60a4e0236e150318073dd0 /car-lib/src/android | |
parent | 296706b225e8c518e6e5b837f20120c8bf0bb3d7 (diff) | |
parent | c2393683cf3c144461fe2ba28f4fa8cd817d8cb1 (diff) | |
download | Car-1c94fa08318c8b8a75d9f299a60abe2f867da4fc.tar.gz |
Merge "Add APIs to CarDiagnosticManager to check whether specific features are enabled"
Diffstat (limited to 'car-lib/src/android')
-rw-r--r-- | car-lib/src/android/car/hardware/CarDiagnosticManager.java | 66 | ||||
-rw-r--r-- | car-lib/src/android/car/hardware/ICarDiagnostic.aidl | 22 |
2 files changed, 87 insertions, 1 deletions
diff --git a/car-lib/src/android/car/hardware/CarDiagnosticManager.java b/car-lib/src/android/car/hardware/CarDiagnosticManager.java index 851dd878d3..0444c14389 100644 --- a/car-lib/src/android/car/hardware/CarDiagnosticManager.java +++ b/car-lib/src/android/car/hardware/CarDiagnosticManager.java @@ -271,6 +271,72 @@ public final class CarDiagnosticManager implements CarManagerBase { return false; } + /** + * Returns true if this vehicle supports sending live frame information. + * @return + * @throws CarNotConnectedException + */ + public boolean isLiveFrameSupported() throws CarNotConnectedException { + try { + return mService.isLiveFrameSupported(); + } catch (IllegalStateException e) { + CarApiUtil.checkCarNotConnectedExceptionFromCarService(e); + } catch (RemoteException e) { + throw new CarNotConnectedException(); + } + return false; + } + + /** + * Returns true if this vehicle supports sending freeze frame information. + * @return + * @throws CarNotConnectedException + */ + public boolean isFreezeFrameSupported() throws CarNotConnectedException { + try { + return mService.isFreezeFrameSupported(); + } catch (IllegalStateException e) { + CarApiUtil.checkCarNotConnectedExceptionFromCarService(e); + } catch (RemoteException e) { + throw new CarNotConnectedException(); + } + return false; + } + + /** + * Returns true if this vehicle supports retrieving freeze frame timestamps. + * This is only meaningful if freeze frame data is also supported. + * @return + * @throws CarNotConnectedException + */ + public boolean isFreezeFrameTimestampSupported() throws CarNotConnectedException { + try { + return mService.isFreezeFrameTimestampSupported(); + } catch (IllegalStateException e) { + CarApiUtil.checkCarNotConnectedExceptionFromCarService(e); + } catch (RemoteException e) { + throw new CarNotConnectedException(); + } + return false; + } + + /** + * Returns true if this vehicle supports clearing freeze frame timestamps. + * This is only meaningful if freeze frame data is also supported. + * @return + * @throws CarNotConnectedException + */ + public boolean isFreezeFrameClearSupported() throws CarNotConnectedException { + try { + return mService.isFreezeFrameClearSupported(); + } catch (IllegalStateException e) { + CarApiUtil.checkCarNotConnectedExceptionFromCarService(e); + } catch (RemoteException e) { + throw new CarNotConnectedException(); + } + return false; + } + private static class CarDiagnosticEventListenerToService extends ICarDiagnosticEventListener.Stub { private final WeakReference<CarDiagnosticManager> mManager; diff --git a/car-lib/src/android/car/hardware/ICarDiagnostic.aidl b/car-lib/src/android/car/hardware/ICarDiagnostic.aidl index 098d2d4fcb..3afffc528b 100644 --- a/car-lib/src/android/car/hardware/ICarDiagnostic.aidl +++ b/car-lib/src/android/car/hardware/ICarDiagnostic.aidl @@ -52,4 +52,24 @@ interface ICarDiagnostic { */ void unregisterDiagnosticListener(int frameType, in ICarDiagnosticEventListener callback) = 6; -}
\ No newline at end of file + + /** + * Returns whether the underlying HAL supports live frames. + */ + boolean isLiveFrameSupported() = 7; + + /** + * Returns whether the underlying HAL supports freeze frames. + */ + boolean isFreezeFrameSupported() = 8; + + /** + * Returns whether the underlying HAL supports retrieving freeze frame timestamps. + */ + boolean isFreezeFrameTimestampSupported() = 9; + + /** + * Returns whether the underlying HAL supports clearing freeze frames. + */ + boolean isFreezeFrameClearSupported() = 10; +} |