Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Situation: I'm trying to port CM10.1 to the HTC Chacha.
- I'm having an issue with Phone, everytime I open the phone app and dial a number it FCs.
- Here's the corresponding logcat chunk:
- Code:
- 06-09 01:44:46.808: D/CallCard(636): CallCard constructor...
- 06-09 01:44:46.808: D/CallCard(636): - this = com.android.phone.CallCard{41011598 V.E..... ......I. 0,0-0,0 #7f08000c app:id/call_info_container}
- 06-09 01:44:46.818: D/CallCard(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@41010ce0
- 06-09 01:44:46.818: D/CallCard(636): - Density: 1.0
- 06-09 01:44:46.848: D/CallCard(636): CallCard onFinishInflate(this = com.android.phone.CallCard{41011598 V.E..... ......I. 0,0-0,0 #7f08000c app:id/call_info_container})...
- 06-09 01:44:46.868: D/InCallTouchUi(636): InCallTouchUi constructor...
- 06-09 01:44:46.868: D/InCallTouchUi(636): - this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0}
- 06-09 01:44:46.868: D/InCallTouchUi(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@4101fd48
- 06-09 01:44:47.048: D/InCallTouchUi(636): InCallTouchUi onFinishInflate(this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0})...
- 06-09 01:44:47.048: D/InCallScreen(636): initInCallScreen()...
- 06-09 01:44:47.048: D/InCallScreen(636): - mCallCard = com.android.phone.CallCard{41011598 V.E..... ......I. 0,0-0,0 #7f080043 app:id/callCard}
- 06-09 01:44:46.808: D/CallCard(636): CallCard constructor...
- 06-09 01:44:46.808: D/CallCard(636): - this = com.android.phone.CallCard{41011598 V.E..... ......I. 0,0-0,0 #7f08000c app:id/call_info_container}
- 06-09 01:44:46.818: D/CallCard(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@41010ce0
- 06-09 01:44:46.818: D/CallCard(636): - Density: 1.0
- 06-09 01:44:46.848: D/CallCard(636): CallCard onFinishInflate(this = com.android.phone.CallCard{41011598 V.E..... ......I. 0,0-0,0 #7f08000c app:id/call_info_container})...
- 06-09 01:44:46.868: D/InCallTouchUi(636): InCallTouchUi constructor...
- 06-09 01:44:46.868: D/InCallTouchUi(636): - this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0}
- 06-09 01:44:46.868: D/InCallTouchUi(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@4101fd48
- 06-09 01:44:47.048: D/InCallTouchUi(636): InCallTouchUi onFinishInflate(this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0})...
- 06-09 01:44:47.048: D/InCallScreen(636): initInCallScreen()...
- 06-09 01:44:47.048: D/InCallScreen(636): - mCallCard = com.android.phone.CallCard{41011598 V.E..... ......I. 0,0-0,0 #7f080043 app:id/callCard}
- 06-09 01:44:47.048: D/InCallScreen(636): initInCallTouchUi()...
- 06-09 01:44:47.048: D/InCallScreen(636): adlx - mInCallTouchUi = null
- 06-09 01:44:47.048: D/InCallScreen(636): adlx - before mInCallTouchUi.setInCallScreenInstance...
- 06-09 01:44:47.048: D/AndroidRuntime(636): Shutting down VM
- 06-09 01:44:47.048: W/dalvikvm(636): threadid=1: thread exiting with uncaught exception (group=0x40aa6930)
- 06-09 01:44:47.058: E/AndroidRuntime(636): FATAL EXCEPTION: main
- 06-09 01:44:47.058: E/AndroidRuntime(636): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.phone/com.android.phone.InCallScreen}: java.lang.NullPointerException
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.access$600(ActivityThread.java:153)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Handler.dispatchMessage(Handler.java:99)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Looper.loop(Looper.java:137)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.main(ActivityThread.java:5226)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invokeNative(Native Method)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invoke(Method.java:511)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at dalvik.system.NativeStart.main(Native Method)
- 06-09 01:44:47.058: E/AndroidRuntime(636): Caused by: java.lang.NullPointerException
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallTouchUi(InCallScreen.java:4193)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallScreen(InCallScreen.java:1385)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.onCreate(InCallScreen.java:597)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Activity.performCreate(Activity.java:5104)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
- 06-09 01:44:47.058: E/AndroidRuntime(636): ... 11 more
- 06-09 01:44:48.690: I/Process(636): Sending signal. PID: 636 SIG: 9
- 06-09 01:44:47.048: D/AndroidRuntime(636): Shutting down VM
- 06-09 01:44:47.048: W/dalvikvm(636): threadid=1: thread exiting with uncaught exception (group=0x40aa6930)
- 06-09 01:44:47.058: E/AndroidRuntime(636): FATAL EXCEPTION: main
- 06-09 01:44:47.058: E/AndroidRuntime(636): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.phone/com.android.phone.InCallScreen}: java.lang.NullPointerException
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.access$600(ActivityThread.java:153)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Handler.dispatchMessage(Handler.java:99)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Looper.loop(Looper.java:137)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.main(ActivityThread.java:5226)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invokeNative(Native Method)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invoke(Method.java:511)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at dalvik.system.NativeStart.main(Native Method)
- 06-09 01:44:47.058: E/AndroidRuntime(636): Caused by: java.lang.NullPointerException
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallTouchUi(InCallScreen.java:4193)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallScreen(InCallScreen.java:1385)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.onCreate(InCallScreen.java:597)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Activity.performCreate(Activity.java:5104)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
- 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
- 06-09 01:44:47.058: E/AndroidRuntime(636): ... 11 more
- 06-09 01:44:48.690: I/Process(636): Sending signal. PID: 636 SIG: 9
- The interesting part of the log is (I have added some dbg lines, prefixed with "adlx").
- 06-09 01:44:47.048: D/InCallScreen(636): initInCallTouchUi()...
- 06-09 01:44:47.048: D/InCallScreen(636): adlx - mInCallTouchUi = null
- 06-09 01:44:47.048: D/InCallScreen(636): adlx - before mInCallTouchUi.setInCallScreenInstance...
- Corresponding source code is in src/com/android/phone/InCallScreen.java:
- Code:
- private void initInCallTouchUi() {
- if (DBG) log("initInCallTouchUi()...");
- // TODO: we currently use the InCallTouchUi widget in at least
- // some states on ALL platforms. But if some devices ultimately
- // end up not using *any* onscreen touch UI, we should make sure
- // to not even inflate the InCallTouchUi widget on those devices.
- mInCallTouchUi = (InCallTouchUi) findViewById(R.id.inCallTouchUi);
- log("adlx - mInCallTouchUi = " + mInCallTouchUi); // It's null ?!
- if (DBG) log("adlx - before mInCallTouchUi.setInCallScreenInstance...");
- mInCallTouchUi.setInCallScreenInstance(this); // FC!
- if (DBG) log("adlx - after mInCallTouchUi.setInCallScreenInstance...");
- // RespondViaSmsManager implements the "Respond via SMS"
- // feature that's triggered from the incoming call widget.
- mRespondViaSmsManager = new RespondViaSmsManager();
- mRespondViaSmsManager.setInCallScreenInstance(this);
- }
- logcat shows mInCallTouchUi = (InCallTouchUi) findViewById(R.id.inCallTouchUi) is null :((!
- What am I missing here? Wth is it null?
- How can I debug that further?
- The HTC Chacha's screen is landscape so I'm looking at the diffs in layouts:
- ./res/layout/incall_screen.xml:
- Code:
- <!-- In-call onscreen touch controls; see InCallTouchUi.java.
- This widget contains the cluster of buttons shown at the bottom
- of the in-call screen, and also the DTMF dialpad (which, when
- visible, covers the upper part of the screen too.) -->
- <include layout="@layout/incall_touch_ui"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- />
- while in ./res/layout-land/incall_screen.xml
- Code:
- <!-- In-call onscreen touch controls; see InCallTouchUi.java.
- This widget contains the cluster of buttons shown at the right
- of the in-call screen, and also the DTMF dialpad (which, when
- visible, covers the contact picture/call_card on the left half of the screen) -->
- <ViewStub
- android:id="@+id/inCallTouchUiStub"
- android:layout="@layout/incall_touch_ui"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <ViewStub
- android:id="@+id/inCallTouchUiCdmaStub"
- android:layout="@layout/incall_touch_ui_cdma"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- So in landscape it's not an include but a stub. the code in InCallScreen.java deals with this:
- Code:
- // Inflate everything in incall_screen.xml and add it to the screen.
- log("adlx - setContentView(R.layout.incall_screen);");
- setContentView(R.layout.incall_screen);
- // If in landscape, then one of the ViewStubs (instead of <include>) is used for the
- // incall_touch_ui, because CDMA and GSM button layouts are noticeably different.
- final ViewStub touchUiStub = (ViewStub) findViewById(
- mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA
- ? R.id.inCallTouchUiCdmaStub : R.id.inCallTouchUiStub);
- if (touchUiStub != null) touchUiStub.inflate();
- log("adlx - touchUiStub=" + touchUiStub);
- initInCallScreen();
- I can see in the logcat:
- 06-09 02:19:09.556: D/InCallScreen(635): adlx - setContentView(R.layout.incall_screen);
- 06-09 02:19:09.817: D/InCallScreen(635): adlx - touchUiStub=android.view.ViewStub{41018010 G.E..... ......I. 0,0-0,0 #7f080047}
- So touchUiStub != null , which means touchUiStub should get inflated. Furthermore,
- 06-09 02:26:26.440: D/InCallScreen(633): adlx - mPhone.getPhoneType()=1
- 06-09 02:26:26.440: D/InCallScreen(633): adlx - PhoneConstants.PHONE_TYPE_CDMA=2
- So, it should inflate the inCallTouchUiStub (not the inCallTouchUiCdmaStub ).
- ./res/layout-land/incall_touch_ui.xml:
- Code:
- <com.android.phone.InCallTouchUi xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android"
- android:id="@+id/inCallTouchUi"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- ...
- So I wonder why (InCallTouchUi) findViewById(R.id.inCallTouchUi) is null after inflating the stub?!?!? Any idea of anything I could do to further check what the hell is wrong?!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement