From d426b20cd88b5fe9db1b103570e9e6ca35c89d4e Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 13 Oct 2015 13:33:53 -0700 Subject: [PATCH] Add extras keys for instant lettering. - Also fix bug where copy-builder for PA was not copying over the extras. Bug: 22806380 Change-Id: If25a1299bdd0a48340e9d13857f982a90d728af6 --- api/current.txt | 2 ++ api/system-current.txt | 2 ++ .../java/android/telecom/PhoneAccount.java | 27 +++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/api/current.txt b/api/current.txt index ef18bf9f05f6a..b0d26cd0b8284 100644 --- a/api/current.txt +++ b/api/current.txt @@ -30497,6 +30497,8 @@ package android.telecom { field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4 field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8 field public static final android.os.Parcelable.Creator CREATOR; + field public static final java.lang.String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING"; + field public static final java.lang.String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH"; field public static final int NO_HIGHLIGHT_COLOR = 0; // 0x0 field public static final int NO_RESOURCE_ID = -1; // 0xffffffff field public static final java.lang.String SCHEME_SIP = "sip"; diff --git a/api/system-current.txt b/api/system-current.txt index 0b216bdddb301..26532336d6d79 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -32697,6 +32697,8 @@ package android.telecom { field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4 field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8 field public static final android.os.Parcelable.Creator CREATOR; + field public static final java.lang.String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING"; + field public static final java.lang.String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH"; field public static final int NO_HIGHLIGHT_COLOR = 0; // 0x0 field public static final int NO_RESOURCE_ID = -1; // 0xffffffff field public static final java.lang.String SCHEME_SIP = "sip"; diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 5c6416884aa5a..9480b5fc98d4c 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -51,6 +51,32 @@ import java.util.MissingResourceException; */ public final class PhoneAccount implements Parcelable { + /** + * {@link PhoneAccount} extras key (see {@link PhoneAccount#getExtras()}) which determines the + * maximum permitted length of a call subject specified via the + * {@link TelecomManager#EXTRA_CALL_SUBJECT} extra on an + * {@link android.content.Intent#ACTION_CALL} intent. Ultimately a {@link ConnectionService} is + * responsible for enforcing the maximum call subject length when sending the message, however + * this extra is provided so that the user interface can proactively limit the length of the + * call subject as the user types it. + */ + public static final String EXTRA_CALL_SUBJECT_MAX_LENGTH = + "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH"; + + /** + * {@link PhoneAccount} extras key (see {@link PhoneAccount#getExtras()}) which determines the + * character encoding to be used when determining the length of messages. + * The user interface can use this when determining the number of characters the user may type + * in a call subject. If empty-string, the call subject message size limit will be enforced on + * a 1:1 basis. That is, each character will count towards the messages size limit as a single + * character. If a character encoding is specified, the message size limit will be based on the + * number of bytes in the message per the specified encoding. See + * {@link #EXTRA_CALL_SUBJECT_MAX_LENGTH} for more information on the call subject maximum + * length. + */ + public static final String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = + "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING"; + /** * Flag indicating that this {@code PhoneAccount} can act as a connection manager for * other connections. The {@link ConnectionService} associated with this {@code PhoneAccount} @@ -205,6 +231,7 @@ public final class PhoneAccount implements Parcelable { mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes()); mIcon = phoneAccount.getIcon(); mIsEnabled = phoneAccount.isEnabled(); + mExtras = phoneAccount.getExtras(); } /**