commit | 186e7f63494d902335323bf882ef55cc18e930e7 | [log] [tgz] |
---|---|---|
author | Pranav Madapurmath <pmadapurmath@google.com> | Sat Feb 04 02:43:34 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Feb 04 02:43:34 2023 +0000 |
tree | 5bb591846cc8fc147086926ac5a56bc231f8543d | |
parent | 616d545a519b527a1dccab198352caf54a9bb591 [diff] | |
parent | 4854fd48ab28e341b45b21d4d6ca4de016d583ba [diff] |
Ensure service unbind when receiving a null call screening service in onBind. am: 14927c6f0b am: a005a8529a am: 3d3098da90 am: 4451efa59e am: 12809100b6 am: 4854fd48ab Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/21224930 Change-Id: Ib118a8eded1025e7caa39622c57385a2bb91cc42 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/server/telecom/CallScreeningServiceHelper.java b/src/com/android/server/telecom/CallScreeningServiceHelper.java index 167bd1b..5c9ca84 100644 --- a/src/com/android/server/telecom/CallScreeningServiceHelper.java +++ b/src/com/android/server/telecom/CallScreeningServiceHelper.java
@@ -137,6 +137,23 @@ "Cancelling outgoing call screen due to service disconnect."); } mFuture.complete(null); + mContext.unbindService(this); + } finally { + Log.endSession(); + } + } + + @Override + public void onNullBinding(ComponentName name) { + // No locking needed -- CompletableFuture only lets one thread call complete. + Log.continueSession(mLoggingSession, "CSSH.oNB"); + try { + if (!mFuture.isDone()) { + Log.w(CallScreeningServiceHelper.this, + "Cancelling outgoing call screen due to null binding."); + } + mFuture.complete(null); + mContext.unbindService(this); } finally { Log.endSession(); }
diff --git a/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java b/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java index 51b1bc6..5f4c40b 100644 --- a/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java +++ b/src/com/android/server/telecom/callfiltering/CallScreeningServiceFilter.java
@@ -235,12 +235,14 @@ public void onServiceDisconnected(ComponentName componentName) { mResultFuture.complete(mPriorStageResult); Log.i(this, "Service disconnected."); + unbindCallScreeningService(); } @Override public void onBindingDied(ComponentName name) { mResultFuture.complete(mPriorStageResult); Log.i(this, "Binding died."); + unbindCallScreeningService(); } @Override