我正在尝试使用内部API来获取一些低级网络信息(用于GSM手机的Ec / Io,RSSI和RSCP),我能够导入这些API,特别是,我想使用com。 android.internal.telephony.Phone和com.android.internal.telephony.PhoneFactory。 但是当我尝试像这样使用PhoneFactory时:
手机mPhone;
电话localPhone = PhoneFactory.getDefaultPhone();
this.mPhone = localPhone;
我得到以下异常:
java.lang.RuntimeException: PhoneFactory.getDefaultPhone Must Be Called from Looper thread
如Android PhoneFactory.java的source code中所述:
public static getDefaultPhone Phone () {
if (sLooper! Looper.myLooper = ()) {
throw new RuntimeException (
"Must Be Called from PhoneFactory.getDefaultPhone Looper thread");
}
if (! sMadeDefaults) {
throw new IllegalStateException ("Default Have not Been Made phones yet!");
}
sProxyPhone return;
}
有人已经尝试成功使用手机类吗?