diff options
| author | 2021-01-12 17:07:01 -0800 | |
|---|---|---|
| committer | 2021-01-13 20:13:17 +0000 | |
| commit | 5321bad867a1ed6cbadb25f45b120ad868abc0ef (patch) | |
| tree | f318dccc9072b72807998842467d853e2efe3727 | |
| parent | 5b51530d0d960ee21a26ec4460abfe49b3657e5a (diff) | |
Support call composer status that disabled the picture sending
Test: cts
Bug: 173437870
Change-Id: Ib6ea41b56797d871cf38e7386428f84ce8438803
| -rw-r--r-- | core/api/current.txt | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 20 |
2 files changed, 16 insertions, 5 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 252c33c4efda..e5421a0b2cec 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -41149,6 +41149,7 @@ package android.telephony { field public static final int AUTHTYPE_EAP_SIM = 128; // 0x80 field public static final int CALL_COMPOSER_STATUS_OFF = 0; // 0x0 field public static final int CALL_COMPOSER_STATUS_ON = 1; // 0x1 + field public static final int CALL_COMPOSER_STATUS_ON_NO_PICTURES = 2; // 0x2 field public static final int CALL_STATE_IDLE = 0; // 0x0 field public static final int CALL_STATE_OFFHOOK = 2; // 0x2 field public static final int CALL_STATE_RINGING = 1; // 0x1 diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index c05e90b28fa8..cedd6f369160 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -8689,11 +8689,18 @@ public class TelephonyManager { */ public static final int CALL_COMPOSER_STATUS_ON = 1; + /** + * Call composer status indicating that sending/receiving pictures is disabled. + * All other attachments are still enabled in this state. + */ + public static final int CALL_COMPOSER_STATUS_ON_NO_PICTURES = 2; + /** @hide */ @IntDef(prefix = {"CALL_COMPOSER_STATUS_"}, value = { CALL_COMPOSER_STATUS_ON, CALL_COMPOSER_STATUS_OFF, + CALL_COMPOSER_STATUS_ON_NO_PICTURES, }) public @interface CallComposerStatus {} @@ -8701,8 +8708,9 @@ public class TelephonyManager { * Set the user-set status for enriched calling with call composer. * * @param status user-set status for enriched calling with call composer; - * it must be a value of either {@link #CALL_COMPOSER_STATUS_ON} - * or {@link #CALL_COMPOSER_STATUS_OFF}. + * it must be any of {@link #CALL_COMPOSER_STATUS_ON} + * {@link #CALL_COMPOSER_STATUS_OFF}, + * or {@link #CALL_COMPOSER_STATUS_ON_NO_PICTURES} * * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()} @@ -8712,7 +8720,8 @@ public class TelephonyManager { */ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallComposerStatus(@CallComposerStatus int status) { - if (status != CALL_COMPOSER_STATUS_ON && status != CALL_COMPOSER_STATUS_OFF) { + if (status > CALL_COMPOSER_STATUS_ON_NO_PICTURES + || status < CALL_COMPOSER_STATUS_OFF) { throw new IllegalArgumentException("requested status is invalid"); } try { @@ -8734,8 +8743,9 @@ public class TelephonyManager { * * @throws SecurityException if the caller does not have the permission. * - * @return the user-set status for enriched calling with call composer either - * {@link #CALL_COMPOSER_STATUS_ON} or {@link #CALL_COMPOSER_STATUS_OFF}. + * @return the user-set status for enriched calling with call composer, any of + * {@link #CALL_COMPOSER_STATUS_ON}, {@link #CALL_COMPOSER_STATUS_OFF}, or + * {@link #CALL_COMPOSER_STATUS_ON_NO_PICTURES}. */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public @CallComposerStatus int getCallComposerStatus() { |