|
@@ -8,6 +8,7 @@ import android.content.pm.ResolveInfo;
|
|
|
import android.database.ContentObserver;
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
import android.os.Handler;
|
|
|
+import android.telephony.TelephonyManager;
|
|
|
|
|
|
import com.xplora.xplauncher.R;
|
|
|
import com.xplora.xplauncher.activity.BaseActivity;
|
|
@@ -224,6 +225,41 @@ public class DataManager extends Application {
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ //是否有 sim 卡
|
|
|
+ public static boolean isSimAbsent() {
|
|
|
+ TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
+ int status = tm.getSimState();
|
|
|
+ return status == TelephonyManager.SIM_STATE_ABSENT;
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否 sim 未知状态
|
|
|
+ public static boolean isSimUnknow() {
|
|
|
+ TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//未知状态
|
|
|
+ int status = tm.getSimState();
|
|
|
+ return status == TelephonyManager.SIM_STATE_UNKNOWN;
|
|
|
+ }
|
|
|
+
|
|
|
+ //需要NetworkPIN解锁
|
|
|
+ public static boolean isSimLocked() {
|
|
|
+ TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
+ int status = tm.getSimState();
|
|
|
+ return status == TelephonyManager.SIM_STATE_NETWORK_LOCKED;
|
|
|
+ }
|
|
|
+
|
|
|
+ //需要PIN解锁
|
|
|
+ public static boolean isPinRequired() {
|
|
|
+ TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
+ int status = tm.getSimState();
|
|
|
+ return status == TelephonyManager.SIM_STATE_PIN_REQUIRED;
|
|
|
+ }
|
|
|
+
|
|
|
+ //需要PUK解锁
|
|
|
+ public static boolean isPukRequired() {
|
|
|
+ TelephonyManager tm = (TelephonyManager)sContext.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务
|
|
|
+ int status = tm.getSimState();
|
|
|
+ return status == TelephonyManager.SIM_STATE_PUK_REQUIRED;
|
|
|
+ }
|
|
|
+
|
|
|
public static void loadFaceIndex() {
|
|
|
mFaceIndex = 0;
|
|
|
}
|