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

Commit 8b876691 authored by Zak Cohen's avatar Zak Cohen
Browse files

Properly update remote service when ContentSuggestionsPerUserService is updated.

Test: CTS
Change-Id: I6604efb9f7514b2abff28d65ca77da7903d1cbc5
parent 63ebfcba
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -80,12 +80,7 @@ public final class ContentSuggestionsPerUserService extends
    @Override // from PerUserSystemService
    protected boolean updateLocked(boolean disabled) {
        final boolean enabledChanged = super.updateLocked(disabled);
        if (enabledChanged) {
            if (!isEnabledLocked()) {
                // Clear the remote service for the next call
                mRemoteService = null;
            }
        }
        updateRemoteServiceLocked();
        return enabledChanged;
    }

@@ -132,6 +127,15 @@ public final class ContentSuggestionsPerUserService extends
        }
    }

    @GuardedBy("mLock")
    private void updateRemoteServiceLocked() {
        if (mRemoteService != null) {
            mRemoteService.destroy();
            mRemoteService = null;
        }
    }


    @GuardedBy("mLock")
    @Nullable
    private RemoteContentSuggestionsService getRemoteServiceLocked() {