diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2019-10-25 01:25:07 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-10-25 01:25:07 +0000 |
| commit | 8c2d39263d914d3d2c67891afc06388383af65ab (patch) | |
| tree | 2050b9083a3bb46add914f361eb6bdb1d2b9887c | |
| parent | a50722e0c7e201b718163b2ae0b457b3b27c8c2e (diff) | |
| parent | ba3554e14b1c50e3199788bd2cd8471635c5bf8e (diff) | |
| download | platform_packages_services_Telephony-android10-qpr1-mainline-release.tar.gz platform_packages_services_Telephony-android10-qpr1-mainline-release.tar.bz2 platform_packages_services_Telephony-android10-qpr1-mainline-release.zip | |
Snap for 5964166 from ba3554e14b1c50e3199788bd2cd8471635c5bf8e to qt-qpr1-aml-releaseandroid-mainline-10.0.0_r4android10-qpr1-mainline-release
Change-Id: I42af423c9583b38f7a371cd34d7a61eb9dddb2cd
| -rw-r--r-- | src/com/android/services/telephony/PstnIncomingCallNotifier.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/com/android/services/telephony/PstnIncomingCallNotifier.java b/src/com/android/services/telephony/PstnIncomingCallNotifier.java index 223616f4d..a2ced9e0a 100644 --- a/src/com/android/services/telephony/PstnIncomingCallNotifier.java +++ b/src/com/android/services/telephony/PstnIncomingCallNotifier.java @@ -54,6 +54,14 @@ final class PstnIncomingCallNotifier { private static final int EVENT_CDMA_CALL_WAITING = 101; private static final int EVENT_UNKNOWN_CONNECTION = 102; + /** + * The max amount of time to wait before hanging up a call that was for number verification. + * + * The delay is so that the remote end has time to hang up the call after receiving the + * verification signal so that the call doesn't go to voicemail. + */ + private static final int MAX_NUMBER_VERIFICATION_HANGUP_DELAY_MILLIS = 10000; + /** The phone object to listen to. */ private final Phone mPhone; @@ -131,12 +139,16 @@ final class PstnIncomingCallNotifier { if (connection.getAddress() != null) { if (NumberVerificationManager.getInstance() .checkIncomingCall(connection.getAddress())) { - // Disconnect the call if it matches - try { - connection.hangup(); - } catch (CallStateException e) { - Log.e(this, e, "Error hanging up potential number verification call"); - } + // Disconnect the call if it matches, after a delay + mHandler.postDelayed(() -> { + try { + connection.hangup(); + } catch (CallStateException e) { + Log.i(this, "Remote end hung up call verification call"); + } + // TODO: use an app-supplied delay (needs new API), not to exceed the + // existing max. + }, MAX_NUMBER_VERIFICATION_HANGUP_DELAY_MILLIS); return; } } |
