Merge "Clean up codegen templates from core companion package."

This commit is contained in:
Raphael Kim
2022-10-13 20:20:57 +00:00
committed by Android (Google) Code Review
2 changed files with 108 additions and 222 deletions

View File

@@ -35,7 +35,6 @@ import android.os.Parcelable;
import android.provider.OneTimeUseBuilder;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DataClass;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -55,13 +54,6 @@ import java.util.Objects;
* You can also set {@link Builder#setSingleDevice single device} to request a popup with single
* device to be shown instead of a list to choose from
*/
@DataClass(
genConstructor = false,
genToString = true,
genEqualsHashCode = true,
genHiddenGetters = true,
genParcelable = true,
genConstDefs = false)
public final class AssociationRequest implements Parcelable {
/**
* Device profile: watch.
@@ -139,24 +131,28 @@ public final class AssociationRequest implements Parcelable {
/**
* If set, only devices matching either of the given filters will be shown to the user
*/
@DataClass.PluralOf("deviceFilter")
private final @NonNull List<DeviceFilter<?>> mDeviceFilters;
@NonNull
private final List<DeviceFilter<?>> mDeviceFilters;
/**
* Profile of the device.
*/
private final @Nullable @DeviceProfile String mDeviceProfile;
@Nullable
@DeviceProfile
private final String mDeviceProfile;
/**
* The Display name of the device to be shown in the CDM confirmation UI. Must be non-null for
* "self-managed" association.
*/
private @Nullable CharSequence mDisplayName;
@Nullable
private CharSequence mDisplayName;
/**
* The device that was associated. Will be null for "self-managed" association.
*/
private @Nullable AssociatedDevice mAssociatedDevice;
@Nullable
private AssociatedDevice mAssociatedDevice;
/**
* Whether the association is to be managed by the companion application.
@@ -175,21 +171,24 @@ public final class AssociationRequest implements Parcelable {
* Populated by the system.
* @hide
*/
private @Nullable String mPackageName;
@Nullable
private String mPackageName;
/**
* The UserId of the user the association will belong to.
* Populated by the system.
* @hide
*/
private @UserIdInt int mUserId;
@UserIdInt
private int mUserId;
/**
* The user-readable description of the device profile's privileges.
* Populated by the system.
* @hide
*/
private @Nullable String mDeviceProfilePrivilegesDescription;
@Nullable
private String mDeviceProfilePrivilegesDescription;
/**
* The time at which his request was created
@@ -243,7 +242,9 @@ public final class AssociationRequest implements Parcelable {
/**
* @return profile of the companion device.
*/
public @Nullable @DeviceProfile String getDeviceProfile() {
@Nullable
@DeviceProfile
public String getDeviceProfile() {
return mDeviceProfile;
}
@@ -251,7 +252,8 @@ public final class AssociationRequest implements Parcelable {
* The Display name of the device to be shown in the CDM confirmation UI. Must be non-null for
* "self-managed" association.
*/
public @Nullable CharSequence getDisplayName() {
@Nullable
public CharSequence getDisplayName() {
return mDisplayName;
}
@@ -328,9 +330,9 @@ public final class AssociationRequest implements Parcelable {
*/
public static final class Builder extends OneTimeUseBuilder<AssociationRequest> {
private boolean mSingleDevice = false;
private @Nullable ArrayList<DeviceFilter<?>> mDeviceFilters = null;
private @Nullable String mDeviceProfile;
private @Nullable CharSequence mDisplayName;
private ArrayList<DeviceFilter<?>> mDeviceFilters = null;
private String mDeviceProfile;
private CharSequence mDisplayName;
private boolean mSelfManaged = false;
private boolean mForceConfirmation = false;
@@ -432,29 +434,13 @@ public final class AssociationRequest implements Parcelable {
}
}
// Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
//
// To regenerate run:
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/companion/AssociationRequest.java
//
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
// Settings > Editor > Code Style > Formatter Control
//@formatter:off
/**
* The device that was associated. Will be null for "self-managed" association.
*
* @hide
*/
@DataClass.Generated.Member
public @Nullable AssociatedDevice getAssociatedDevice() {
@Nullable
public AssociatedDevice getAssociatedDevice() {
return mAssociatedDevice;
}
@@ -464,8 +450,8 @@ public final class AssociationRequest implements Parcelable {
*
* @hide
*/
@DataClass.Generated.Member
public @Nullable String getPackageName() {
@Nullable
public String getPackageName() {
return mPackageName;
}
@@ -475,8 +461,8 @@ public final class AssociationRequest implements Parcelable {
*
* @hide
*/
@DataClass.Generated.Member
public @UserIdInt int getUserId() {
@UserIdInt
public int getUserId() {
return mUserId;
}
@@ -486,8 +472,8 @@ public final class AssociationRequest implements Parcelable {
*
* @hide
*/
@DataClass.Generated.Member
public @Nullable String getDeviceProfilePrivilegesDescription() {
@Nullable
public String getDeviceProfilePrivilegesDescription() {
return mDeviceProfilePrivilegesDescription;
}
@@ -496,7 +482,6 @@ public final class AssociationRequest implements Parcelable {
*
* @hide
*/
@DataClass.Generated.Member
public long getCreationTime() {
return mCreationTime;
}
@@ -507,47 +492,34 @@ public final class AssociationRequest implements Parcelable {
*
* @hide
*/
@DataClass.Generated.Member
public boolean isSkipPrompt() {
return mSkipPrompt;
}
@Override
@DataClass.Generated.Member
public String toString() {
// You can override field toString logic by defining methods like:
// String fieldNameToString() { ... }
return "AssociationRequest { " +
"singleDevice = " + mSingleDevice + ", " +
"deviceFilters = " + mDeviceFilters + ", " +
"deviceProfile = " + mDeviceProfile + ", " +
"displayName = " + mDisplayName + ", " +
"associatedDevice = " + mAssociatedDevice + ", " +
"selfManaged = " + mSelfManaged + ", " +
"forceConfirmation = " + mForceConfirmation + ", " +
"packageName = " + mPackageName + ", " +
"userId = " + mUserId + ", " +
"deviceProfilePrivilegesDescription = " + mDeviceProfilePrivilegesDescription + ", " +
"creationTime = " + mCreationTime + ", " +
"skipPrompt = " + mSkipPrompt +
" }";
return "AssociationRequest { "
+ "singleDevice = " + mSingleDevice
+ ", deviceFilters = " + mDeviceFilters
+ ", deviceProfile = " + mDeviceProfile
+ ", displayName = " + mDisplayName
+ ", associatedDevice = " + mAssociatedDevice
+ ", selfManaged = " + mSelfManaged
+ ", forceConfirmation = " + mForceConfirmation
+ ", packageName = " + mPackageName
+ ", userId = " + mUserId
+ ", deviceProfilePrivilegesDescription = " + mDeviceProfilePrivilegesDescription
+ ", creationTime = " + mCreationTime
+ ", skipPrompt = " + mSkipPrompt
+ " }";
}
@Override
@DataClass.Generated.Member
public boolean equals(@Nullable Object o) {
// You can override field equality logic by defining either of the methods like:
// boolean fieldNameEquals(AssociationRequest other) { ... }
// boolean fieldNameEquals(FieldType otherValue) { ... }
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@SuppressWarnings("unchecked")
AssociationRequest that = (AssociationRequest) o;
//noinspection PointlessBooleanExpression
return true
&& mSingleDevice == that.mSingleDevice
return mSingleDevice == that.mSingleDevice
&& Objects.equals(mDeviceFilters, that.mDeviceFilters)
&& Objects.equals(mDeviceProfile, that.mDeviceProfile)
&& Objects.equals(mDisplayName, that.mDisplayName)
@@ -556,17 +528,14 @@ public final class AssociationRequest implements Parcelable {
&& mForceConfirmation == that.mForceConfirmation
&& Objects.equals(mPackageName, that.mPackageName)
&& mUserId == that.mUserId
&& Objects.equals(mDeviceProfilePrivilegesDescription, that.mDeviceProfilePrivilegesDescription)
&& Objects.equals(mDeviceProfilePrivilegesDescription,
that.mDeviceProfilePrivilegesDescription)
&& mCreationTime == that.mCreationTime
&& mSkipPrompt == that.mSkipPrompt;
}
@Override
@DataClass.Generated.Member
public int hashCode() {
// You can override field hashCode logic by defining methods like:
// int fieldNameHashCode() { ... }
int _hash = 1;
_hash = 31 * _hash + Boolean.hashCode(mSingleDevice);
_hash = 31 * _hash + Objects.hashCode(mDeviceFilters);
@@ -584,21 +553,18 @@ public final class AssociationRequest implements Parcelable {
}
@Override
@DataClass.Generated.Member
public void writeToParcel(@NonNull Parcel dest, int flags) {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
int flg = 0;
if (mSingleDevice) flg |= 0x1;
if (mSelfManaged) flg |= 0x20;
if (mForceConfirmation) flg |= 0x40;
if (mSkipPrompt) flg |= 0x800;
if (mDeviceProfile != null) flg |= 0x4;
if (mDisplayName != null) flg |= 0x8;
if (mAssociatedDevice != null) flg |= 0x10;
if (mSelfManaged) flg |= 0x2;
if (mForceConfirmation) flg |= 0x4;
if (mSkipPrompt) flg |= 0x8;
if (mDeviceProfile != null) flg |= 0x10;
if (mDisplayName != null) flg |= 0x20;
if (mAssociatedDevice != null) flg |= 0x40;
if (mPackageName != null) flg |= 0x80;
if (mDeviceProfilePrivilegesDescription != null) flg |= 0x200;
if (mDeviceProfilePrivilegesDescription != null) flg |= 0x100;
dest.writeInt(flg);
dest.writeParcelableList(mDeviceFilters, flags);
if (mDeviceProfile != null) dest.writeString(mDeviceProfile);
@@ -606,37 +572,36 @@ public final class AssociationRequest implements Parcelable {
if (mAssociatedDevice != null) dest.writeTypedObject(mAssociatedDevice, flags);
if (mPackageName != null) dest.writeString(mPackageName);
dest.writeInt(mUserId);
if (mDeviceProfilePrivilegesDescription != null) dest.writeString(mDeviceProfilePrivilegesDescription);
if (mDeviceProfilePrivilegesDescription != null) {
dest.writeString8(mDeviceProfilePrivilegesDescription);
}
dest.writeLong(mCreationTime);
}
@Override
@DataClass.Generated.Member
public int describeContents() { return 0; }
public int describeContents() {
return 0;
}
/** @hide */
@SuppressWarnings({"unchecked", "RedundantCast"})
@DataClass.Generated.Member
@SuppressWarnings("unchecked")
/* package-private */ AssociationRequest(@NonNull Parcel in) {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
int flg = in.readInt();
boolean singleDevice = (flg & 0x1) != 0;
boolean selfManaged = (flg & 0x20) != 0;
boolean forceConfirmation = (flg & 0x40) != 0;
boolean skipPrompt = (flg & 0x800) != 0;
boolean selfManaged = (flg & 0x2) != 0;
boolean forceConfirmation = (flg & 0x4) != 0;
boolean skipPrompt = (flg & 0x8) != 0;
List<DeviceFilter<?>> deviceFilters = new ArrayList<>();
in.readParcelableList(deviceFilters, DeviceFilter.class.getClassLoader(),
(Class<android.companion.DeviceFilter<?>>) (Class<?>)
android.companion.DeviceFilter.class);
String deviceProfile = (flg & 0x4) == 0 ? null : in.readString();
CharSequence displayName = (flg & 0x8) == 0 ? null : (CharSequence) in.readCharSequence();
AssociatedDevice associatedDevice = (flg & 0x10) == 0
? null : (AssociatedDevice) in.readTypedObject(AssociatedDevice.CREATOR);
String deviceProfile = (flg & 0x10) == 0 ? null : in.readString();
CharSequence displayName = (flg & 0x20) == 0 ? null : in.readCharSequence();
AssociatedDevice associatedDevice = (flg & 0x40) == 0 ? null
: in.readTypedObject(AssociatedDevice.CREATOR);
String packageName = (flg & 0x80) == 0 ? null : in.readString();
int userId = in.readInt();
String deviceProfilePrivilegesDescription = (flg & 0x200) == 0 ? null : in.readString();
String deviceProfilePrivilegesDescription = (flg & 0x100) == 0 ? null : in.readString8();
long creationTime = in.readLong();
this.mSingleDevice = singleDevice;
@@ -644,8 +609,6 @@ public final class AssociationRequest implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mDeviceFilters);
this.mDeviceProfile = deviceProfile;
com.android.internal.util.AnnotationValidations.validate(
DeviceProfile.class, null, mDeviceProfile);
this.mDisplayName = displayName;
this.mAssociatedDevice = associatedDevice;
this.mSelfManaged = selfManaged;
@@ -657,13 +620,11 @@ public final class AssociationRequest implements Parcelable {
this.mDeviceProfilePrivilegesDescription = deviceProfilePrivilegesDescription;
this.mCreationTime = creationTime;
this.mSkipPrompt = skipPrompt;
// onConstructed(); // You can define this method to get a callback
}
@DataClass.Generated.Member
public static final @NonNull Parcelable.Creator<AssociationRequest> CREATOR
= new Parcelable.Creator<AssociationRequest>() {
@NonNull
public static final Parcelable.Creator<AssociationRequest> CREATOR =
new Parcelable.Creator<AssociationRequest>() {
@Override
public AssociationRequest[] newArray(int size) {
return new AssociationRequest[size];
@@ -674,17 +635,4 @@ public final class AssociationRequest implements Parcelable {
return new AssociationRequest(in);
}
};
@DataClass.Generated(
time = 1663088980513L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/companion/AssociationRequest.java",
inputSignatures = "public static final java.lang.String DEVICE_PROFILE_WATCH\npublic static final @android.annotation.RequiresPermission java.lang.String DEVICE_PROFILE_APP_STREAMING\npublic static final @android.annotation.RequiresPermission java.lang.String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION\npublic static final @android.annotation.RequiresPermission java.lang.String DEVICE_PROFILE_COMPUTER\nprivate final boolean mSingleDevice\nprivate final @com.android.internal.util.DataClass.PluralOf(\"deviceFilter\") @android.annotation.NonNull java.util.List<android.companion.DeviceFilter<?>> mDeviceFilters\nprivate final @android.annotation.Nullable @android.companion.AssociationRequest.DeviceProfile java.lang.String mDeviceProfile\nprivate @android.annotation.Nullable java.lang.CharSequence mDisplayName\nprivate @android.annotation.Nullable android.companion.AssociatedDevice mAssociatedDevice\nprivate final boolean mSelfManaged\nprivate final boolean mForceConfirmation\nprivate @android.annotation.Nullable java.lang.String mPackageName\nprivate @android.annotation.UserIdInt int mUserId\nprivate @android.annotation.Nullable java.lang.String mDeviceProfilePrivilegesDescription\nprivate final long mCreationTime\nprivate boolean mSkipPrompt\npublic @android.annotation.Nullable @android.companion.AssociationRequest.DeviceProfile java.lang.String getDeviceProfile()\npublic @android.annotation.Nullable java.lang.CharSequence getDisplayName()\npublic boolean isSelfManaged()\npublic boolean isForceConfirmation()\npublic boolean isSingleDevice()\npublic void setPackageName(java.lang.String)\npublic void setUserId(int)\npublic void setDeviceProfilePrivilegesDescription(java.lang.String)\npublic void setSkipPrompt(boolean)\npublic void setDisplayName(java.lang.CharSequence)\npublic void setAssociatedDevice(android.companion.AssociatedDevice)\npublic @android.annotation.NonNull @android.compat.annotation.UnsupportedAppUsage java.util.List<android.companion.DeviceFilter<?>> getDeviceFilters()\nclass AssociationRequest extends java.lang.Object implements [android.os.Parcelable]\nprivate boolean mSingleDevice\nprivate @android.annotation.Nullable java.util.ArrayList<android.companion.DeviceFilter<?>> mDeviceFilters\nprivate @android.annotation.Nullable java.lang.String mDeviceProfile\nprivate @android.annotation.Nullable java.lang.CharSequence mDisplayName\nprivate boolean mSelfManaged\nprivate boolean mForceConfirmation\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setSingleDevice(boolean)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder addDeviceFilter(android.companion.DeviceFilter<?>)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setDeviceProfile(java.lang.String)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setDisplayName(java.lang.CharSequence)\npublic @android.annotation.RequiresPermission @android.annotation.NonNull android.companion.AssociationRequest.Builder setSelfManaged(boolean)\npublic @android.annotation.RequiresPermission @android.annotation.NonNull android.companion.AssociationRequest.Builder setForceConfirmation(boolean)\npublic @android.annotation.NonNull @java.lang.Override android.companion.AssociationRequest build()\nclass Builder extends android.provider.OneTimeUseBuilder<android.companion.AssociationRequest> implements []\n@com.android.internal.util.DataClass(genConstructor=false, genToString=true, genEqualsHashCode=true, genHiddenGetters=true, genParcelable=true, genConstDefs=false)")
@Deprecated
private void __metadata() {}
//@formatter:on
// End of generated code
}

View File

@@ -27,7 +27,6 @@ import android.net.wifi.ScanResult;
import android.os.Parcel;
import android.os.Parcelable;
import com.android.internal.util.DataClass;
import com.android.internal.util.Parcelling;
import java.util.Objects;
@@ -38,32 +37,27 @@ import java.util.regex.Pattern;
*
* @see ScanFilter
*/
@DataClass(
genParcelable = true,
genAidl = false,
genBuilder = true,
genEqualsHashCode = true,
genHiddenGetters = true)
public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
/**
* If set, only devices with {@link BluetoothDevice#getName name} matching the given regular
* expression will be shown
*/
@DataClass.ParcelWith(Parcelling.BuiltIn.ForPattern.class)
@DataClass.MaySetToNull
private @Nullable Pattern mNamePattern = null;
@Nullable
private final Pattern mNamePattern;
/**
* If set, only devices with BSSID matching the given one will be shown
*/
private @Nullable MacAddress mBssid = null;
@Nullable
private final MacAddress mBssid;
/**
* If set, only bits at positions set in this mask, will be compared to the given
* {@link Builder#setBssid BSSID} filter.
*/
private @NonNull MacAddress mBssidMask = MacAddress.BROADCAST_ADDRESS;
@NonNull
private final MacAddress mBssidMask;
/** @hide */
@Override
@@ -85,22 +79,6 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
return MEDIUM_TYPE_WIFI;
}
// Code below generated by codegen v1.0.15.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
//
// To regenerate run:
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/companion/WifiDeviceFilter.java
//
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
// Settings > Editor > Code Style > Formatter Control
//@formatter:off
@DataClass.Generated.Member
/* package-private */ WifiDeviceFilter(
@Nullable Pattern namePattern,
@Nullable MacAddress bssid,
@@ -110,8 +88,6 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
this.mBssidMask = bssidMask;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mBssidMask);
// onConstructed(); // You can define this method to get a callback
}
/**
@@ -120,8 +96,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
*
* @hide
*/
@DataClass.Generated.Member
public @Nullable Pattern getNamePattern() {
@Nullable
public Pattern getNamePattern() {
return mNamePattern;
}
@@ -130,8 +106,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
*
* @hide
*/
@DataClass.Generated.Member
public @Nullable MacAddress getBssid() {
@Nullable
public MacAddress getBssid() {
return mBssid;
}
@@ -141,35 +117,23 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
*
* @hide
*/
@DataClass.Generated.Member
public @NonNull MacAddress getBssidMask() {
@NonNull
public MacAddress getBssidMask() {
return mBssidMask;
}
@Override
@DataClass.Generated.Member
public boolean equals(@Nullable Object o) {
// You can override field equality logic by defining either of the methods like:
// boolean fieldNameEquals(WifiDeviceFilter other) { ... }
// boolean fieldNameEquals(FieldType otherValue) { ... }
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@SuppressWarnings("unchecked")
WifiDeviceFilter that = (WifiDeviceFilter) o;
//noinspection PointlessBooleanExpression
return true
&& Objects.equals(mNamePattern, that.mNamePattern)
return Objects.equals(mNamePattern, that.mNamePattern)
&& Objects.equals(mBssid, that.mBssid)
&& Objects.equals(mBssidMask, that.mBssidMask);
}
@Override
@DataClass.Generated.Member
public int hashCode() {
// You can override field hashCode logic by defining methods like:
// int fieldNameHashCode() { ... }
int _hash = 1;
_hash = 31 * _hash + Objects.hashCode(mNamePattern);
_hash = 31 * _hash + Objects.hashCode(mBssid);
@@ -177,10 +141,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
return _hash;
}
@DataClass.Generated.Member
static Parcelling<Pattern> sParcellingForNamePattern =
Parcelling.Cache.get(
Parcelling.BuiltIn.ForPattern.class);
Parcelling.Cache.get(Parcelling.BuiltIn.ForPattern.class);
static {
if (sParcellingForNamePattern == null) {
sParcellingForNamePattern = Parcelling.Cache.put(
@@ -189,11 +151,7 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
}
@Override
@DataClass.Generated.Member
public void writeToParcel(@NonNull Parcel dest, int flags) {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
byte flg = 0;
if (mNamePattern != null) flg |= 0x1;
if (mBssid != null) flg |= 0x2;
@@ -204,33 +162,27 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
}
@Override
@DataClass.Generated.Member
public int describeContents() { return 0; }
public int describeContents() {
return 0;
}
/** @hide */
@SuppressWarnings({"unchecked", "RedundantCast"})
@DataClass.Generated.Member
/* package-private */ WifiDeviceFilter(@NonNull Parcel in) {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
byte flg = in.readByte();
Pattern namePattern = sParcellingForNamePattern.unparcel(in);
MacAddress bssid = (flg & 0x2) == 0 ? null : (MacAddress) in.readTypedObject(MacAddress.CREATOR);
MacAddress bssidMask = (MacAddress) in.readTypedObject(MacAddress.CREATOR);
MacAddress bssid = (flg & 0x2) == 0 ? null : in.readTypedObject(MacAddress.CREATOR);
MacAddress bssidMask = in.readTypedObject(MacAddress.CREATOR);
this.mNamePattern = namePattern;
this.mBssid = bssid;
this.mBssidMask = bssidMask;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mBssidMask);
// onConstructed(); // You can define this method to get a callback
}
@DataClass.Generated.Member
public static final @NonNull Parcelable.Creator<WifiDeviceFilter> CREATOR
= new Parcelable.Creator<WifiDeviceFilter>() {
@NonNull
public static final Parcelable.Creator<WifiDeviceFilter> CREATOR =
new Parcelable.Creator<WifiDeviceFilter>() {
@Override
public WifiDeviceFilter[] newArray(int size) {
return new WifiDeviceFilter[size];
@@ -246,12 +198,11 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
* A builder for {@link WifiDeviceFilter}
*/
@SuppressWarnings("WeakerAccess")
@DataClass.Generated.Member
public static final class Builder {
private @Nullable Pattern mNamePattern;
private @Nullable MacAddress mBssid;
private @NonNull MacAddress mBssidMask;
@Nullable private Pattern mNamePattern;
@Nullable private MacAddress mBssid;
@NonNull private MacAddress mBssidMask;
private long mBuilderFieldsSet = 0L;
@@ -262,8 +213,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
* If set, only devices with {@link BluetoothDevice#getName name} matching the given regular
* expression will be shown
*/
@DataClass.Generated.Member
public @NonNull Builder setNamePattern(@Nullable Pattern value) {
@NonNull
public Builder setNamePattern(@Nullable Pattern value) {
checkNotUsed();
mBuilderFieldsSet |= 0x1;
mNamePattern = value;
@@ -273,8 +224,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
/**
* If set, only devices with BSSID matching the given one will be shown
*/
@DataClass.Generated.Member
public @NonNull Builder setBssid(@NonNull MacAddress value) {
@NonNull
public Builder setBssid(@NonNull MacAddress value) {
checkNotUsed();
mBuilderFieldsSet |= 0x2;
mBssid = value;
@@ -285,8 +236,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
* If set, only bits at positions set in this mask, will be compared to the given
* {@link Builder#setBssid BSSID} filter.
*/
@DataClass.Generated.Member
public @NonNull Builder setBssidMask(@NonNull MacAddress value) {
@NonNull
public Builder setBssidMask(@NonNull MacAddress value) {
checkNotUsed();
mBuilderFieldsSet |= 0x4;
mBssidMask = value;
@@ -294,7 +245,8 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
}
/** Builds the instance. This builder should not be touched after calling this! */
public @NonNull WifiDeviceFilter build() {
@NonNull
public WifiDeviceFilter build() {
checkNotUsed();
mBuilderFieldsSet |= 0x8; // Mark builder used
@@ -307,11 +259,10 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
if ((mBuilderFieldsSet & 0x4) == 0) {
mBssidMask = MacAddress.BROADCAST_ADDRESS;
}
WifiDeviceFilter o = new WifiDeviceFilter(
return new WifiDeviceFilter(
mNamePattern,
mBssid,
mBssidMask);
return o;
}
private void checkNotUsed() {
@@ -321,17 +272,4 @@ public final class WifiDeviceFilter implements DeviceFilter<ScanResult> {
}
}
}
@DataClass.Generated(
time = 1582688421965L,
codegenVersion = "1.0.15",
sourceFile = "frameworks/base/core/java/android/companion/WifiDeviceFilter.java",
inputSignatures = "private @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForPattern.class) @com.android.internal.util.DataClass.MaySetToNull @android.annotation.Nullable java.util.regex.Pattern mNamePattern\nprivate @android.annotation.Nullable android.net.MacAddress mBssid\nprivate @android.annotation.NonNull android.net.MacAddress mBssidMask\npublic @java.lang.Override boolean matches(android.net.wifi.ScanResult)\npublic @java.lang.Override java.lang.String getDeviceDisplayName(android.net.wifi.ScanResult)\npublic @java.lang.Override int getMediumType()\nclass WifiDeviceFilter extends java.lang.Object implements [android.companion.DeviceFilter<android.net.wifi.ScanResult>]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=false, genBuilder=true, genEqualsHashCode=true, genHiddenGetters=true)")
@Deprecated
private void __metadata() {}
//@formatter:on
// End of generated code
}