Restrict bindIsolatedService instanceName to just letters, digits, '_', and '.'
Test: CtsAppTestCases:android.app.cts.ServiceTest
Bug: 130164289
Change-Id: I7d720fcf845631e300d8f1e8cc74d4efff182fda
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 00238bf..3dd510c 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -3015,7 +3015,8 @@
* specify an explicit component name.
* @param flags Operation options for the binding as per {@link #bindService}.
* @param instanceName Unique identifier for the service instance. Each unique
- * name here will result in a different service instance being created.
+ * name here will result in a different service instance being created. Identifiers
+ * must only contain ASCII letters, digits, underscores, and periods.
* @return Returns success of binding as per {@link #bindService}.
* @param executor Callbacks on ServiceConnection will be called on executor.
* Must use same instance for the same instance of ServiceConnection.
@@ -3023,6 +3024,7 @@
* This must be a valid ServiceConnection object; it must not be null.
*
* @throws SecurityException If the caller does not have permission to access the service
+ * @throws IllegalArgumentException If the instanceName is invalid.
*
* @see #bindService
*/