|
@@ -29,7 +29,7 @@ import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
public class DataManager extends Application {
|
|
|
- public String TAG = "losion :" + getClass().getSimpleName();
|
|
|
+ private static String TAG = "losion :" + "DataManager";
|
|
|
public static Context sContext;
|
|
|
private static int mFaceIndex = 0;
|
|
|
private static int mAppNameType = 0; //是否显示 app 名称
|
|
@@ -284,11 +284,13 @@ public class DataManager extends Application {
|
|
|
|
|
|
public static int getWarningStatus() {
|
|
|
if (isSupportESIM()) {
|
|
|
+ Log.d(TAG, "getWarningStatus: esim");
|
|
|
if (isESimUnactivated())
|
|
|
return 2;
|
|
|
else if (isWatchActivated() <= 0)
|
|
|
return 1;
|
|
|
} else {
|
|
|
+ Log.d(TAG, "getWarningStatus: sim");
|
|
|
if (isSimAbsent())
|
|
|
return 10;
|
|
|
if (isSimUnactivated())
|
|
@@ -305,6 +307,7 @@ public class DataManager extends Application {
|
|
|
public static boolean isSimAbsent() {
|
|
|
TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
int status = tm.getSimState();
|
|
|
+ Log.d(TAG, "isSimAbsent: " + status);
|
|
|
return status == TelephonyManager.SIM_STATE_ABSENT;
|
|
|
}
|
|
|
|
|
@@ -312,6 +315,7 @@ public class DataManager extends Application {
|
|
|
public static boolean isSimUnactivated() {
|
|
|
TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//未知状态
|
|
|
int status = tm.getSimState();
|
|
|
+ Log.d(TAG, "isSimUnactivated: " + status);
|
|
|
return status == TelephonyManager.SIM_STATE_UNKNOWN;
|
|
|
}
|
|
|
|
|
@@ -324,6 +328,7 @@ public class DataManager extends Application {
|
|
|
public static boolean isSimLocked() {
|
|
|
TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
int status = tm.getSimState();
|
|
|
+ Log.d(TAG, "isSimLocked: " + status);
|
|
|
return status == TelephonyManager.SIM_STATE_NETWORK_LOCKED;
|
|
|
}
|
|
|
|
|
@@ -331,6 +336,7 @@ public class DataManager extends Application {
|
|
|
public static boolean isPinRequired() {
|
|
|
TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
int status = tm.getSimState();
|
|
|
+ Log.d(TAG, "isPinRequired: " + status);
|
|
|
return status == TelephonyManager.SIM_STATE_PIN_REQUIRED;
|
|
|
}
|
|
|
|
|
@@ -338,6 +344,7 @@ public class DataManager extends Application {
|
|
|
public static boolean isPukRequired() {
|
|
|
TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
int status = tm.getSimState();
|
|
|
+ Log.d(TAG, "isPukRequired: " + status);
|
|
|
return status == TelephonyManager.SIM_STATE_PUK_REQUIRED;
|
|
|
}
|
|
|
|
|
@@ -361,17 +368,23 @@ public class DataManager extends Application {
|
|
|
|
|
|
//是否 watch 激活
|
|
|
public static int isWatchActivated() {
|
|
|
- return Settings.Global.getInt(sContext.getContentResolver(), MetaData.KEY_WATCH_ACTIVATED, 0);
|
|
|
+ int isActivated = Settings.Global.getInt(sContext.getContentResolver(), MetaData.KEY_WATCH_ACTIVATED, 0);
|
|
|
+ Log.d(TAG, "isWatchActivated: " + isActivated);
|
|
|
+ return isActivated;
|
|
|
}
|
|
|
|
|
|
//true:ESIM false:nano sim
|
|
|
public static boolean isSupportESIM() {
|
|
|
- return SystemProperties.getBoolean("ro.product.support.esim", false);
|
|
|
+ boolean isEsim = SystemProperties.getBoolean("ro.product.support.esim", false);
|
|
|
+ Log.d(TAG, "isSupportESIM: " + isEsim);
|
|
|
+ return isEsim;
|
|
|
}
|
|
|
|
|
|
public static boolean isFactoryMode() {
|
|
|
//是否为产线模式
|
|
|
- return SystemProperties.getBoolean("persist.sys.factoryimage", false);
|
|
|
+ boolean isFactory = SystemProperties.getBoolean("persist.sys.factoryimage", false);
|
|
|
+ Log.d(TAG, "isFactoryMode: " + isFactory);
|
|
|
+ return isFactory;
|
|
|
}
|
|
|
|
|
|
public static boolean getIsAppNeedActivated(AppModel appModel) {
|