diff options
| author | 2020-10-22 20:58:35 +0000 | |
|---|---|---|
| committer | 2020-10-22 20:58:35 +0000 | |
| commit | 2c0e19cf794e8f67afc87f0ce38d071cdf81e206 (patch) | |
| tree | 016452a28fecd68b92d7e89222783ed7a76ae4fd | |
| parent | f8e5b6fd6e912e54fb531fe9fced7e60d1526470 (diff) | |
| parent | 486ef8978dcefc54db86302868294f4ea721f116 (diff) | |
Call onOutgoingEmergencyCall only once. am: 486ef8978d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470382
Change-Id: I3c5a098b8f22b1a032e297205684dbe4617b6e39
| -rw-r--r-- | core/java/android/telephony/PhoneStateListener.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java index 2854b78b8a49..5a7cda86a8a8 100644 --- a/core/java/android/telephony/PhoneStateListener.java +++ b/core/java/android/telephony/PhoneStateListener.java @@ -948,10 +948,6 @@ public class PhoneStateListener { * This method will be called when an emergency call is placed on any subscription (including * the no-SIM case), regardless of which subscription this listener was registered on. * - * This method is deprecated. Both this method and the new - * {@link #onOutgoingEmergencyCall(EmergencyNumber, int)} will be called when an outgoing - * emergency call is placed. - * * @param placedEmergencyNumber The {@link EmergencyNumber} the emergency call was placed to. * * @deprecated Use {@link #onOutgoingEmergencyCall(EmergencyNumber, int)}. @@ -969,22 +965,24 @@ public class PhoneStateListener { * This method will be called when an emergency call is placed on any subscription (including * the no-SIM case), regardless of which subscription this listener was registered on. * - * Both this method and the deprecated {@link #onOutgoingEmergencyCall(EmergencyNumber)} will be - * called when an outgoing emergency call is placed. You should only implement one of these - * methods. + * The default implementation of this method calls + * {@link #onOutgoingEmergencyCall(EmergencyNumber)} for backwards compatibility purposes. Do + * not call {@code super(...)} from within your implementation unless you want + * {@link #onOutgoingEmergencyCall(EmergencyNumber)} to be called as well. * * @param placedEmergencyNumber The {@link EmergencyNumber} the emergency call was placed to. * @param subscriptionId The subscription ID used to place the emergency call. If the * emergency call was placed without a valid subscription (e.g. when there * are no SIM cards in the device), this will be equal to * {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}. - * * @hide */ @SystemApi @TestApi public void onOutgoingEmergencyCall(@NonNull EmergencyNumber placedEmergencyNumber, int subscriptionId) { + // Default implementation for backwards compatibility + onOutgoingEmergencyCall(placedEmergencyNumber); } /** @@ -1371,10 +1369,6 @@ public class PhoneStateListener { Binder.withCleanCallingIdentity( () -> mExecutor.execute( - () -> psl.onOutgoingEmergencyCall(placedEmergencyNumber))); - - Binder.withCleanCallingIdentity( - () -> mExecutor.execute( () -> psl.onOutgoingEmergencyCall(placedEmergencyNumber, subscriptionId))); } |