commit | 3d3098da90ab03236f684aecf2a6ff0ba33694b9 | [log] [tgz] |
---|---|---|
author | Pranav Madapurmath <pmadapurmath@google.com> | Sat Feb 04 00:01:52 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Feb 04 00:01:52 2023 +0000 |
tree | e6d951257c7688eebb956620e6d8d0cbec43392a | |
parent | cf69b1130123deb09d046a42d97a21f548150cc6 [diff] | |
parent | a005a8529ac22db24588ac40dae6078d05d2867e [diff] |
Ensure service unbind when receiving a null call screening service in onBind. am: 14927c6f0b am: a005a8529a Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/21224930 Change-Id: If574e3c9e9ec66816f799bfc3b6bc30702be1e08 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 9435250..338aa19 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 4a308e0..d4ca5ff 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