Merge "Don't time out device listener service connections" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-02 18:59:02 +00:00
committed by Android (Google) Code Review

View File

@@ -1120,11 +1120,18 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
}
ComponentName componentName = packageResolveInfos.get(0).serviceInfo.getComponentName();
Slog.i(LOG_TAG, "Initializing CompanionDeviceService binding for " + componentName);
return new ServiceConnector.Impl<>(getContext(),
return new ServiceConnector.Impl<ICompanionDeviceService>(getContext(),
new Intent(CompanionDeviceService.SERVICE_INTERFACE).setComponent(componentName),
BIND_IMPORTANT,
a.getUserId(),
ICompanionDeviceService.Stub::asInterface);
ICompanionDeviceService.Stub::asInterface) {
@Override
protected long getAutoDisconnectTimeoutMs() {
// Service binding is managed manually based on corresponding device being nearby
return Long.MAX_VALUE;
}
};
}
private class BleScanCallback extends ScanCallback {