TopicsManager

public final class TopicsManager
extends Object

java.lang.Object
   ↳ android.adservices.topics.TopicsManager


TopicsManager provides APIs for App and Ad-Sdks to get the user interest topics in a privacy preserving way.

The instance of the TopicsManager can be obtained using Context.getSystemService(Class) and TopicsManager class.

Summary

Public methods

static TopicsManager get(Context context)

Factory method for creating an instance of TopicsManager.

void getTopics(GetTopicsRequest getTopicsRequest, Executor executor, OutcomeReceiver<GetTopicsResponseException> callback)

Return the topics.

Inherited methods

Public methods

get

public static TopicsManager get (Context context)

Factory method for creating an instance of TopicsManager.

Parameters
context Context: The Context to use This value cannot be null.

Returns
TopicsManager A TopicsManager instance This value cannot be null.

getTopics

public void getTopics (GetTopicsRequest getTopicsRequest, 
                Executor executor, 
                OutcomeReceiver<GetTopicsResponseException> callback)

Return the topics.
Requires AdServicesPermissions.ACCESS_ADSERVICES_TOPICS

Parameters
getTopicsRequest GetTopicsRequest: The request for obtaining Topics. This value cannot be null.

executor Executor: The executor to run callback. This value cannot be null.
callback OutcomeReceiver: The callback that's called after topics are available or an error occurs. This value cannot be null.

Returns
void This value cannot be null.

Throws
SecurityException if caller is not authorized to call this API.
IllegalStateException if this API is not available.
LimitExceededException if rate limit was reached.