aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/providers/contacts/FastScrollingIndexCache.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/providers/contacts/FastScrollingIndexCache.java')
-rw-r--r--src/com/android/providers/contacts/FastScrollingIndexCache.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/FastScrollingIndexCache.java b/src/com/android/providers/contacts/FastScrollingIndexCache.java
index 7a5d82da..99da602b 100644
--- a/src/com/android/providers/contacts/FastScrollingIndexCache.java
+++ b/src/com/android/providers/contacts/FastScrollingIndexCache.java
@@ -21,6 +21,7 @@ import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
+import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
@@ -89,8 +90,13 @@ public class FastScrollingIndexCache {
public static FastScrollingIndexCache getInstance(Context context) {
if (sSingleton == null) {
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- sSingleton = new FastScrollingIndexCache(prefs);
+ final StrictMode.ThreadPolicy old = StrictMode.allowThreadDiskReads();
+ try {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ sSingleton = new FastScrollingIndexCache(prefs);
+ } finally {
+ StrictMode.setThreadPolicy(old);
+ }
}
return sSingleton;
}