version:1.2.4

fix:
update:优化显示未读短信和未接来电,增加手电筒和数据开关
This commit is contained in:
2024-09-24 10:30:27 +08:00
parent 5bb723bc48
commit f03f8df38d
55 changed files with 1327 additions and 206 deletions

View File

@@ -324,19 +324,19 @@ public class Utils {
return result;
}
public static boolean isMultiSim(Context context){
public static boolean isMultiSim(Context context) {
boolean result = false;
TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
if(telecomManager != null){
if (telecomManager != null) {
List<PhoneAccountHandle> phoneAccountHandleList = telecomManager.getCallCapablePhoneAccounts();
result = phoneAccountHandleList.size() >= 2;
}
return result;
}
public static void call(Context context, int id, String telNum){
public static void call(Context context, int id, String telNum) {
TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
if(telecomManager != null){
if (telecomManager != null) {
List<PhoneAccountHandle> phoneAccountHandleList = telecomManager.getCallCapablePhoneAccounts();
Intent intent = new Intent();
intent.setAction(Intent.ACTION_CALL);
@@ -346,4 +346,24 @@ public class Utils {
}
}
@SuppressLint("HardwareIds")
public static String getIMEI(Context context, int slotIndex) {
String imei;
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
imei = tm.getImei(slotIndex);
} else {
imei = tm.getDeviceId(slotIndex);
}
if (TextUtils.isEmpty(imei)) {
return "暂无数据";
}
return imei;
}
public static String getEmid(Context context) {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String meid = telephonyManager.getDeviceId();
return meid;
}
}