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

Commit f4dfdda4 authored by Menghan Li's avatar Menghan Li
Browse files

Add a new API: checkSurveyAvailable

This change introduces a new API within SettingsIntelligence to enable
SettingsGoogle to identify available surveys for Pixel device users.
This API will be used by SettingsGoogle to determine if there are any
surveys available for a user to take.

Bug: 380346685
Flag: com.android.server.accessibility.enable_low_vision_hats
Test: atest SurveyFeatureProviderImplTest
Change-Id: Ia4e694b6c8a240af4422baff61386d9ee5ffc346
parent 99c5bf8b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -19,7 +19,10 @@ import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.util.Consumer;
import androidx.lifecycle.LifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

/**
@@ -109,4 +112,14 @@ public interface SurveyFeatureProvider {
     * @param simpleKey The simple name of the key to get the surveyId for.
     */
    void sendActivityIfAvailable(String simpleKey);

    /**
     * Checks if a survey is available for the given key by binding to the survey service.
     *
     * @param lifecycleOwner The lifecycle owner to manage the service connection.
     * @param simpleKey The simple name of the key to get the surveyId for.
     * @param listener The callback to be invoked when the survey availability is checked.
     */
    void checkSurveyAvailable(@NonNull LifecycleOwner lifecycleOwner, @NonNull String simpleKey,
            @NonNull Consumer<Boolean> listener);
}