public final class

UsageTrackerRegistry

extends java.lang.Object

 java.lang.Object

↳androidx.test.internal.runner.tracker.UsageTrackerRegistry

Gradle dependencies

compile group: 'androidx.test', name: 'runner', version: '1.5.0-alpha03'

  • groupId: androidx.test
  • artifactId: runner
  • version: 1.5.0-alpha03

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

Androidx artifact mapping:

androidx.test:runner com.android.support.test:runner

Overview

A registry to hold the global UsageTracker.

Instrumentation will configure this registry at startup.

Summary

Methods
public static UsageTrackergetInstance()

public static voidregisterInstance(UsageTracker tracker)

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

Methods

public static void registerInstance(UsageTracker tracker)

public static UsageTracker getInstance()

Source

/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.test.internal.runner.tracker;

import static androidx.test.internal.util.Checks.checkNotNull;

/**
 * A registry to hold the global {@link UsageTracker}.
 *
 * <p>Instrumentation will configure this registry at startup.
 *
 * @deprecated obsolete
 */
@Deprecated
public final class UsageTrackerRegistry {

  /**
   * Contains versions for AXT libraries
   *
   * @deprecated obsolete
   */
  @Deprecated
  public interface AxtVersions {
    // Espresso version includes: Espresso, Espresso-Web, Intents, Espresso-MPE
    String ESPRESSO_VERSION = "na";
    // Runner version includes: Runner
    String RUNNER_VERSION = "na";
    // Test services version.
    String SERVICES_VERSION = "na";
  }

  // By default we use a NoOp class.
  private static volatile UsageTracker instance = new UsageTracker.NoOpUsageTracker();

  public static void registerInstance(UsageTracker tracker) {
    instance = checkNotNull(tracker);
  }

  public static UsageTracker getInstance() {
    return instance;
  }

  private UsageTrackerRegistry() {}
}