Skip to content

Commit 07f0a8f

Browse files
committed
last rewrite
1 parent 1be801f commit 07f0a8f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

binder/src/main/java/io/grpc/binder/internal/ServiceBinding.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,10 @@ public ServiceInfo resolve() throws StatusException {
304304
PackageManager packageManager = sourceContext.getPackageManager();
305305
int flags = 0;
306306
if (Build.VERSION.SDK_INT >= 29) {
307-
// Use the current locked/unlocked state of 'targetUserHandle' to filter <service> matches.
308-
// Callers want to resolve 'bindIntent' the same way a follow-up call to bind() will. And
309-
// if the target user is locked, bindService() ignores matches that can't presently be created
310-
// due to directBootAware=false. Of course this filter races against a concurrent unlock, but
311-
// that's no different than the other resolve/connect races our callers must already handle.
307+
// Filter out non-'directBootAware' <service>s when 'targetUserHandle' is locked. Here's why:
308+
// Callers want 'bindIntent' to #resolve() to the same thing a follow-up call to #bind() will.
309+
// But bindService() *always* ignores services that can't presently be created for lack of
310+
// 'directBootAware'-ness. This flag explicitly tells resolveService() to act the same way.
312311
flags |= PackageManager.MATCH_DIRECT_BOOT_AUTO;
313312
}
314313
ResolveInfo resolveInfo =

0 commit comments

Comments
 (0)