content: package androidx.work;
  
  import android.net.Uri;
  import android.os.Build;
  import java.time.Duration;
  import java.util.concurrent.TimeUnit;
  
  public final class Constraints {
      public static final Constraints NONE = new Builder().build();
      private ContentUriTriggers mContentUriTriggers = new ContentUriTriggers();
      private NetworkType mRequiredNetworkType = NetworkType.NOT_REQUIRED;
      private boolean mRequiresBatteryNotLow;
      private boolean mRequiresCharging;
      private boolean mRequiresDeviceIdle;
      private boolean mRequiresStorageNotLow;
      private long mTriggerContentUpdateDelay = -1;
      private long mTriggerMaxContentDelay = -1;
  
      public static final class Builder {
          ContentUriTriggers mContentUriTriggers = new ContentUriTriggers();
          NetworkType mRequiredNetworkType = NetworkType.NOT_REQUIRED;
          boolean mRequiresBatteryNotLow = false;
          boolean mRequiresCharging = false;
          boolean mRequiresDeviceIdle = false;
          boolean mRequiresStorageNotLow = false;
          long mTriggerContentMaxDelay = -1;
          long mTriggerContentUpdateDelay = -1;
  
          public Builder() {
          }
  
          public Builder(Constraints constraints) {
              boolean z = false;
              this.mRequiresCharging = constraints.requiresCharging();
              if (Build.VERSION.SDK_INT >= 23 && constraints.requiresDeviceIdle()) {
                  z = true;
              }
              this.mRequiresDeviceIdle = z;
              this.mRequiredNetworkType = constraints.getRequiredNetworkType();
              this.mRequiresBatteryNotLow = constraints.requiresBatteryNotLow();
              this.mRequiresStorageNotLow = constraints.requiresStorageNotLow();
              if (Build.VERSION.SDK_INT >= 24) {
                  this.mTriggerContentUpdateDelay = constraints.getTriggerContentUpdateDelay();
                  this.mTriggerContentMaxDelay = constraints.getTriggerMaxContentDelay();
                  this.mContentUriTriggers = constraints.getContentUriTriggers();
              }
          }
  
          public Builder addContentUriTrigger(Uri uri, boolean triggerForDescendants) {
              this.mContentUriTriggers.add(uri, triggerForDescendants);
              return this;
          }
  
          public Constraints build() {
              return new Constraints(this);
          }
  
          public Builder setRequiredNetworkType(NetworkType networkType) {
              this.mRequiredNetworkType = networkType;
              return this;
          }
  
          public Builder setRequiresBatteryNotLow(boolean requiresBatteryNotLow) {
              this.mRequiresBatteryNotLow = requiresBatteryNotLow;
              return this;
          }
  
          public Builder setRequiresCharging(boolean requiresCharging) {
              this.mRequiresCharging = requiresCharging;
              return this;
          }
  
          public Builder setRequiresDeviceIdle(boolean requiresDeviceIdle) {
              this.mRequiresDeviceIdle = requiresDeviceIdle;
              return this;
          }
  
          public Builder setRequiresStorageNotLow(boolean requiresStorageNotLow) {
              this.mRequiresStorageNotLow = requiresStorageNotLow;
              return this;
          }
  
          public Builder setTriggerContentMaxDelay(long duration, TimeUnit timeUnit) {
              this.mTriggerContentMaxDelay = timeUnit.toMillis(duration);
              return this;
          }
  
          public Builder setTriggerContentMaxDelay(Duration duration) {
              this.mTriggerContentMaxDelay = duration.toMillis();
              return this;
          }
  
          public Builder setTriggerContentUpdateDelay(long duration, TimeUnit timeUnit) {
              this.mTriggerContentUpdateDelay = timeUnit.toMillis(duration);
              return this;
          }
  
          public Builder setTriggerContentUpdateDelay(Duration duration) {
              this.mTriggerContentUpdateDelay = duration.toMillis();
              return this;
          }
      }
  
      public Constraints() {
      }
  
      Constraints(Builder builder) {
          this.mRequiresCharging = builder.mRequiresCharging;
          this.mRequiresDeviceIdle = Build.VERSION.SDK_INT >= 23 && builder.mRequiresDeviceIdle;
          this.mRequiredNetworkType = builder.mRequiredNetworkType;
          this.mRequiresBatteryNotLow = builder.mRequiresBatteryNotLow;
          this.mRequiresStorageNotLow = builder.mRequiresStorageNotLow;
          if (Build.VERSION.SDK_INT >= 24) {
              this.mContentUriTriggers = builder.mContentUriTriggers;
              this.mTriggerContentUpdateDelay = builder.mTriggerContentUpdateDelay;
              this.mTriggerMaxContentDelay = builder.mTriggerContentMaxDelay;
          }
      }
  
      public Constraints(Constraints other) {
          this.mRequiresCharging = other.mRequiresCharging;
          this.mRequiresDeviceIdle = other.mRequiresDeviceIdle;
          this.mRequiredNetworkType = other.mRequiredNetworkType;
          this.mRequiresBatteryNotLow = other.mRequiresBatteryNotLow;
          this.mRequiresStorageNotLow = other.mRequiresStorageNotLow;
          this.mContentUriTriggers = other.mContentUriTriggers;
      }
  
      public boolean equals(Object o) {
          if (this == o) {
              return true;
          }
          if (o == null || getClass() != o.getClass()) {
              return false;
          }
          Constraints constraints = (Constraints) o;
          if (this.mRequiresCharging == constraints.mRequiresCharging && this.mRequiresDeviceIdle == constraints.mRequiresDeviceIdle && this.mRequiresBatteryNotLow == constraints.mRequiresBatteryNotLow && this.mRequiresStorageNotLow == constraints.mRequiresStorageNotLow && this.mTriggerContentUpdateDelay == constraints.mTriggerContentUpdateDelay && this.mTriggerMaxContentDelay == constraints.mTriggerMaxContentDelay && this.mRequiredNetworkType == constraints.mRequiredNetworkType) {
              return this.mContentUriTriggers.equals(constraints.mContentUriTriggers);
          }
          return false;
      }
  
      public ContentUriTriggers getContentUriTriggers() {
          return this.mContentUriTriggers;
      }
  
      public NetworkType getRequiredNetworkType() {
          return this.mRequiredNetworkType;
      }
  
      public long getTriggerContentUpdateDelay() {
          return this.mTriggerContentUpdateDelay;
      }
  
      public long getTriggerMaxContentDelay() {
          return this.mTriggerMaxContentDelay;
      }
  
      public boolean hasContentUriTriggers() {
          return this.mContentUriTriggers.size() > 0;
      }
  
      public int hashCode() {
          long j = this.mTriggerContentUpdateDelay;
          long j2 = this.mTriggerMaxContentDelay;
          return (((((((((((((this.mRequiredNetworkType.hashCode() * 31) + (this.mRequiresCharging ? 1 : 0)) * 31) + (this.mRequiresDeviceIdle ? 1 : 0)) * 31) + (this.mRequiresBatteryNotLow ? 1 : 0)) * 31) + (this.mRequiresStorageNotLow ? 1 : 0)) * 31) + ((int) (j ^ (j >>> 32)))) * 31) + ((int) (j2 ^ (j2 >>> 32)))) * 31) + this.mContentUriTriggers.hashCode();
      }
  
      public boolean requiresBatteryNotLow() {
          return this.mRequiresBatteryNotLow;
      }
  
      public boolean requiresCharging() {
          return this.mRequiresCharging;
      }
  
      public boolean requiresDeviceIdle() {
          return this.mRequiresDeviceIdle;
      }
  
      public boolean requiresStorageNotLow() {
          return this.mRequiresStorageNotLow;
      }
  
      public void setContentUriTriggers(ContentUriTriggers mContentUriTriggers2) {
          this.mContentUriTriggers = mContentUriTriggers2;
      }
  
      public void setRequiredNetworkType(NetworkType requiredNetworkType) {
          this.mRequiredNetworkType = requiredNetworkType;
      }
  
      public void setRequiresBatteryNotLow(boolean requiresBatteryNotLow) {
          this.mRequiresBatteryNotLow = requiresBatteryNotLow;
      }
  
      public void setRequiresCharging(boolean requiresCharging) {
          this.mRequiresCharging = requiresCharging;
      }
  
      public void setRequiresDeviceIdle(boolean requiresDeviceIdle) {
          this.mRequiresDeviceIdle = requiresDeviceIdle;
      }
  
      public void setRequiresStorageNotLow(boolean requiresStorageNotLow) {
          this.mRequiresStorageNotLow = requiresStorageNotLow;
      }
  
      public void setTriggerContentUpdateDelay(long triggerContentUpdateDelay) {
          this.mTriggerContentUpdateDelay = triggerContentUpdateDelay;
      }
  
      public void setTriggerMaxContentDelay(long triggerMaxContentDelay) {
          this.mTriggerMaxContentDelay = triggerMaxContentDelay;
      }
  }
  