Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2573e000 authored by Eugene Susla's avatar Eugene Susla
Browse files

Don't time out device listener service connections

These service bindings are managed manually based on companion
device being nearby

Bug: 181344542
Test: presubmit

Change-Id: I459d367824c6f1b97eb532bd86f16cd1f90e07fa
parent 008e3b80
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -1118,11 +1118,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 {