public class

ActivityLifecycleTimeout

extends java.lang.Object

 java.lang.Object

↳androidx.test.internal.platform.app.ActivityLifecycleTimeout

Gradle dependencies

compile group: 'androidx.test', name: 'orchestrator', version: '1.5.0'

  • groupId: androidx.test
  • artifactId: orchestrator
  • version: 1.5.0

Artifact androidx.test:orchestrator:1.5.0 it located at Google repository (https://maven.google.com/)

Androidx artifact mapping:

androidx.test:orchestrator com.android.support.test:orchestrator

Overview

Timeout for Activity's lifecycle state transitions.

Summary

Constructors
publicActivityLifecycleTimeout()

Methods
public static longgetMillis()

Returns the timeout in millisecond which should be used for waiting for Activity's lifecycle state transitions to be completed.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public ActivityLifecycleTimeout()

Methods

public static long getMillis()

Returns the timeout in millisecond which should be used for waiting for Activity's lifecycle state transitions to be completed.

Source

package androidx.test.internal.platform.app;

import androidx.annotation.RestrictTo;
import androidx.test.internal.platform.util.InstrumentationParameterUtil;

/**
 * Timeout for Activity's lifecycle state transitions.
 *
 * @hide
 */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) // used by core/runner
public class ActivityLifecycleTimeout {

  /** The instrumentation argument key for the activity lifecycle change timeout. */
  private static final String ACTIVITY_LIFECYCLE_CHANGE_TIMEOUT_MILLIS_KEY =
      "activityLifecycleChangeTimeoutMillis";

  /**
   * Default timeout length is 45 seconds. This value is used traditionally and has been chosen
   * heuristically.
   */
  private static final int DEFAULT_ACTIVITY_LIFECYCLE_CHANGE_TIMEOUT_MILLIS = 45000;

  /**
   * Returns the timeout in millisecond which should be used for waiting for Activity's lifecycle
   * state transitions to be completed.
   */
  public static long getMillis() {
    return InstrumentationParameterUtil.getTimeoutMillis(
        ACTIVITY_LIFECYCLE_CHANGE_TIMEOUT_MILLIS_KEY,
        DEFAULT_ACTIVITY_LIFECYCLE_CHANGE_TIMEOUT_MILLIS);
  }
}