/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

package com.facebook.fresco.vito.core;

import com.facebook.common.internal.Supplier;
import com.facebook.common.internal.Suppliers;
import com.facebook.infer.annotation.Nullsafe;

@Nullsafe(Nullsafe.Mode.STRICT)
public class DefaultFrescoVitoConfig implements FrescoVitoConfig {

  private final PrefetchConfig mPrefetchConfig = new DefaultPrefetchConfig();

  @Override
  public PrefetchConfig getPrefetchConfig() {
    return mPrefetchConfig;
  }

  @Override
  public boolean submitFetchOnBgThread() {
    return true;
  }

  @Override
  public boolean useBindOnly() {
    return false;
  }

  @Override
  public boolean useNewReleaseCallback() {
    return false;
  }

  @Override
  public Supplier<Boolean> useNativeRounding() {
    return Suppliers.BOOLEAN_TRUE;
  }

  public static class DefaultPrefetchConfig implements PrefetchConfig {
    @Override
    public boolean prefetchInOnPrepare() {
      return true;
    }

    @Override
    public PrefetchTarget prefetchTargetOnPrepare() {
      return PrefetchTarget.MEMORY_DECODED;
    }

    @Override
    public boolean cancelOnPreparePrefetchWhenWorkingRangePrefetch() {
      return true;
    }

    @Override
    public boolean cancelPrefetchWhenFetched() {
      return true;
    }

    @Override
    public boolean prefetchWithWorkingRange() {
      return true;
    }

    @Override
    public int prefetchWorkingRangeSize() {
      return 3;
    }

    @Override
    public PrefetchTarget prefetchTargetWorkingRange() {
      return PrefetchTarget.MEMORY_DECODED;
    }
  }
}

@@ -361,16 +361,65 @@
 ullsafe;
+%0Aimport com.facebook.infer.annotation.OkToExtend;
 %0A%0A@Nulls
@@ -444,16 +444,28 @@
 STRICT)%0A
+@OkToExtend%0A
 public c

Mark DefaultFrescoVitoConfig as @OkToExtend