what-the-bank/sources/com/huawei/hms/framework/common/ContextHolder.java

39 lines
1021 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.framework.common;
import android.content.Context;
/* loaded from: classes2.dex */
public class ContextHolder {
private static final String TAG = "ContextHolder";
private static Context sAppContext;
private static Context sKitContext;
public static Context getResourceContext() {
if (getKitContext() != null) {
return getKitContext();
}
return getAppContext();
}
public static void setAppContext(Context context) {
if (sAppContext != null) {
return;
}
CheckParamUtils.checkNotNull(context, "sAppContext == null");
sAppContext = context.getApplicationContext();
}
public static void setKitContext(Context context) {
CheckParamUtils.checkNotNull(context, "sKitContext == null");
sKitContext = context;
}
public static Context getKitContext() {
return sKitContext;
}
public static Context getAppContext() {
return sAppContext;
}
}