From b56fd289376368bb0c2031c22d671cf54b9968a9 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 18 Mar 2019 09:13:33 -0700 Subject: [PATCH] Mark EXTRA_INCOMING_NUMBER for PHONE_STATE broadcast as deprecated. In Q we have introduced new APIs which replace the need for an app to get the phone number for calls through the phone state broadcast. As such the EXTRA_INCOMING_NUMBER is being marked deprecated. Developers are encouraged to use the new replacement APIs instead. Test: Make API / build Fixes: 128835519 Change-Id: If1bc0076392281887f6cc8017788a07f170c7a17 --- api/current.txt | 2 +- telephony/java/android/telephony/TelephonyManager.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 0fa6cc623befb..476a9a7d6b880 100755 --- a/api/current.txt +++ b/api/current.txt @@ -43161,7 +43161,7 @@ package android.telephony { field public static final String EXTRA_CARRIER_ID = "android.telephony.extra.CARRIER_ID"; field public static final String EXTRA_CARRIER_NAME = "android.telephony.extra.CARRIER_NAME"; field public static final String EXTRA_HIDE_PUBLIC_SETTINGS = "android.telephony.extra.HIDE_PUBLIC_SETTINGS"; - field public static final String EXTRA_INCOMING_NUMBER = "incoming_number"; + field @Deprecated public static final String EXTRA_INCOMING_NUMBER = "incoming_number"; field public static final String EXTRA_IS_REFRESH = "android.telephony.extra.IS_REFRESH"; field public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT"; field public static final String EXTRA_NETWORK_COUNTRY = "android.telephony.extra.NETWORK_COUNTRY"; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 7ea50b02b9f60..ec048965a0cc0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -58,6 +58,8 @@ import android.os.SystemProperties; import android.os.WorkSource; import android.provider.Settings.SettingNotFoundException; import android.service.carrier.CarrierIdentifier; +import android.telecom.CallScreeningService; +import android.telecom.InCallService; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; @@ -617,7 +619,13 @@ public class TelephonyManager { *

* Retrieve with * {@link android.content.Intent#getStringExtra(String)}. + *

+ * + * @deprecated Companion apps for wearable devices should use the {@link InCallService} API + * to retrieve the phone number for calls instead. Apps performing call screening should use + * the {@link CallScreeningService} API instead. */ + @Deprecated public static final String EXTRA_INCOMING_NUMBER = "incoming_number"; /**