Merge "Fix mCachedAssociations for multiple users" into sc-dev

This commit is contained in:
Evan Chen
2021-06-16 18:36:36 +00:00
committed by Android (Google) Code Review

View File

@@ -454,19 +454,13 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
}).cancelTimeout();
}, FgThread.getExecutor()).whenComplete(uncheckExceptions((association, err) -> {
final long callingIdentity = Binder.clearCallingIdentity();
try {
if (err == null) {
addAssociation(association);
} else {
Slog.e(LOG_TAG, "Failed to discover device(s)", err);
callback.onFailure("No devices found: " + err.getMessage());
}
cleanup();
} finally {
Binder.restoreCallingIdentity(callingIdentity);
if (err == null) {
addAssociation(association);
} else {
Slog.e(LOG_TAG, "Failed to discover device(s)", err);
callback.onFailure("No devices found: " + err.getMessage());
}
cleanup();
}));
}