summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrleix2018-12-10 17:55:25 -0600
committerandroid-build-merger2018-12-10 17:55:25 -0600
commit4975766d1c9c781198d646064b250cc2b69f8418 (patch)
tree9295c919df26dbe6b2ec46c371c3222bb2fedae4
parentab4214fd2a0693321043d8abf23166832eb0846f (diff)
parent07d16e3cdcf0f939f790d1a630704c020899a267 (diff)
downloadplatform-packages-services-car-4975766d1c9c781198d646064b250cc2b69f8418.tar.gz
platform-packages-services-car-4975766d1c9c781198d646064b250cc2b69f8418.tar.xz
platform-packages-services-car-4975766d1c9c781198d646064b250cc2b69f8418.zip
Merge "Add cleanup upon disconnect of CarService" am: 6379090b6e
am: 07d16e3cdc Change-Id: I254fec3c34e91ec82a6f1167a76b4b1df3918625
-rw-r--r--car-lib/src/android/car/vms/VmsSubscriberManager.java10
-rw-r--r--tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java8
2 files changed, 13 insertions, 5 deletions
diff --git a/car-lib/src/android/car/vms/VmsSubscriberManager.java b/car-lib/src/android/car/vms/VmsSubscriberManager.java
index fe9e8c36..1416b417 100644
--- a/car-lib/src/android/car/vms/VmsSubscriberManager.java
+++ b/car-lib/src/android/car/vms/VmsSubscriberManager.java
@@ -155,11 +155,11 @@ public final class VmsSubscriberManager implements CarManagerBase {
155 } catch (RemoteException e) { 155 } catch (RemoteException e) {
156 Log.e(TAG, "Could not connect: ", e); 156 Log.e(TAG, "Could not connect: ", e);
157 throw new CarNotConnectedException(e); 157 throw new CarNotConnectedException(e);
158 } 158 } finally {
159 159 synchronized (mClientCallbackLock) {
160 synchronized (mClientCallbackLock) { 160 mClientCallback = null;
161 mClientCallback = null; 161 mExecutor = null;
162 mExecutor = null; 162 }
163 } 163 }
164 } 164 }
165 165
diff --git a/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java b/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java
index a82350b4..d1b92dcb 100644
--- a/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java
+++ b/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java
@@ -84,6 +84,14 @@ public class VmsSubscriberClientSampleActivity extends Activity {
84 @Override 84 @Override
85 public void onDisconnected(Car car) { 85 public void onDisconnected(Car car) {
86 Log.d(TAG, "Disconnect from Car Service"); 86 Log.d(TAG, "Disconnect from Car Service");
87 if (mVmsSubscriberManager != null) {
88 try {
89 mVmsSubscriberManager.clearVmsSubscriberClientCallback();
90 mVmsSubscriberManager.unsubscribe(TEST_LAYER);
91 } catch (android.car.CarNotConnectedException e) {
92 Log.e(TAG, "Car is not connected!", e);
93 }
94 }
87 } 95 }
88 96
89 private VmsSubscriberManager getVmsSubscriberManager() { 97 private VmsSubscriberManager getVmsSubscriberManager() {