commit | f8684416ddb371a3c3f9ea28e6d6af4f6b31b847 | [log] [tgz] |
---|---|---|
author | Josh Wu <joshwu@google.com> | Fri Mar 03 00:08:41 2023 +0800 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Thu Mar 09 09:49:59 2023 +0000 |
tree | e4b7450b8ef7ec0e5fbf5e12e856464e8b36a11c | |
parent | b015842dbcd06210f535be2c017b799b9afaa623 [diff] |
Map: Check AdapterService before stop Bug: 270114092 Test: atest BluetoothInstrumentationTests Change-Id: Idcc45516b8ad1ad0a2b47f9171a7192bf013cdd4 (cherry picked from https://android-review.googlesource.com/q/commit:4f6a3a832324331ed72b059392f8b290657f77c2) Merged-In: Idcc45516b8ad1ad0a2b47f9171a7192bf013cdd4 Bug: 263323082
diff --git a/android/app/src/com/android/bluetooth/mapclient/MapClientService.java b/android/app/src/com/android/bluetooth/mapclient/MapClientService.java index 25a8a2f..c1daa8c 100644 --- a/android/app/src/com/android/bluetooth/mapclient/MapClientService.java +++ b/android/app/src/com/android/bluetooth/mapclient/MapClientService.java
@@ -339,9 +339,11 @@ Log.d(TAG, "stop()"); } - mAdapterService.notifyActivityAttributionInfo( - getAttributionSource(), - AdapterService.ACTIVITY_ATTRIBUTION_NO_ACTIVE_DEVICE_ADDRESS); + if (mAdapterService != null) { + mAdapterService.notifyActivityAttributionInfo( + getAttributionSource(), + AdapterService.ACTIVITY_ATTRIBUTION_NO_ACTIVE_DEVICE_ADDRESS); + } if (mMapReceiver != null) { unregisterReceiver(mMapReceiver); mMapReceiver = null;