diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 30850e3ba06c..001be57fe50d 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3434,7 +3434,7 @@ public abstract class Context { public abstract boolean stopServiceAsUser(Intent service, UserHandle user); /** - * Connect to an application service, creating it if needed. This defines + * Connects to an application service, creating it if needed. This defines * a dependency between your application and the service. The given * conn will receive the service object when it is created and be * told if it dies and restarts. The service will be considered required @@ -3449,11 +3449,8 @@ public abstract class Context { * will be invoked instead of * {@link ServiceConnection#onServiceConnected(ComponentName, IBinder) onServiceConnected()}. * - *
This method will throw {@link SecurityException} if the calling app does not - * have permission to bind to the given service. - * - *
Note: this method cannot be called from a - * {@link BroadcastReceiver} component. A pattern you can use to + *
Note: This method cannot be called from a + * {@link BroadcastReceiver} component. A pattern you can use to * communicate from a BroadcastReceiver to a Service is to call * {@link #startService} with the arguments containing the command to be * sent, with the service calling its @@ -3468,34 +3465,34 @@ public abstract class Context { * specify an explicit component name. * @param conn Receives information as the service is started and stopped. * This must be a valid ServiceConnection object; it must not be null. - * @param flags Operation options for the binding. May be 0, - * {@link #BIND_AUTO_CREATE}, {@link #BIND_DEBUG_UNBIND}, - * {@link #BIND_NOT_FOREGROUND}, {@link #BIND_ABOVE_CLIENT}, - * {@link #BIND_ALLOW_OOM_MANAGEMENT}, {@link #BIND_WAIVE_PRIORITY}. - * {@link #BIND_IMPORTANT}, {@link #BIND_ADJUST_WITH_ACTIVITY}, - * {@link #BIND_NOT_PERCEPTIBLE}, or {@link #BIND_INCLUDE_CAPABILITIES}. - * @return {@code true} if the system is in the process of bringing up a + * @param flags Operation options for the binding. Can be: + *
Note: The app that requested the binding must call + * {@link Context#unbindService(ServiceConnection)} to release the tracking + * resources associated with this ServiceConnection even if this callback was + * invoked following {@link Context#bindService Context.bindService() bindService()}. + * + * @param name The concrete component name of the service whose connection is dead. */ default void onBindingDied(ComponentName name) { } @@ -72,10 +76,10 @@ public interface ServiceConnection { /** * Called when the service being bound has returned {@code null} from its * {@link android.app.Service#onBind(Intent) onBind()} method. This indicates - * that the attempting service binding represented by this ServiceConnection + * that the attempted service binding represented by this ServiceConnection * will never become usable. * - *
The app which requested the binding must still call + *
Note: The app that requested the binding must still call * {@link Context#unbindService(ServiceConnection)} to release the tracking * resources associated with this ServiceConnection even if this callback was * invoked following {@link Context#bindService Context.bindService() bindService()}.