EVDO PhoneApp 异常

作者:fly 发布于:2014-9-30 15:12 分类:android

 www.forwhat.cn

 

近期在调试Android2.3上的EVDO 3G模块,使用的是Huawei EM660 Mini-PCI接口的模块,相应的ril库是由原厂提供,但用在我们的Android2.3上会造成Phone.apk(com.android.phone)异常挂掉,并且强制关闭后仍会弹出,使得Android无法操作,查看了logcat信息,发现有个空指针异常问题,相应的logcat信息如下:

I/Process (  194): Sending signal. PID: 194 SIG: 9

I/ServiceManager(   49): service 'isms' died

I/ServiceManager(   49): service 'simphonebook' died

I/ServiceManager(   49): service 'iphonesubinfo' died

I/ServiceManager(   49): service 'phone' died

I/ActivityManager(   80): Process com.android.phone (pid 194) has died.

W/ActivityManager(   80): Scheduling restart of crashed service com.android.phone/.BluetoothHeadsetService in 5000ms

W/BluetoothHeadset(   80): Proxy not attached to service

W/BluetoothHeadset(   80): Proxy not attached to service

I/ActivityManager(   80): Start proc com.android.phone for restart com.android.phone: pid=521 uid=1001 gids={3002, 3001, 3003, 1015}

W/InputManagerService(   80): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@408ade30

I/ActivityThread(  521): Pub mms: com.android.providers.telephony.MmsProvider

I/ActivityThread(  521): Pub sms: com.android.providers.telephony.SmsProvider

I/ActivityThread(  521): Pub telephony: com.android.providers.telephony.TelephonyProvider

I/ActivityThread(  521): Pub icc: com.android.phone.IccProvider

I/ActivityThread(  521): Pub mms-sms: com.android.providers.telephony.MmsSmsProvider

D/CallManager(  521): registerPhone(GSM Handler{405a8c38})

I/ActivityManager(   80): Start proc android.process.acore for content provider com.android.providers.contacts/.CallLogProvider: pid=536 uid=10002 gids={3003, 1015}

W/ActivityManager(   80): Unable to start service Intent {act=com.android.ussd.IExtendedNetworkService }: not found

I/TelephonyRegistry(   80): notifyServiceState: 3 home null null null  Unknown CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false

I/TelephonyRegistry(   80): notifyDataConnection: state=0 isDataConnectivityPossible=false reason=radioTurnedOff interfaceName=null networkType=0

I/TelephonyRegistry(   80): notifyDataConnection: state=0 isDataConnectivityPossible=false reason=gprsDetached interfaceName=null networkType=0

D/BT HSHFP(  521): Starting BluetoothHeadsetService

D/PhoneApp(  521): Radio technology switched. Now CDMA is active.

I/TelephonyRegistry(   80): notifyDataConnection: state=0 isDataConnectivityPossible=false reason=radioTurnedOff interfaceName=null networkType=0

I/ActivityThread(  536): Pub com.android.social: com.android.providers.contacts.SocialProvider

I/ActivityThread(  536): Pub applbinder: 80:230 transaction failed 29189, size 116-0

ications: com.android.providers.applications.ApplicationsProvider

D/dalvikvm(  521): GREF has increased to 201

I/TelephonyRegistry(   80): notifyMessageWaitingChanged: false

D/PhoneApp(  521): Radio technology switched. Now CDMA is active.

D/AndroidRuntime(  521): Shutting down VM

W/dalvikvm(  521): threadid=1: thread exiting with uncaught exception (group=0x40015560)

E/AndroidRuntime(  521): FATAL EXCEPTION: main

E/AndroidRuntime(  521): java.lang.NullPointerException

E/AndroidRuntime(  521):        at com.android.internal.telephony.gsm.GSMPhone.getState(GSMPhone.java:262)

E/AndroidRuntime(  521):        at com.android.internal.telephony.CallManager.getState(CallManager.java:241)

E/AndroidRuntime(  521):        at com.android.phone.PhoneUtils$ConnectionHandler.handleMessage(PhoneUtils.java:182)

E/AndroidRuntime(  521):        at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime(  521):        at android.os.Looper.loop(Looper.java:123)

E/AndroidRuntime(  521):        at android.app.ActivityThread.main(ActivityThread.java:3647)

E/AndroidRuntime(  521):        at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime(  521):        at java.lang.reflect.Method.invoke(Method.java:507)

E/AndroidRuntime(  521):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)

E/AndroidRuntime(  521):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)

E/AndroidRuntime(  521):        at dalvik.system.NativeStart.main(Native Method)

W/BluetoothHeadset(   80): Proxy not attached to service

W/BluetoothHeadset(   80): Proxy not attached to service

W/ActivityManager(   80): Process com.android.phone has crashed too many times: killing!

I/ActivityThread(  536): Pub contacts;com.android.contacts:com.android.providers.contacts.ContactsProvider2

I/ActivityThread(  536): Pub call_log: com.android.providers.contacts.CallLogProvider

I/ActivityThread(  536): Pub user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider

D/szipinf (  536): Initializing inflate state

W/BluetoothHeadset(  248): Proxy not attached to service

   后来查了下,是由于在GSM切换到CDMA时挂了,主要是在frameworks/base/telephony/java/com/android/internal/telephony/PhoneProxy.java文件中没有对空指针进行处理,故修改该文件如下内容:

   添加包含如下的包:

   import com.android.internal.telephony.CallManager;

   在public class PhoneProxy extends Handler implements Phone类中的public void handleMessage(Message msg)成员函数中的case EVENT_RADIO_TECHNOLOGY_CHANGED分支下的如下语句:

   if(mOutgoingPhone.equals("GSM")) {

       logd("Make a new CDMAPhone and destroy the old GSMPhone.");

   前面添加如下内容:

   CallManager cMgr = CallManager.getInstance();

   if ( cMgr != null )

        cMgr.unregisterPhone(mActivePhone);

   在该分支下的如下语句:

   //Send an Intent to the PhoneApp that we had a radio technology change

   Intent intent = new Intent(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);

   intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);

   intent.putExtra(Phone.PHONE_NAME_KEY, mActivePhone.getPhoneName());

   ActivityManagerNative.broadcastStickyIntent(intent, null);

   前面添加如下语句:

   if ( cMgr != null )

        cMgr.registerPhone(mActivePhone);

   至此,重新编译下Android即可解决。

   参考网址:http://code.google.com/p/android/issues/detail?id=16479

             http://code.google.com/p/android/issues/attachmentText?id=16479&aid=164790001000&name=0001-Fix-worldphone-mode-switch-crashes.patch&token=8580d340b7e3118aa7b8ade89e0ca5a2

 

发表评论:

 
Powered by emlog sitemap