我正在尝试对APK
进行编码,以识别收到的呼叫是在sim 1或sim 2中。我尝试了以下解决方案,但在所有设备中均无法正常使用。三星和MI设备以下解决方案不起作用。您能建议通用解决方案吗?谢谢
我尝试了以下解决方案
public class IncomingCallInterceptor extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String callingSIM = "";
Bundle bundle = intent.getExtras();
callingSIM =String.valueOf(bundle.getInt("simId", -1));
if(callingSIM == "0"){
// Incoming call from SIM1
}
else if(callingSIM =="1"){
// Incoming call from SIM2
}
}
}