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

Commit 5a4acfbb authored by Arthur Ishiguro's avatar Arthur Ishiguro Committed by Android (Google) Code Review
Browse files

Merge "Refresh cached hub and endpoint info before returning." into main

parents 6a419efd aea0d390
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ class HubInfoRegistry implements ContextHubHalEndpointCallback.IEndpointLifecycl

    /** Retrieve the list of hubs available. */
    List<HubInfo> getHubs() {
        refreshCachedHubs();
        synchronized (mLock) {
            return mHubsInfo;
        }
@@ -265,6 +266,7 @@ class HubInfoRegistry implements ContextHubHalEndpointCallback.IEndpointLifecycl

    /** Return a list of {@link HubEndpointInfo} that represents endpoints with the matching id. */
    public List<HubEndpointInfo> findEndpoints(long endpointIdQuery) {
        refreshCachedEndpoints();
        List<HubEndpointInfo> searchResult = new ArrayList<>();
        synchronized (mLock) {
            for (HubEndpointInfo.HubEndpointIdentifier endpointId : mHubEndpointInfos.keySet()) {
@@ -280,6 +282,7 @@ class HubInfoRegistry implements ContextHubHalEndpointCallback.IEndpointLifecycl
     * Return a list of {@link HubEndpointInfo} that represents endpoints with the matching service.
     */
    public List<HubEndpointInfo> findEndpointsWithService(String serviceDescriptor) {
        refreshCachedEndpoints();
        List<HubEndpointInfo> searchResult = new ArrayList<>();
        synchronized (mLock) {
            for (HubEndpointInfo endpointInfo : mHubEndpointInfos.values()) {