Example usage for android.test RenamingDelegatingContext makeExistingFilesAndDbsAccessible

List of usage examples for android.test RenamingDelegatingContext makeExistingFilesAndDbsAccessible

Introduction

In this page you can find the example usage for android.test RenamingDelegatingContext makeExistingFilesAndDbsAccessible.

Prototype

public void makeExistingFilesAndDbsAccessible() 

Source Link

Document

Makes accessible all files and databases whose names match the filePrefix that was passed to the constructor.

Usage

From source file:com.google.android.apps.authenticator.testability.DependencyInjector.java

/**
 * Clears any state and configures this injector to provide objects that are suitable for
 * integration testing.//  w  w w.ja  v  a 2 s. c  o  m
 */
// @VisibleForTesting
public static synchronized void resetForIntegrationTesting(Context context) {
    if (context == null) {
        throw new NullPointerException("context == null");
    }

    close();

    sMode = Mode.INTEGRATION_TEST;
    RenamingDelegatingContext renamingContext = new RenamingDelegatingContext(context, "test_");
    renamingContext.makeExistingFilesAndDbsAccessible();
    sContext = new SharedPreferencesRenamingDelegatingContext(renamingContext, "test_");
    PreferenceManager.getDefaultSharedPreferences(sContext).edit().clear().commit();
}