PhoneFactory.getDefaultPhone must be called from Looper thread

1467 ワード

本機の番号を設定・表示するガジェット(A small tool displays and settings my phone number)が書かれています.詳しくは「Android設定表示本体番号」を参照してください.Settingsに従って書いたように、運行時に、1487 AndroidRuntime E Caused by: java.lang.RuntimeException: PhoneFactory.getDefaultPhone must be called from Looper thread
1487 AndroidRuntime E at com.android.internal.telephony.PhoneFactory.getDefaultPhone(PhoneFactory.java:155)
1487 AndroidRuntime E ... 24 more
に遭遇しました.
現在、PhoneApp以外のアプリケーションではcomを呼び出すことができないようです.android.internal.telephony.Phone;com.android.internal.telephony.PhoneFactoryの場合、intentメッセージを送るのが一般的です.よく比較してみると、SettingsのAndroid Manifest.xmlはPhoneのActivity属性で追加されました.android:process="com.android.phone"
AndroidManifestでxmlはandroid:sharedUserId="android.uid.システム」も加わり、問題解決.CMのようなファームウェア、コンパイルの時、android.uid.SystemはAndroidのデフォルトの公的署名です.androidを使用するとuid.Systemのapk署名が異なっていて、インストールできないので、エラーを報告します:ERROR/PackageManager(81):Package org.lytsing.myphonenumber has no signatures that match those in shared user android.uid.system; ignoring!
もちろん、android携帯電話のサードパーティ開発者はこの方法を使用できません.http://stackoverflow.com/questions/2143754/can-a-telephony-phone-object-be-instantiated-through-the-sdk原理はAIDLと反射機構を通じて、隠しAPIを使用することである.