Merge "Handle SubSettings instance leaks in Index.java" am: 527b2b220a
am: bf4a67ec0f
am: 28688c3ba3
am: 802b2f8561
Change-Id: I3bab1fcdd3ce7de7cbc6015011ec12a86ab76dca
This commit is contained in:
@@ -217,20 +217,20 @@ public class Index {
|
|||||||
*/
|
*/
|
||||||
public static Index getInstance(Context context) {
|
public static Index getInstance(Context context) {
|
||||||
if (sInstance == null) {
|
if (sInstance == null) {
|
||||||
sInstance = new Index(context.getApplicationContext(), BASE_AUTHORITY);
|
synchronized (Index.class) {
|
||||||
|
if (sInstance == null) {
|
||||||
|
sInstance = new Index(context.getApplicationContext(), BASE_AUTHORITY);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Index(Context context, String baseAuthority) {
|
private Index(Context context, String baseAuthority) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBaseAuthority = baseAuthority;
|
mBaseAuthority = baseAuthority;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setContext(Context context) {
|
|
||||||
mContext = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAvailable() {
|
public boolean isAvailable() {
|
||||||
return mIsAvailable.get();
|
return mIsAvailable.get();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user