update PhoneAccount and PhoneAccountHandle docs on char limit
prevent large character strings in PhoneAccount and PhoneAccountHandle
fields that may cause issues when writing to device. Such fields will
now throw an IllegalArgumentException when the character count is over
the set value.
Test: unit tests
bug: 256819769
Change-Id: Ib15a43c760f861570b7413d104565cd3a0ef96d8
diff --git a/telecomm/java/android/telecom/PhoneAccountHandle.java b/telecomm/java/android/telecom/PhoneAccountHandle.java
index ec94f8a..e5db8cf 100644
--- a/telecomm/java/android/telecom/PhoneAccountHandle.java
+++ b/telecomm/java/android/telecom/PhoneAccountHandle.java
@@ -70,6 +70,12 @@
* ID provided does not expose personally identifying information. A
* {@link ConnectionService} should use an opaque token as the
* {@link PhoneAccountHandle} identifier.
+ * <p>
+ * Note: Each String field is limited to 256 characters. This check is enforced when
+ * registering the PhoneAccount via
+ * {@link TelecomManager#registerPhoneAccount(PhoneAccount)} and will cause an
+ * {@link IllegalArgumentException} to be thrown if the character field limit is
+ * over 256.
*/
public PhoneAccountHandle(
@NonNull ComponentName componentName,
@@ -88,6 +94,13 @@
* {@link ConnectionService} should use an opaque token as the
* {@link PhoneAccountHandle} identifier.
* @param userHandle The {@link UserHandle} associated with this {@link PhoneAccountHandle}.
+ *
+ * <p>
+ * Note: Each String field is limited to 256 characters. This check is enforced when
+ * registering the PhoneAccount via
+ * {@link TelecomManager#registerPhoneAccount(PhoneAccount)} and will cause an
+ * {@link IllegalArgumentException} to be thrown if the character field limit is
+ * over 256.
*/
public PhoneAccountHandle(
@NonNull ComponentName componentName,