summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Chen <evanxinchen@google.com> 2024-12-06 17:44:07 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-12-06 17:44:07 +0000
commitfdddba2505d08132b8bd7002b2dfa8bec6ddb781 (patch)
tree99ed134a3511eb58598b7e7b66ae27ccba2cae04
parent1022a107e7fd052c4dfdea3b07d778cd540cbb44 (diff)
parent15a7e96e0b0a1533903ecd82dd50dc920e802eb0 (diff)
Merge "Remove ontimeUsedbuilder for DeviceId" into main
-rw-r--r--core/java/android/companion/DeviceId.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/core/java/android/companion/DeviceId.java b/core/java/android/companion/DeviceId.java
index d9514a02c2b4..2f19eb49ad43 100644
--- a/core/java/android/companion/DeviceId.java
+++ b/core/java/android/companion/DeviceId.java
@@ -22,7 +22,6 @@ import android.annotation.Nullable;
import android.net.MacAddress;
import android.os.Parcel;
import android.os.Parcelable;
-import android.provider.OneTimeUseBuilder;
import java.util.Locale;
import java.util.Objects;
@@ -159,7 +158,7 @@ public final class DeviceId implements Parcelable {
* the device: a custom ID using {@link #setCustomId(String)}, or a MAC address using
* {@link #setMacAddress(MacAddress)}.</p>
*/
- public static final class Builder extends OneTimeUseBuilder<DeviceId> {
+ public static final class Builder {
private String mCustomId;
private MacAddress mMacAddress;
@@ -175,7 +174,6 @@ public final class DeviceId implements Parcelable {
*/
@NonNull
public Builder setCustomId(@Nullable String customId) {
- checkNotUsed();
if (customId != null
&& customId.length() > CUSTOM_ID_LENGTH_LIMIT) {
throw new IllegalArgumentException("Length of the custom id must be at most "
@@ -195,15 +193,12 @@ public final class DeviceId implements Parcelable {
*/
@NonNull
public Builder setMacAddress(@Nullable MacAddress macAddress) {
- checkNotUsed();
mMacAddress = macAddress;
return this;
}
@NonNull
- @Override
public DeviceId build() {
- markUsed();
if (mCustomId == null && mMacAddress == null) {
throw new IllegalArgumentException("At least one device id property must be"
+ "non-null to build a DeviceId.");