Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdddba25 authored by Evan Chen's avatar Evan Chen Committed by Android (Google) Code Review
Browse files

Merge "Remove ontimeUsedbuilder for DeviceId" into main

parents 1022a107 15a7e96e
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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.");