Example usage for android.os StrictMode noteSlowCall

List of usage examples for android.os StrictMode noteSlowCall

Introduction

In this page you can find the example usage for android.os StrictMode noteSlowCall.

Prototype

public static void noteSlowCall(String name) 

Source Link

Document

For code to note that it's slow.

Usage

From source file:org.sleepydragon.rgbclient.Settings.java

/**
 * Opens the SharedPreferences in which the settings outlined in this class are stored.
 *
 * @param context the Context object to use to open the SharedPreferences.
 * @return the SharedPreferences; never returns null.
 *///  w  w w.j  a  v  a  2s . c  om
@NonNull
public static SharedPreferences getSharedPreferences(@NonNull Context context) {
    StrictMode.noteSlowCall("opening SharedPreferences potentially performs blocking I/O");
    final Context appContext = context.getApplicationContext();
    return appContext.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);
}