From 772014d2f9b2fc1688dbead6a881758342382f3b Mon Sep 17 00:00:00 2001 From: Kevin Hufnagle Date: Thu, 23 Sep 2021 20:44:49 +0000 Subject: [PATCH] Revert "docs: Revised descriptions of binding and connecting to services." This reverts commit 34acbc9bf93ddb49e6d706661c441c4a851c0582. Reason for revert: You must always call unbindService() after bindService(), regardless of the return value for bindService(); see https://groups.google.com/a/google.com/g/android-chatty-eng/c/reDuVZl9Tcs/m/ux52rVvoAQAJ Bug: 37092557 Test: m ds-docs-java Change-Id: Ie4461b9a3b64ed3fb6f32e3cb71b57976e8da90f --- core/java/android/content/Context.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 78d83c07049b8..34c07d6f7be6d 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3483,9 +3483,8 @@ public abstract class Context { * @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. If this value is {@code true}, you - * should later call {@link #unbindService} to release the - * connection. + * have permission to bind to it. You should call {@link #unbindService} + * to release the connection even if this method returned {@code false}. * * @throws SecurityException If the caller does not have permission to access the service * or the service can not be found.