public abstract class

AdvertisingIdInfo

extends java.lang.Object

 java.lang.Object

↳androidx.ads.identifier.AdvertisingIdInfo

Gradle dependencies

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

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

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

Overview

Advertising ID Information. Includes both the Advertising ID and the limit ad tracking setting.

Summary

Methods
public abstract java.lang.StringgetId()

Retrieves the Advertising ID.

public abstract java.lang.StringgetProviderPackageName()

Retrieves the Advertising ID provider package name.

public abstract booleanisLimitAdTrackingEnabled()

Retrieves whether the user has set Limit Advertising Tracking.

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

Methods

public abstract java.lang.String getId()

Retrieves the Advertising ID.

public abstract java.lang.String getProviderPackageName()

Retrieves the Advertising ID provider package name.

public abstract boolean isLimitAdTrackingEnabled()

Retrieves whether the user has set Limit Advertising Tracking.

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;

import androidx.annotation.NonNull;

import com.google.auto.value.AutoValue;

/**
 * Advertising ID Information.
 * Includes both the Advertising ID and the limit ad tracking setting.
 */
@AutoValue
public abstract class AdvertisingIdInfo {

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

    /** Retrieves the Advertising ID. */
    @NonNull
    public abstract String getId();

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

    /** Retrieves whether the user has set Limit Advertising Tracking. */
    public abstract boolean isLimitAdTrackingEnabled();

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

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

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

        abstract Builder setId(String id);

        abstract Builder setProviderPackageName(String providerPackageName);

        abstract Builder setLimitAdTrackingEnabled(boolean limitAdTrackingEnabled);

        abstract AdvertisingIdInfo build();
    }
}