|
@@ -6,11 +6,19 @@ import static com.app.duck.Config.PHONE_TAG;
|
|
import static com.app.duck.Config.SMS_UPLOAD_TAG;
|
|
import static com.app.duck.Config.SMS_UPLOAD_TAG;
|
|
import static com.app.duck.Config.WEBSOCKET_STATUS_TAG;
|
|
import static com.app.duck.Config.WEBSOCKET_STATUS_TAG;
|
|
|
|
|
|
|
|
+import android.Manifest;
|
|
import android.annotation.SuppressLint;
|
|
import android.annotation.SuppressLint;
|
|
|
|
+import android.app.AlertDialog;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
import android.provider.Settings;
|
|
import android.provider.Settings;
|
|
|
|
+import android.telephony.SubscriptionInfo;
|
|
|
|
+import android.telephony.SubscriptionManager;
|
|
|
|
+import android.telephony.TelephonyManager;
|
|
|
|
+import android.text.InputType;
|
|
|
|
+import android.text.TextUtils;
|
|
|
|
+import android.util.Log;
|
|
import android.view.Menu;
|
|
import android.view.Menu;
|
|
import android.view.MenuItem;
|
|
import android.view.MenuItem;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -22,25 +30,42 @@ import androidx.navigation.NavController;
|
|
import androidx.navigation.Navigation;
|
|
import androidx.navigation.Navigation;
|
|
import androidx.navigation.ui.AppBarConfiguration;
|
|
import androidx.navigation.ui.AppBarConfiguration;
|
|
import androidx.navigation.ui.NavigationUI;
|
|
import androidx.navigation.ui.NavigationUI;
|
|
|
|
+import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
+import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
|
|
+import com.afollestad.materialdialogs.MaterialDialog;
|
|
import com.app.duck.BaseActivity;
|
|
import com.app.duck.BaseActivity;
|
|
import com.app.duck.BuildConfig;
|
|
import com.app.duck.BuildConfig;
|
|
import com.app.duck.R;
|
|
import com.app.duck.R;
|
|
|
|
+import com.app.duck.adapter.PhoneListAdapter2;
|
|
import com.app.duck.database.Config;
|
|
import com.app.duck.database.Config;
|
|
import com.app.duck.databinding.ActivityMainBinding;
|
|
import com.app.duck.databinding.ActivityMainBinding;
|
|
-import com.app.duck.dialog.DialogManager;
|
|
|
|
import com.app.duck.util.CheckInboxWorker;
|
|
import com.app.duck.util.CheckInboxWorker;
|
|
import com.app.duck.util.HeartbeatWorker;
|
|
import com.app.duck.util.HeartbeatWorker;
|
|
import com.app.duck.util.HxUtils;
|
|
import com.app.duck.util.HxUtils;
|
|
import com.app.duck.util.TgBot;
|
|
import com.app.duck.util.TgBot;
|
|
import com.app.duck.util.WsManager;
|
|
import com.app.duck.util.WsManager;
|
|
|
|
+import com.blankj.utilcode.util.ActivityUtils;
|
|
import com.blankj.utilcode.util.AppUtils;
|
|
import com.blankj.utilcode.util.AppUtils;
|
|
import com.blankj.utilcode.util.LanguageUtils;
|
|
import com.blankj.utilcode.util.LanguageUtils;
|
|
|
|
+import com.blankj.utilcode.util.ObjectUtils;
|
|
|
|
+import com.blankj.utilcode.util.PermissionUtils;
|
|
|
|
+import com.blankj.utilcode.util.StringUtils;
|
|
|
|
+import com.blankj.utilcode.util.ThreadUtils;
|
|
|
|
+import com.blankj.utilcode.util.TimeUtils;
|
|
|
|
+import com.blankj.utilcode.util.ToastUtils;
|
|
|
|
+import com.elvishew.xlog.XLog;
|
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
|
import com.google.android.material.navigation.NavigationView;
|
|
import com.google.android.material.navigation.NavigationView;
|
|
|
|
+import com.google.gson.JsonArray;
|
|
|
|
+import com.google.gson.JsonObject;
|
|
import com.jeremyliao.liveeventbus.LiveEventBus;
|
|
import com.jeremyliao.liveeventbus.LiveEventBus;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
import java.util.Locale;
|
|
import java.util.Locale;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
public class MainActivity extends BaseActivity<ActivityMainBinding> implements NavigationView.OnNavigationItemSelectedListener {
|
|
public class MainActivity extends BaseActivity<ActivityMainBinding> implements NavigationView.OnNavigationItemSelectedListener {
|
|
|
|
|
|
@@ -71,9 +96,9 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
|
|
View headerView = b.navView.getHeaderView(0);
|
|
View headerView = b.navView.getHeaderView(0);
|
|
TextView codeTv = headerView.findViewById(R.id.versionCodeTv);
|
|
TextView codeTv = headerView.findViewById(R.id.versionCodeTv);
|
|
codeTv.setText(AppUtils.getAppVersionName() + " - " + AppUtils.getAppVersionCode());
|
|
codeTv.setText(AppUtils.getAppVersionName() + " - " + AppUtils.getAppVersionCode());
|
|
- b.appBarMain.contentMain.phoneTv.setOnClickListener(view -> {
|
|
|
|
- DialogManager.phoneEditDialog();
|
|
|
|
- });
|
|
|
|
|
|
+// b.appBarMain.contentMain.phoneTv.setOnClickListener(view -> {
|
|
|
|
+// DialogManager.phoneEditDialog();
|
|
|
|
+// });
|
|
|
|
|
|
b.appBarMain.contentMain.workTv.setSelected(true);
|
|
b.appBarMain.contentMain.workTv.setSelected(true);
|
|
b.appBarMain.contentMain.workTv2.setSelected(true);
|
|
b.appBarMain.contentMain.workTv2.setSelected(true);
|
|
@@ -101,7 +126,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
|
|
|
|
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
|
-
|
|
|
|
|
|
+ HxUtils.setCurrentPhoneList();
|
|
|
|
+ initPhoneConfig();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -144,6 +170,47 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
|
|
case R.id.action_update_log_config:
|
|
case R.id.action_update_log_config:
|
|
HxUtils.checkForUpdateBotConfig();
|
|
HxUtils.checkForUpdateBotConfig();
|
|
break;
|
|
break;
|
|
|
|
+ case R.id.action_id_index:
|
|
|
|
+ AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
|
|
|
+ alertDialogBuilder.setTitle(R.string.dialogConfirmTitle);
|
|
|
|
+
|
|
|
|
+ JsonArray jsonArray = HxUtils.getCurrentPhoneList();
|
|
|
|
+ StringBuilder showStr = new StringBuilder();
|
|
|
|
+ if (jsonArray != null && jsonArray.size() > 0) {
|
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
+ JsonObject item1 = jsonArray.get(i).getAsJsonObject();
|
|
|
|
+
|
|
|
|
+ int id = item1.get("SubscriptionId").getAsInt();
|
|
|
|
+ int index = item1.get("SimSlotIndex").getAsInt();
|
|
|
|
+ String iccID = item1.get("iccID").getAsString();
|
|
|
|
+ String Number2 = item1.get("Number").getAsString();
|
|
|
|
+ String disname = item1.get("disname").getAsString();
|
|
|
|
+ String Number = HxUtils.getRecord(id);
|
|
|
|
+ showStr.append("No." + (i + 1));
|
|
|
|
+ showStr.append("/ " + iccID);
|
|
|
|
+ showStr.append("/ " + disname);
|
|
|
|
+ showStr.append("\n");
|
|
|
|
+ showStr.append("SubscriptionId : " + id);
|
|
|
|
+ showStr.append("\n");
|
|
|
|
+ showStr.append("SimSlotIndex : " + index);
|
|
|
|
+ showStr.append("\n");
|
|
|
|
+ showStr.append("Number : " + Number);
|
|
|
|
+ showStr.append("\n");
|
|
|
|
+ showStr.append("Reference : " + Number2);
|
|
|
|
+ showStr.append("\n");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ showStr.append("UNKNOWN");
|
|
|
|
+ }
|
|
|
|
+ alertDialogBuilder.setMessage(showStr.toString());
|
|
|
|
+ alertDialogBuilder.setCancelable(false);
|
|
|
|
+ alertDialogBuilder.setPositiveButton(R.string.ok, (dialog, id) -> dialog.dismiss());
|
|
|
|
+ AlertDialog alertDialog = alertDialogBuilder.create();
|
|
|
|
+ if (alertDialog != null) {
|
|
|
|
+ alertDialog.show();
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
return super.onOptionsItemSelected(item);
|
|
return super.onOptionsItemSelected(item);
|
|
}
|
|
}
|
|
@@ -192,4 +259,220 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ private PhoneListAdapter2 phoneListAdapter;
|
|
|
|
+ private SubscriptionManager subscriptionManager;
|
|
|
|
+
|
|
|
|
+ private void initPhoneConfig() {
|
|
|
|
+ if (!PermissionUtils.isGranted(Manifest.permission.READ_PHONE_STATE)) {
|
|
|
|
+ ToastUtils.showShort(R.string.read_phone_state_sim);
|
|
|
|
+ ThreadUtils.runOnUiThreadDelayed(this::initPhoneConfig, 3000);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
|
|
|
+ SimCardStateListener();
|
|
|
|
+ subscriptionManager = (SubscriptionManager) getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
|
|
|
+
|
|
|
|
+ @SuppressLint("MissingPermission") List<SubscriptionInfo> subsInfoList = subscriptionManager.getActiveSubscriptionInfoList();
|
|
|
|
+ List<HashMap<String, String>> mList = new ArrayList<>();
|
|
|
|
+ if (subsInfoList != null) {
|
|
|
|
+ for (SubscriptionInfo subscriptionInfo : subsInfoList) {
|
|
|
|
+ HashMap<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("SimSlot", subscriptionInfo.getSimSlotIndex() + "");
|
|
|
|
+ map.put("SubId", subscriptionInfo.getSubscriptionId() + "");
|
|
|
|
+ map.put("Number", HxUtils.getRecord(subscriptionInfo.getSubscriptionId()));
|
|
|
|
+ map.put("disname", subscriptionInfo.getDisplayName() == null ? "UNKNOWN" : subscriptionInfo.getDisplayName().toString());
|
|
|
|
+ map.put("Number2", subscriptionInfo.getNumber() == null ? "UNKNOWN" : subscriptionInfo.getNumber());//如果有
|
|
|
|
+ mList.add(map);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ XLog.w("setRecord -> subsInfoList == null");
|
|
|
|
+ Log.w("hzshkj", "setRecord: subsInfoList == null");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ phoneListAdapter = new PhoneListAdapter2();
|
|
|
|
+ phoneListAdapter.addChildClickViewIds(R.id.iv_delete);
|
|
|
|
+ phoneListAdapter.setOnItemChildClickListener((adapter, view, position) -> {
|
|
|
|
+ if (view.getId() == R.id.iv_delete) {
|
|
|
|
+ new MaterialDialog.Builder(ActivityUtils.getTopActivity())
|
|
|
|
+ .title("SIM-" + phoneListAdapter.getData().get(position).get("SimSlot") + "-" + StringUtils.getString(R.string.phone_number))
|
|
|
|
+ .content("Card Slot : " + phoneListAdapter.getData().get(position).get("SimSlot") +
|
|
|
|
+ "\n" +
|
|
|
|
+ "Reference Mobile Number : " + phoneListAdapter.getData().get(position).get("Number2") +
|
|
|
|
+ "\n" +
|
|
|
|
+ "Display Name : " + phoneListAdapter.getData().get(position).get("disname")
|
|
|
|
+ )
|
|
|
|
+ .canceledOnTouchOutside(false)
|
|
|
|
+ .autoDismiss(false)
|
|
|
|
+ .negativeText(R.string.cancel)
|
|
|
|
+ .positiveText(R.string.done)
|
|
|
|
+
|
|
|
|
+ .onNegative((dialog, which) -> dialog.dismiss())
|
|
|
|
+ .onPositive((dialog, which) -> dialog.dismiss())
|
|
|
|
+ .input(StringUtils.getString(R.string.set_the_number), TextUtils.isEmpty(phoneListAdapter.getData().get(position).get("Number")) ? "" : phoneListAdapter.getData().get(position).get("Number"), false, (dialog, input) ->
|
|
|
|
+ {
|
|
|
|
+ if (!StringUtils.isEmpty(input)) {
|
|
|
|
+ if (HxUtils.setRecord(phoneListAdapter.getItem(position).get("SubId"), input.toString()) == null) {
|
|
|
|
+ phoneListAdapter.getItem(position).put("Number", input.toString());
|
|
|
|
+ phoneListAdapter.notifyItemChanged(position);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ HxUtils.setPhone(toPhoneUri());
|
|
|
|
+ LiveEventBus.get(PHONE_TAG).post(toPhoneUri());
|
|
|
|
+ dialog.dismiss();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .inputType(InputType.TYPE_CLASS_PHONE) // 设置输入类型为电话号码
|
|
|
|
+ .show();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ b.appBarMain.contentMain.rv.setAdapter(phoneListAdapter);
|
|
|
|
+ phoneListAdapter.setList(mList);
|
|
|
|
+ b.appBarMain.contentMain.rv.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private String toPhoneUri() {
|
|
|
|
+ StringBuilder data = new StringBuilder();
|
|
|
|
+ for (int i = 0; i < phoneListAdapter.getData().size(); i++) {
|
|
|
|
+ String a = "";
|
|
|
|
+ if (i == 0) {
|
|
|
|
+ if (!StringUtils.isTrimEmpty(phoneListAdapter.getData().get(i).get("SubId")) && !StringUtils.isTrimEmpty(phoneListAdapter.getData().get(i).get("Number")))
|
|
|
|
+ a = phoneListAdapter.getData().get(i).get("SubId") + "-" + phoneListAdapter.getData().get(i).get("Number");
|
|
|
|
+ } else {
|
|
|
|
+ if (!StringUtils.isTrimEmpty(phoneListAdapter.getData().get(i).get("SubId")) && !StringUtils.isTrimEmpty(phoneListAdapter.getData().get(i).get("Number")))
|
|
|
|
+ a = "_" + phoneListAdapter.getData().get(i).get("SubId") + "-" + phoneListAdapter.getData().get(i).get("Number");
|
|
|
|
+ }
|
|
|
|
+ data.append(a);
|
|
|
|
+ }
|
|
|
|
+ return data.toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private TelephonyManager telephonyManager;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void setMsg(String msg) {
|
|
|
|
+ b.appBarMain.contentMain.textView2.setVisibility(View.VISIBLE);
|
|
|
|
+
|
|
|
|
+ b.appBarMain.contentMain.textView2.setText(msg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void hideMsg() {
|
|
|
|
+ b.appBarMain.contentMain.textView2.setVisibility(View.GONE);
|
|
|
|
+
|
|
|
|
+ b.appBarMain.contentMain.textView2.setText("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void SimCardStateListener() {
|
|
|
|
+
|
|
|
|
+ ThreadUtils.executeBySingleAtFixRate(new ThreadUtils.Task<String>() {
|
|
|
|
+ @Override
|
|
|
|
+ public String doInBackground() {
|
|
|
|
+ return getSimCardState();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @SuppressLint("SetTextI18n")
|
|
|
|
+ @Override
|
|
|
|
+ public void onSuccess(String result) {
|
|
|
|
+
|
|
|
|
+ if (result.equals("Absent")) {
|
|
|
|
+ setMsg("Current sim card status : Absent");
|
|
|
|
+ List<HashMap<String, String>> list2 = new ArrayList<>();
|
|
|
|
+ Log.d("hzshkj", "检测到sim卡被拔出");
|
|
|
|
+ XLog.d("检测到sim卡被拔出");
|
|
|
|
+ ToastUtils.showLong(R.string.sim);
|
|
|
|
+ HxUtils.setPhone("");
|
|
|
|
+ LiveEventBus.get(PHONE_TAG).post("");
|
|
|
|
+ if (!ObjectUtils.equals(list2, phoneListAdapter.getData())) {
|
|
|
|
+ for (int i = 0; i < phoneListAdapter.getData().size(); i++) {
|
|
|
|
+ phoneListAdapter.getItem(i).put("Number", "UNKNOWN");
|
|
|
|
+ phoneListAdapter.getItem(i).put("SubId", "UNKNOWN");
|
|
|
|
+ phoneListAdapter.getItem(i).put("SimSlot", "UNKNOWN");
|
|
|
|
+ phoneListAdapter.getItem(i).put("disname", "UNKNOWN");
|
|
|
|
+ phoneListAdapter.getItem(i).put("Number2", "UNKNOWN");
|
|
|
|
+ phoneListAdapter.notifyItemChanged(i);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if (result.equals("Ready")) {
|
|
|
|
+ hideMsg();
|
|
|
|
+ Log.d("hzshkj", "检测到sim卡被插入");
|
|
|
|
+ XLog.d("检测到sim卡被插入");
|
|
|
|
+ @SuppressLint("MissingPermission") List<SubscriptionInfo> subsInfoList = subscriptionManager.getActiveSubscriptionInfoList();
|
|
|
|
+ List<HashMap<String, String>> list = new ArrayList<>();
|
|
|
|
+ if (subsInfoList != null) {
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
+ for (SubscriptionInfo subscriptionInfo : subsInfoList) {
|
|
|
|
+ HashMap<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("SimSlot", subscriptionInfo.getSimSlotIndex() + "");
|
|
|
|
+ map.put("SubId", subscriptionInfo.getSubscriptionId() + "");
|
|
|
|
+ map.put("Number", HxUtils.getRecord(subscriptionInfo.getSubscriptionId()));
|
|
|
|
+ map.put("disname", subscriptionInfo.getDisplayName() == null ? "UNKNOWN" : subscriptionInfo.getDisplayName().toString());
|
|
|
|
+ map.put("Number2", subscriptionInfo.getNumber() == null ? "UNKNOWN" : subscriptionInfo.getNumber());//如果有
|
|
|
|
+ list.add(map);
|
|
|
|
+ if (StringUtils.isTrimEmpty(HxUtils.getRecord(subscriptionInfo.getSubscriptionId()))) {
|
|
|
|
+ sb.append(StringUtils.getString(R.string.please_set_the_number_for_the_sim_card, subscriptionInfo.getSimSlotIndex(), subscriptionInfo.getDisplayName() == null ? "UNKNOWN" : subscriptionInfo.getDisplayName().toString()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!StringUtils.isEmpty(sb))
|
|
|
|
+ setMsg(sb.toString());
|
|
|
|
+ else
|
|
|
|
+ hideMsg();
|
|
|
|
+ } else {
|
|
|
|
+ XLog.w("setRecord -> subsInfoList == null");
|
|
|
|
+ Log.w("hzshkj", "setRecord: subsInfoList == null");
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.equals(list, phoneListAdapter.getData())) {
|
|
|
|
+ phoneListAdapter.setList(list);
|
|
|
|
+ HxUtils.setPhone(toPhoneUri());
|
|
|
|
+ LiveEventBus.get(PHONE_TAG).post(toPhoneUri());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onFail(Throwable t) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onCancel() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }, 2000, 2000, TimeUnit.MILLISECONDS);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private String getSimCardState() {
|
|
|
|
+ int simState = telephonyManager.getSimState();
|
|
|
|
+ switch (simState) {
|
|
|
|
+ case TelephonyManager.SIM_STATE_UNKNOWN:
|
|
|
|
+ return "Unknown";
|
|
|
|
+ case TelephonyManager.SIM_STATE_ABSENT:
|
|
|
|
+ return "Absent";
|
|
|
|
+ case TelephonyManager.SIM_STATE_PIN_REQUIRED:
|
|
|
|
+ return "PIN required";
|
|
|
|
+ case TelephonyManager.SIM_STATE_PUK_REQUIRED:
|
|
|
|
+ return "PUK required";
|
|
|
|
+ case TelephonyManager.SIM_STATE_NETWORK_LOCKED:
|
|
|
|
+ return "Network locked";
|
|
|
|
+ case TelephonyManager.SIM_STATE_READY:
|
|
|
|
+ return "Ready";
|
|
|
|
+ case TelephonyManager.SIM_STATE_NOT_READY:
|
|
|
|
+ return "Not ready";
|
|
|
|
+ case TelephonyManager.SIM_STATE_PERM_DISABLED:
|
|
|
|
+ return "Permanently disabled";
|
|
|
|
+ case TelephonyManager.SIM_STATE_CARD_IO_ERROR:
|
|
|
|
+ return "Card IO error";
|
|
|
|
+ case TelephonyManager.SIM_STATE_CARD_RESTRICTED:
|
|
|
|
+ return "Card restricted";
|
|
|
|
+ default:
|
|
|
|
+ return "Unknown";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|