Fix ConnectionServiceFocusManager NPE

Bug: 294008627
Check for null Binder before calling focusmanager notification APIs

Bug: 294047434
Test: Unit Tests, OEM manual stress tests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c5ec887f5ec6d76a97c1598ea0c2bf3794b1dab1)
Merged-In: I62c6e6b75ab691ca8057f8151acacf6623fe53f9
Change-Id: I62c6e6b75ab691ca8057f8151acacf6623fe53f9
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
old mode 100755
new mode 100644
index 5bb1dbe..7237c70
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -2066,6 +2066,7 @@
         BindCallback callback = new BindCallback() {
             @Override
             public void onSuccess() {
+                if (!isServiceValid("connectionServiceFocusLost")) return;
                 try {
                     mServiceInterface.connectionServiceFocusLost(
                             Log.getExternalSession(TELECOM_ABBREVIATION));
@@ -2085,6 +2086,7 @@
         BindCallback callback = new BindCallback() {
             @Override
             public void onSuccess() {
+                if (!isServiceValid("connectionServiceFocusGained")) return;
                 try {
                     mServiceInterface.connectionServiceFocusGained(
                             Log.getExternalSession(TELECOM_ABBREVIATION));