Merge "Handle SubSettings instance leaks in Index.java" am: 527b2b220a

am: bf4a67ec0f

Change-Id: I89d30398cfe13e72ccbcbb92d5d4e0eda5f350ae
This commit is contained in:
gaochong
2016-12-28 18:55:47 +00:00
committed by android-build-merger

View File

@@ -216,21 +216,21 @@ public class Index {
* A basic singleton
*/
public static Index getInstance(Context context) {
if (sInstance == null) {
synchronized (Index.class) {
if (sInstance == null) {
sInstance = new Index(context.getApplicationContext(), BASE_AUTHORITY);
}
}
}
return sInstance;
}
public Index(Context context, String baseAuthority) {
private Index(Context context, String baseAuthority) {
mContext = context;
mBaseAuthority = baseAuthority;
}
public void setContext(Context context) {
mContext = context;
}
public boolean isAvailable() {
return mIsAvailable.get();
}