From 80a5e1e940c13e0ff4e9b67021879b2442aff2d2 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Fri, 22 Jun 2018 15:52:27 -0700 Subject: Add PROPERTY_VOIP_AUDIO_MODE to android.telecom.Call. This property is used to report the voip audio mode requested by the underlying connection. This is useful for ringing calls and held calls where the current system audio mode will not necessarily match what the Connection would use. Test: Added and ran new CTS tests. Bug: 110540796 Change-Id: I8c26db4b35de4d40d7b76b3c1adc93223afa104b --- api/current.txt | 1 + telecomm/java/android/telecom/Call.java | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index cd875bf42cea..71a3a21e6a4a 100755 --- a/api/current.txt +++ b/api/current.txt @@ -41122,6 +41122,7 @@ package android.telecom { field public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 2048; // 0x800 field public static final int PROPERTY_RTT = 1024; // 0x400 field public static final int PROPERTY_SELF_MANAGED = 256; // 0x100 + field public static final int PROPERTY_VOIP_AUDIO_MODE = 4096; // 0x1000 field public static final int PROPERTY_WIFI = 8; // 0x8 } diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index daa09f574651..b6ac91d45e78 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -467,8 +467,24 @@ public final class Call { */ public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 0x00000800; + /** + * Indicates that the call is using VoIP audio mode. + *

+ * When this property is set, the {@link android.media.AudioManager} audio mode for this + * call will be {@link android.media.AudioManager#MODE_IN_COMMUNICATION}. When this + * property is not set, the audio mode for this call will be + * {@link android.media.AudioManager#MODE_IN_CALL}. + *

+ * This property reflects changes made using {@link Connection#setAudioModeIsVoip(boolean)}. + *

+ * You can use this property to determine whether an un-answered incoming call or a held + * call will use VoIP audio mode (if the call does not currently have focus, the system + * audio mode may not reflect the mode the call will use). + */ + public static final int PROPERTY_VOIP_AUDIO_MODE = 0x00001000; + //****************************************************************************************** - // Next PROPERTY value: 0x00001000 + // Next PROPERTY value: 0x00002000 //****************************************************************************************** private final String mTelecomCallId; @@ -628,15 +644,21 @@ public final class Call { if (hasProperty(properties, PROPERTY_IS_EXTERNAL_CALL)) { builder.append(" PROPERTY_IS_EXTERNAL_CALL"); } - if(hasProperty(properties, PROPERTY_HAS_CDMA_VOICE_PRIVACY)) { + if (hasProperty(properties, PROPERTY_HAS_CDMA_VOICE_PRIVACY)) { builder.append(" PROPERTY_HAS_CDMA_VOICE_PRIVACY"); } - if(hasProperty(properties, PROPERTY_ASSISTED_DIALING_USED)) { + if (hasProperty(properties, PROPERTY_ASSISTED_DIALING_USED)) { builder.append(" PROPERTY_ASSISTED_DIALING_USED"); } if (hasProperty(properties, PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL)) { builder.append(" PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL"); } + if (hasProperty(properties, PROPERTY_RTT)) { + builder.append(" PROPERTY_RTT"); + } + if (hasProperty(properties, PROPERTY_VOIP_AUDIO_MODE)) { + builder.append(" PROPERTY_VOIP_AUDIO_MODE"); + } builder.append("]"); return builder.toString(); } -- cgit v1.2.3-59-g8ed1b