All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.shadows.ShadowRollbackManager Maven / Gradle / Ivy

package org.robolectric.shadows;

import static android.os.Build.VERSION_CODES.Q;

import android.content.rollback.RollbackInfo;
import java.util.ArrayList;
import java.util.List;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

/** A Shadow for android.content.rollback.RollbackManager added in Android Q. */
@Implements(
    className = "android.content.rollback.RollbackManager",
    minSdk = Q,
    isInAndroidSdk = false)
public final class ShadowRollbackManager {

  private final List availableRollbacks = new ArrayList<>();
  private final List recentlyCommittedRollbacks = new ArrayList<>();

  public void addAvailableRollbacks(RollbackInfo rollbackInfo) {
    availableRollbacks.add(rollbackInfo);
  }

  public void addRecentlyCommittedRollbacks(RollbackInfo rollbackInfo) {
    recentlyCommittedRollbacks.add(rollbackInfo);
  }

  @Implementation
  protected List getAvailableRollbacks() {
    return availableRollbacks;
  }

  @Implementation
  protected List getRecentlyCommittedRollbacks() {
    return recentlyCommittedRollbacks;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy