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;