Merge "Fix bind service failure on Android Auto"

This commit is contained in:
Charles Chen
2020-10-21 12:38:18 +00:00
committed by Android (Google) Code Review

View File

@@ -1940,7 +1940,9 @@ public final class ActiveServices {
ActivityServiceConnectionsHolder<ConnectionRecord> activity = null;
if (token != null) {
activity = mAm.mAtmInternal.getServiceConnectionsHolder(token);
if (activity == null) {
// TODO(b/171280916): Remove the check after we have another API get window context
// token than getActivityToken.
if (activity == null && !mAm.mWindowManager.isWindowToken(token)) {
Slog.w(TAG, "Binding with unknown activity: " + token);
return 0;
}