BLE: fix doesn't unregister client_if since appDied flag is wrong

When the APP is died, GattService will set appDied to true and stop
scan. In the use case, the client_if isn't correctly unregistered since
the target client appDied flag doesn't correctly set to true. Will
directly get the client and set the client appDied flag to true to make
sure the parameter is aligned.

Bug: 143588356
Test: Check client_if can be unregistered after APP was died.
Change-Id: I16d86a321f9ee65c692accdb0bcdac41e31702b3
diff --git a/android/app/src/com/android/bluetooth/gatt/GattService.java b/android/app/src/com/android/bluetooth/gatt/GattService.java
index 4865b67..8f751ac 100644
--- a/android/app/src/com/android/bluetooth/gatt/GattService.java
+++ b/android/app/src/com/android/bluetooth/gatt/GattService.java
@@ -340,25 +340,25 @@
                 Log.d(TAG, "Binder is dead - unregistering scanner (" + mScannerId + ")!");
             }
 
-            if (isScanClient(mScannerId)) {
-                ScanClient client = new ScanClient(mScannerId);
+            ScanClient client = getScanClient(mScannerId);
+            if (client != null) {
                 client.appDied = true;
                 stopScan(client.scannerId);
             }
         }
 
-        private boolean isScanClient(int clientIf) {
+        private ScanClient getScanClient(int clientIf) {
             for (ScanClient client : mScanManager.getRegularScanQueue()) {
                 if (client.scannerId == clientIf) {
-                    return true;
+                    return client;
                 }
             }
             for (ScanClient client : mScanManager.getBatchScanQueue()) {
                 if (client.scannerId == clientIf) {
-                    return true;
+                    return client;
                 }
             }
-            return false;
+            return null;
         }
     }