public final class

DefaultComplicationDataSourcePolicyWireFormat

extends java.lang.Object

implements VersionedParcelable

 java.lang.Object

↳androidx.wear.watchface.complications.data.DefaultComplicationDataSourcePolicyWireFormat

Gradle dependencies

compile group: 'androidx.wear.watchface', name: 'watchface-complications-data', version: '1.3.0-alpha03'

  • groupId: androidx.wear.watchface
  • artifactId: watchface-complications-data
  • version: 1.3.0-alpha03

Artifact androidx.wear.watchface:watchface-complications-data:1.3.0-alpha03 it located at Google repository (https://maven.google.com/)

Summary

Fields
public static final <any>CREATOR

public java.util.List<ComponentName>mDefaultDataSourcesToTry

public intmDefaultType

public intmFallbackSystemDataSource

public intmPrimaryDataSourceDefaultType

public intmSecondaryDataSourceDefaultType

Constructors
publicDefaultComplicationDataSourcePolicyWireFormat(java.util.List<ComponentName> defaultDataSourcesToTry, int fallbackSystemDataSource, int defaultDataSourceType, int primaryDataSourceDefaultType, int secondaryDataSourceDefaultType)

Methods
public intdescribeContents()

public voidwriteToParcel(Parcel parcel, int flags)

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

Fields

public java.util.List<ComponentName> mDefaultDataSourcesToTry

public int mFallbackSystemDataSource

public int mDefaultType

public int mPrimaryDataSourceDefaultType

public int mSecondaryDataSourceDefaultType

public static final <any> CREATOR

Constructors

public DefaultComplicationDataSourcePolicyWireFormat(java.util.List<ComponentName> defaultDataSourcesToTry, int fallbackSystemDataSource, int defaultDataSourceType, int primaryDataSourceDefaultType, int secondaryDataSourceDefaultType)

Methods

public void writeToParcel(Parcel parcel, int flags)

public int describeContents()

Source

/*
 * Copyright 2022 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.wear.watchface.complications.data;

import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.wearable.complications.ComplicationData;

import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.versionedparcelable.ParcelField;
import androidx.versionedparcelable.ParcelUtils;
import androidx.versionedparcelable.VersionedParcelable;
import androidx.versionedparcelable.VersionedParcelize;

import java.util.List;

@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@VersionedParcelize
@SuppressLint("BanParcelableUsage") // TODO(b/169214666): Remove Parcelable
public final class DefaultComplicationDataSourcePolicyWireFormat
        implements VersionedParcelable, Parcelable {

    @ParcelField(1)
    @NonNull
    public List<ComponentName> mDefaultDataSourcesToTry;

    @ParcelField(2)
    public int mFallbackSystemDataSource;

    @ParcelField(3)
    @ComplicationData.ComplicationType
    public int mDefaultType;

    @ParcelField(4)
    @ComplicationData.ComplicationType
    public int mPrimaryDataSourceDefaultType;

    @ParcelField(5)
    @ComplicationData.ComplicationType
    public int mSecondaryDataSourceDefaultType;

    DefaultComplicationDataSourcePolicyWireFormat() {}

    public DefaultComplicationDataSourcePolicyWireFormat(
            @NonNull List<ComponentName> defaultDataSourcesToTry,
            int fallbackSystemDataSource,
            @ComplicationData.ComplicationType int defaultDataSourceType,
            @ComplicationData.ComplicationType int primaryDataSourceDefaultType,
            @ComplicationData.ComplicationType int secondaryDataSourceDefaultType) {
        mDefaultDataSourcesToTry = defaultDataSourcesToTry;
        mPrimaryDataSourceDefaultType = primaryDataSourceDefaultType;
        mSecondaryDataSourceDefaultType = secondaryDataSourceDefaultType;
        mFallbackSystemDataSource = fallbackSystemDataSource;
        mDefaultType = defaultDataSourceType;
    }

    @Override
    public void writeToParcel(@NonNull Parcel parcel, int flags) {
        parcel.writeParcelable(ParcelUtils.toParcelable(this), flags);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<DefaultComplicationDataSourcePolicyWireFormat> CREATOR =
            new Creator<DefaultComplicationDataSourcePolicyWireFormat>() {
                @SuppressWarnings("deprecation")
                @Override
                public DefaultComplicationDataSourcePolicyWireFormat createFromParcel(
                        Parcel source) {
                    return ParcelUtils.fromParcelable(
                            source.readParcelable(getClass().getClassLoader()));
                }

                @Override
                public DefaultComplicationDataSourcePolicyWireFormat[] newArray(int size) {
                    return new DefaultComplicationDataSourcePolicyWireFormat[size];
                }
            };
}