aboutsummaryrefslogtreecommitdiff
path: root/car-lib/src/android
diff options
context:
space:
mode:
authorAntonio Cortes <antoniocortes@google.com>2017-03-31 09:50:57 -0700
committerAntonio Cortes <antoniocortes@google.com>2017-03-31 09:50:57 -0700
commita32b203ca277b92e137f11944093499da2c3ad7a (patch)
treeea3bf54c270a6a129529562ba946cf9e7eae7aaf /car-lib/src/android
parent1ee77ce4698b350ed93346d90971cb47736e81e6 (diff)
downloadCar-a32b203ca277b92e137f11944093499da2c3ad7a.tar.gz
Updating unsubscribeAll to follow the same pattern of unsubscribe
Ignore RemoteException and CarNotConnected exception in unsubscribeAll. Test: build Bug: 36724405 Change-Id: I35b37d43f70a2f55a401781dcb8ac6017c7a9dad
Diffstat (limited to 'car-lib/src/android')
-rw-r--r--car-lib/src/android/car/vms/VmsSubscriberManager.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/car-lib/src/android/car/vms/VmsSubscriberManager.java b/car-lib/src/android/car/vms/VmsSubscriberManager.java
index 7c37b2d422..640948a056 100644
--- a/car-lib/src/android/car/vms/VmsSubscriberManager.java
+++ b/car-lib/src/android/car/vms/VmsSubscriberManager.java
@@ -162,8 +162,7 @@ public final class VmsSubscriberManager implements CarManagerBase {
* @param layer the layer to subscribe to.
* @throws IllegalStateException if the listener was not set via {@link #setListener}.
*/
- public void subscribe(VmsLayer layer)
- throws CarNotConnectedException {
+ public void subscribe(VmsLayer layer) throws CarNotConnectedException {
if (DBG) {
Log.d(TAG, "Subscribing to layer: " + layer);
}
@@ -186,8 +185,7 @@ public final class VmsSubscriberManager implements CarManagerBase {
}
}
- public void subscribeAll()
- throws CarNotConnectedException {
+ public void subscribeAll() throws CarNotConnectedException {
if (DBG) {
Log.d(TAG, "Subscribing passively to all data messages");
}
@@ -239,7 +237,7 @@ public final class VmsSubscriberManager implements CarManagerBase {
}
}
- public void unsubscribeAll() throws CarNotConnectedException {
+ public void unsubscribeAll() {
if (DBG) {
Log.d(TAG, "Unsubscribing passively from all data messages");
}
@@ -248,17 +246,17 @@ public final class VmsSubscriberManager implements CarManagerBase {
listener = mListener;
}
if (listener == null) {
- Log.w(TAG, "subscribe: listener was not set, " +
+ Log.w(TAG, "unsubscribeAll: listener was not set, " +
"setListener must be called first.");
throw new IllegalStateException("Listener was not set.");
}
try {
mVmsSubscriberService.removeVmsSubscriberClientPassiveListener(mIListener);
} catch (RemoteException e) {
- Log.e(TAG, "Could not connect: ", e);
- throw new CarNotConnectedException(e);
+ Log.e(TAG, "Failed to unregister subscriber ", e);
+ // ignore
} catch (IllegalStateException ex) {
- Car.checkCarNotConnectedExceptionFromCarService(ex);
+ Car.hideCarNotConnectedExceptionFromCarService(ex);
}
}