Merge "Don't time out device listener service connections" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1da23870fd
@@ -1120,11 +1120,18 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
|
|||||||
}
|
}
|
||||||
ComponentName componentName = packageResolveInfos.get(0).serviceInfo.getComponentName();
|
ComponentName componentName = packageResolveInfos.get(0).serviceInfo.getComponentName();
|
||||||
Slog.i(LOG_TAG, "Initializing CompanionDeviceService binding for " + componentName);
|
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),
|
new Intent(CompanionDeviceService.SERVICE_INTERFACE).setComponent(componentName),
|
||||||
BIND_IMPORTANT,
|
BIND_IMPORTANT,
|
||||||
a.getUserId(),
|
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 {
|
private class BleScanCallback extends ScanCallback {
|
||||||
|
|||||||
Reference in New Issue
Block a user