From ecbb809686a742dfb316dafb4036fa07991282db Mon Sep 17 00:00:00 2001 From: joneckenrode Date: Tue, 22 Feb 2022 20:51:39 +0000 Subject: [PATCH] Added return value to overloaded bindService method. Staged: https://android.devsite.corp.google.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection) Test: Built API documentation Signed-off-by: joneckenrode Change-Id: I9b5466441b7b5cb4deb5a8cc25cfd01a83be80ca --- core/java/android/content/Context.java | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 001be57fe50d3..7cb0934214172 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3480,11 +3480,11 @@ public abstract class Context { *
  • {@link #BIND_INCLUDE_CAPABILITIES} * * - * @return {@code true} if the system is in the process of bringing up a - * service that your client has permission to bind to; {@code false} - * if the system couldn't find the service or if your client doesn't - * have permission to bind to it. You should call {@link #unbindService} - * to release the connection even if this method returned {@code false}. + * @return {@code true} if the system is in the process of bringing up a + * service that your client has permission to bind to; {@code false} + * if the system couldn't find the service or if your client doesn't + * have permission to bind to it. Regardless of the return value, you + * should later call {@link #unbindService} to release the connection. * * @throws SecurityException If the caller does not have permission to * access the service or the service cannot be found. Call @@ -3498,10 +3498,16 @@ public abstract class Context { @NonNull ServiceConnection conn, @BindServiceFlags int flags); /** - * Same as {@link #bindService(Intent, ServiceConnection, int)} with executor to control - * ServiceConnection callbacks. + * Same as {@link #bindService(Intent, ServiceConnection, int) + * bindService(Intent, ServiceConnection, int)} with executor to control ServiceConnection + * callbacks. + * * @param executor Callbacks on ServiceConnection will be called on executor. Must use same * instance for the same instance of ServiceConnection. + * + * @return The result of the binding as described in + * {@link #bindService(Intent, ServiceConnection, int) + * bindService(Intent, ServiceConnection, int)}. */ public boolean bindService(@RequiresPermission @NonNull Intent service, @BindServiceFlags int flags, @NonNull @CallbackExecutor Executor executor, @@ -3527,12 +3533,13 @@ public abstract class Context { * @param instanceName Unique identifier for the service instance. Each unique * 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. * @param conn Receives information as the service is started and stopped. * This must be a valid ServiceConnection object; it must not be null. * + * @return Returns success of binding as per {@link #bindService}. + * * @throws SecurityException If the caller does not have permission to access the service * @throws IllegalArgumentException If the instanceName is invalid. * @@ -3547,8 +3554,7 @@ public abstract class Context { } /** - * Binds to a service in the given {@code user} in the same manner as - * {@link #bindService(Intent, ServiceConnection, int)}. + * Binds to a service in the given {@code user} in the same manner as {@link #bindService}. * *

    If the given {@code user} is in the same profile group and the target package is the * same as the caller, {@code android.Manifest.permission.INTERACT_ACROSS_PROFILES} is