public abstract class

AdvertisingIdProviderInfo

extends java.lang.Object

 java.lang.Object

↳androidx.ads.identifier.provider.AdvertisingIdProviderInfo

Gradle dependencies

compile group: 'androidx.ads', name: 'ads-identifier-provider', version: '1.0.0-alpha04'

  • groupId: androidx.ads
  • artifactId: ads-identifier-provider
  • version: 1.0.0-alpha04

Artifact androidx.ads:ads-identifier-provider:1.0.0-alpha04 it located at Google repository (https://maven.google.com/)

Overview

A AdvertisingIdProviderInfo represents the information about an Advertising ID Provider installed on the device.

Used in cases when there are multiple Advertising ID Providers on the device. See AdvertisingIdProviderManager.getAdvertisingIdProviders(Context) for more details.

Summary

Methods
public abstract java.lang.StringgetPackageName()

Retrieves the Advertising ID Provider package name.

public abstract IntentgetSettingsIntent()

Retrieves the to open the Advertising ID settings page for a given Advertising ID Provider.

public abstract booleanisHighestPriority()

Retrieves whether the provider has the highest priority among all the providers for the developer library, meaning its provided ID will be used.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods

public abstract java.lang.String getPackageName()

Retrieves the Advertising ID Provider package name.

public abstract Intent getSettingsIntent()

Retrieves the to open the Advertising ID settings page for a given Advertising ID Provider.

This page should allow the user to reset Advertising IDs and change Limit Advertising Tracking preference.

public abstract boolean isHighestPriority()

Retrieves whether the provider has the highest priority among all the providers for the developer library, meaning its provided ID will be used.

Source

/*
 * Copyright 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.ads.identifier.provider;

import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.auto.value.AutoValue;

/**
 * A {@link AdvertisingIdProviderInfo} represents the information about an Advertising ID Provider
 * installed on the device.
 *
 * <p>Used in cases when there are multiple Advertising ID Providers on the device. See
 * {@link AdvertisingIdProviderManager#getAdvertisingIdProviders} for more details.
 */
@AutoValue
public abstract class AdvertisingIdProviderInfo {

    // Create a no-args constructor so it doesn't appear in current.txt
    AdvertisingIdProviderInfo() {
    }

    /** Retrieves the Advertising ID Provider package name. */
    @NonNull
    public abstract String getPackageName();

    /**
     * Retrieves the {@link Intent} to open the Advertising ID settings page for a given
     * Advertising ID Provider.
     *
     * <p>This page should allow the user to reset Advertising IDs and change Limit Advertising
     * Tracking preference.
     */
    @Nullable
    public abstract Intent getSettingsIntent();

    /**
     * Retrieves whether the provider has the highest priority among all the providers for the
     * developer library, meaning its provided ID will be used.
     */
    public abstract boolean isHighestPriority();

    /** Create a {@link Builder}. */
    static Builder builder() {
        return new AutoValue_AdvertisingIdProviderInfo.Builder().setHighestPriority(false);
    }

    /** The builder for {@link AdvertisingIdProviderInfo}. */
    @AutoValue.Builder
    abstract static class Builder {

        // Create a no-args constructor so it doesn't appear in current.txt
        Builder() {
        }

        abstract Builder setPackageName(String packageName);

        abstract Builder setSettingsIntent(Intent settingsIntent);

        abstract Builder setHighestPriority(boolean highestPriority);

        abstract AdvertisingIdProviderInfo build();
    }
}