Merge "Unlink from death recipient in projection service" into qt-dev
am: a9dc5050a6

Change-Id: I9e8b17de4baa8d43d6c10e46134d5f2162c07399
diff --git a/service/src/com/android/car/CarProjectionService.java b/service/src/com/android/car/CarProjectionService.java
index 25edc79..e150c27 100644
--- a/service/src/com/android/car/CarProjectionService.java
+++ b/service/src/com/android/car/CarProjectionService.java
@@ -459,7 +459,12 @@
     private void unregisterProjectionReceiverClient(IBinder token) {
         synchronized (mLock) {
             ProjectionReceiverClient client = mProjectionReceiverClients.remove(token);
-            if (client != null && TextUtils.equals(
+            if (client == null) {
+                Log.w(TAG, "Projection receiver client for token " + token + " doesn't exist");
+                return;
+            }
+            token.unlinkToDeath(client.mDeathRecipient, 0);
+            if (TextUtils.equals(
                     client.mProjectionStatus.getPackageName(), mCurrentProjectionPackage)) {
                 mCurrentProjectionPackage = null;
                 mCurrentProjectionState = PROJECTION_STATE_INACTIVE;