在app端创建线程来解锁SIM ME lock
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
在实现运营商的锁网需求时,需要在app端创建线程来直接解锁SIM ME lock
[SOLUTION]
解锁函数:
1. L之前的版本可以参考KeyguardSimPinPukView.Java CheckSimMe thread 中的run()函数调用方
式。
实例如下:
import com.mediatek.common.telephony.ITelephonyEx;
private class simMeCheckThread extends Thread {
int mSimId;
string mPasswd;
simMeCheckThread(int mSimId, string mPasswd) {
this.mSimId = mSimId;
this.mPasswd = mPasswd;
}
@Override
public void run() {
try {
Log.d(TAG, "simMeCheckThread-run() mSimId =" + mSimId +" mPasswd
="+mPasswd);
//supplyNetworkDepersonalization()
mResult =
ITelephonyEx.Stub.asInterface(ServiceManager.checkService("phoneEx")).supp
lyNetworkDepersonalization(
mPasswd, mSimId);
Log.d(TAG, "simMeCheckThread-run()done mResult =" + mResult);
} catch (Exception e) {
Log.e(TAG, "supplyNetworkDepersonalization got exception: " +
e.getMessage());
}
}
}
2. L版本上参考KeyguardSimPinPukMeView.java中的 CheckSimMe thread.run()函数调用方式,实
例如下:
private class simMeCheckThread extends Thread {
private final String mPasswd;
private int mSlotId;
private int mResult;
protected simMeCheckThread (String passwd, long slotId) {
mPasswd = passwd;
mSlotId= slotId;
}
@Override
public void run() {
try {
//注意L上slotId与subId的差别,需要进行转换
long [] subIds = SubcriptionManager.getSubId(slotId);
Log.d(TAG, "CheckMe, " + "slotId = " + slotId + ", subId = " + subIds[0]);
//supplyNetworkDepersonalization()
mResult =
ITelephonyEx.Stub.asInterface(ServiceManager.getService("phoneEx"))
.supplyNetworkDepersonalization(subIds[0], mPasswd);
Log.d(TAG, "CheckMe, " + "mSlotId=" + mSlotId + " mResult=" + mResult);
} catch (RemoteException e) {
Log.e(TAG, "supplyNetworkDepersonalization got exception: " +
e.getMessage());
}
}
}
在实现运营商的锁网需求时,需要在app端创建线程来直接解锁SIM ME lock
[SOLUTION]
解锁函数:
1. L之前的版本可以参考KeyguardSimPinPukView.Java CheckSimMe thread 中的run()函数调用方
式。
实例如下:
import com.mediatek.common.telephony.ITelephonyEx;
private class simMeCheckThread extends Thread {
int mSimId;
string mPasswd;
simMeCheckThread(int mSimId, string mPasswd) {
this.mSimId = mSimId;
this.mPasswd = mPasswd;
}
@Override
public void run() {
try {
Log.d(TAG, "simMeCheckThread-run() mSimId =" + mSimId +" mPasswd
="+mPasswd);
//supplyNetworkDepersonalization()
mResult =
ITelephonyEx.Stub.asInterface(ServiceManager.checkService("phoneEx")).supp
lyNetworkDepersonalization(
mPasswd, mSimId);
Log.d(TAG, "simMeCheckThread-run()done mResult =" + mResult);
} catch (Exception e) {
Log.e(TAG, "supplyNetworkDepersonalization got exception: " +
e.getMessage());
}
}
}
2. L版本上参考KeyguardSimPinPukMeView.java中的 CheckSimMe thread.run()函数调用方式,实
例如下:
private class simMeCheckThread extends Thread {
private final String mPasswd;
private int mSlotId;
private int mResult;
protected simMeCheckThread (String passwd, long slotId) {
mPasswd = passwd;
mSlotId= slotId;
}
@Override
public void run() {
try {
//注意L上slotId与subId的差别,需要进行转换
long [] subIds = SubcriptionManager.getSubId(slotId);
Log.d(TAG, "CheckMe, " + "slotId = " + slotId + ", subId = " + subIds[0]);
//supplyNetworkDepersonalization()
mResult =
ITelephonyEx.Stub.asInterface(ServiceManager.getService("phoneEx"))
.supplyNetworkDepersonalization(subIds[0], mPasswd);
Log.d(TAG, "CheckMe, " + "mSlotId=" + mSlotId + " mResult=" + mResult);
} catch (RemoteException e) {
Log.e(TAG, "supplyNetworkDepersonalization got exception: " +
e.getMessage());
}
}
}
THANKS YOU