summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/search
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/search')
-rw-r--r--src/com/android/settings/search/Index.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java
index 1a6bfb9..6ac5196 100644
--- a/src/com/android/settings/search/Index.java
+++ b/src/com/android/settings/search/Index.java
@@ -96,7 +96,7 @@ public class Index {
private static Index sInstance;
private final AtomicBoolean mIsAvailable = new AtomicBoolean(false);
private final UpdateData mDataToProcess = new UpdateData();
- private final Context mContext;
+ private Context mContext;
/**
* A private class to describe the update data for the Index database
@@ -124,6 +124,8 @@ public class Index {
public static Index getInstance(Context context) {
if (sInstance == null) {
sInstance = new Index(context);
+ } else {
+ sInstance.setContext(context);
}
return sInstance;
}
@@ -132,6 +134,10 @@ public class Index {
mContext = context;
}
+ public void setContext(Context context) {
+ mContext = context;
+ }
+
public boolean isAvailable() {
return mIsAvailable.get();
}
@@ -675,6 +681,17 @@ public class Index {
return (data != null) ? data.toString() : null;
}
+ private int getResId(Context context, AttributeSet set, int[] attrs, int resId) {
+ final TypedArray sa = context.obtainStyledAttributes(set, attrs);
+ final TypedValue tv = sa.peekValue(resId);
+
+ if (tv != null && tv.type == TypedValue.TYPE_STRING) {
+ return tv.resourceId;
+ } else {
+ return 0;
+ }
+ }
+
/**
* A private class for updating the Index database
*/