commit | 4451efa59e43be3374f16878a62f8899b719e296 | [log] [tgz] |
---|---|---|
author | Pranav Madapurmath <pmadapurmath@google.com> | Sat Feb 04 01:09:01 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Feb 04 01:09:01 2023 +0000 |
tree | e0c101dc4bf0f1bf9854e42efd49f5728b97cb5c | |
parent | cc6243dcd80b770d3854017e854c288325101223 [diff] | |
parent | 3d3098da90ab03236f684aecf2a6ff0ba33694b9 [diff] |
Ensure service unbind when receiving a null call screening service in onBind. am: 14927c6f0b am: a005a8529a am: 3d3098da90 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/21224930 Change-Id: I7f6f468a57ad27fff8991cd97a67811ca42f08a1 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