Advertisement
Adlx

Phone crashes in Landscape when calling

Jun 9th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.83 KB | None | 0 0
  1. Situation: I'm trying to port CM10.1 to the HTC Chacha.
  2.  
  3. I'm having an issue with Phone, everytime I open the phone app and dial a number it FCs.
  4.  
  5. Here's the corresponding logcat chunk:
  6.  
  7. Code:
  8. 06-09 01:44:46.808: D/CallCard(636): CallCard constructor...
  9. 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}
  10. 06-09 01:44:46.818: D/CallCard(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@41010ce0
  11. 06-09 01:44:46.818: D/CallCard(636): - Density: 1.0
  12. 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})...
  13. 06-09 01:44:46.868: D/InCallTouchUi(636): InCallTouchUi constructor...
  14. 06-09 01:44:46.868: D/InCallTouchUi(636): - this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0}
  15. 06-09 01:44:46.868: D/InCallTouchUi(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@4101fd48
  16. 06-09 01:44:47.048: D/InCallTouchUi(636): InCallTouchUi onFinishInflate(this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0})...
  17. 06-09 01:44:47.048: D/InCallScreen(636): initInCallScreen()...
  18. 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}
  19. 06-09 01:44:46.808: D/CallCard(636): CallCard constructor...
  20. 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}
  21. 06-09 01:44:46.818: D/CallCard(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@41010ce0
  22. 06-09 01:44:46.818: D/CallCard(636): - Density: 1.0
  23. 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})...
  24. 06-09 01:44:46.868: D/InCallTouchUi(636): InCallTouchUi constructor...
  25. 06-09 01:44:46.868: D/InCallTouchUi(636): - this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0}
  26. 06-09 01:44:46.868: D/InCallTouchUi(636): - context com.android.phone.InCallScreen@40f0c060, attrs android.content.res.XmlBlock$Parser@4101fd48
  27. 06-09 01:44:47.048: D/InCallTouchUi(636): InCallTouchUi onFinishInflate(this = com.android.phone.InCallTouchUi{41020910 V.E..... ......I. 0,0-0,0})...
  28. 06-09 01:44:47.048: D/InCallScreen(636): initInCallScreen()...
  29. 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}
  30. 06-09 01:44:47.048: D/InCallScreen(636): initInCallTouchUi()...
  31. 06-09 01:44:47.048: D/InCallScreen(636): adlx - mInCallTouchUi = null
  32. 06-09 01:44:47.048: D/InCallScreen(636): adlx - before mInCallTouchUi.setInCallScreenInstance...
  33. 06-09 01:44:47.048: D/AndroidRuntime(636): Shutting down VM
  34. 06-09 01:44:47.048: W/dalvikvm(636): threadid=1: thread exiting with uncaught exception (group=0x40aa6930)
  35. 06-09 01:44:47.058: E/AndroidRuntime(636): FATAL EXCEPTION: main
  36. 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
  37. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
  38. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
  39. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.access$600(ActivityThread.java:153)
  40. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
  41. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Handler.dispatchMessage(Handler.java:99)
  42. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Looper.loop(Looper.java:137)
  43. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.main(ActivityThread.java:5226)
  44. 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invokeNative(Native Method)
  45. 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invoke(Method.java:511)
  46. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
  47. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
  48. 06-09 01:44:47.058: E/AndroidRuntime(636): at dalvik.system.NativeStart.main(Native Method)
  49. 06-09 01:44:47.058: E/AndroidRuntime(636): Caused by: java.lang.NullPointerException
  50. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallTouchUi(InCallScreen.java:4193)
  51. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallScreen(InCallScreen.java:1385)
  52. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.onCreate(InCallScreen.java:597)
  53. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Activity.performCreate(Activity.java:5104)
  54. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  55. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
  56. 06-09 01:44:47.058: E/AndroidRuntime(636): ... 11 more
  57. 06-09 01:44:48.690: I/Process(636): Sending signal. PID: 636 SIG: 9
  58.  
  59. 06-09 01:44:47.048: D/AndroidRuntime(636): Shutting down VM
  60. 06-09 01:44:47.048: W/dalvikvm(636): threadid=1: thread exiting with uncaught exception (group=0x40aa6930)
  61. 06-09 01:44:47.058: E/AndroidRuntime(636): FATAL EXCEPTION: main
  62. 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
  63. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
  64. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
  65. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.access$600(ActivityThread.java:153)
  66. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
  67. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Handler.dispatchMessage(Handler.java:99)
  68. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.os.Looper.loop(Looper.java:137)
  69. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.main(ActivityThread.java:5226)
  70. 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invokeNative(Native Method)
  71. 06-09 01:44:47.058: E/AndroidRuntime(636): at java.lang.reflect.Method.invoke(Method.java:511)
  72. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
  73. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
  74. 06-09 01:44:47.058: E/AndroidRuntime(636): at dalvik.system.NativeStart.main(Native Method)
  75. 06-09 01:44:47.058: E/AndroidRuntime(636): Caused by: java.lang.NullPointerException
  76. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallTouchUi(InCallScreen.java:4193)
  77. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.initInCallScreen(InCallScreen.java:1385)
  78. 06-09 01:44:47.058: E/AndroidRuntime(636): at com.android.phone.InCallScreen.onCreate(InCallScreen.java:597)
  79. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Activity.performCreate(Activity.java:5104)
  80. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  81. 06-09 01:44:47.058: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
  82. 06-09 01:44:47.058: E/AndroidRuntime(636): ... 11 more
  83. 06-09 01:44:48.690: I/Process(636): Sending signal. PID: 636 SIG: 9
  84.  
  85. The interesting part of the log is (I have added some dbg lines, prefixed with "adlx").
  86.  
  87. 06-09 01:44:47.048: D/InCallScreen(636): initInCallTouchUi()...
  88. 06-09 01:44:47.048: D/InCallScreen(636): adlx - mInCallTouchUi = null
  89. 06-09 01:44:47.048: D/InCallScreen(636): adlx - before mInCallTouchUi.setInCallScreenInstance...
  90.  
  91. Corresponding source code is in src/com/android/phone/InCallScreen.java:
  92.  
  93. Code:
  94. private void initInCallTouchUi() {
  95. if (DBG) log("initInCallTouchUi()...");
  96. // TODO: we currently use the InCallTouchUi widget in at least
  97. // some states on ALL platforms. But if some devices ultimately
  98. // end up not using *any* onscreen touch UI, we should make sure
  99. // to not even inflate the InCallTouchUi widget on those devices.
  100.  
  101. mInCallTouchUi = (InCallTouchUi) findViewById(R.id.inCallTouchUi);
  102. log("adlx - mInCallTouchUi = " + mInCallTouchUi); // It's null ?!
  103. if (DBG) log("adlx - before mInCallTouchUi.setInCallScreenInstance...");
  104. mInCallTouchUi.setInCallScreenInstance(this); // FC!
  105. if (DBG) log("adlx - after mInCallTouchUi.setInCallScreenInstance...");
  106.  
  107. // RespondViaSmsManager implements the "Respond via SMS"
  108. // feature that's triggered from the incoming call widget.
  109. mRespondViaSmsManager = new RespondViaSmsManager();
  110. mRespondViaSmsManager.setInCallScreenInstance(this);
  111. }
  112.  
  113. logcat shows mInCallTouchUi = (InCallTouchUi) findViewById(R.id.inCallTouchUi) is null :((!
  114.  
  115. What am I missing here? Wth is it null?
  116.  
  117. How can I debug that further?
  118.  
  119. The HTC Chacha's screen is landscape so I'm looking at the diffs in layouts:
  120.  
  121. ./res/layout/incall_screen.xml:
  122.  
  123. Code:
  124. <!-- In-call onscreen touch controls; see InCallTouchUi.java.
  125. This widget contains the cluster of buttons shown at the bottom
  126. of the in-call screen, and also the DTMF dialpad (which, when
  127. visible, covers the upper part of the screen too.) -->
  128. <include layout="@layout/incall_touch_ui"
  129. android:layout_width="match_parent"
  130. android:layout_height="match_parent"
  131. />
  132. while in ./res/layout-land/incall_screen.xml
  133.  
  134. Code:
  135. <!-- In-call onscreen touch controls; see InCallTouchUi.java.
  136. This widget contains the cluster of buttons shown at the right
  137. of the in-call screen, and also the DTMF dialpad (which, when
  138. visible, covers the contact picture/call_card on the left half of the screen) -->
  139.  
  140. <ViewStub
  141. android:id="@+id/inCallTouchUiStub"
  142. android:layout="@layout/incall_touch_ui"
  143. android:layout_width="match_parent"
  144. android:layout_height="match_parent" />
  145. <ViewStub
  146. android:id="@+id/inCallTouchUiCdmaStub"
  147. android:layout="@layout/incall_touch_ui_cdma"
  148. android:layout_width="match_parent"
  149. android:layout_height="match_parent" />
  150. So in landscape it's not an include but a stub. the code in InCallScreen.java deals with this:
  151.  
  152. Code:
  153. // Inflate everything in incall_screen.xml and add it to the screen.
  154. log("adlx - setContentView(R.layout.incall_screen);");
  155. setContentView(R.layout.incall_screen);
  156.  
  157. // If in landscape, then one of the ViewStubs (instead of <include>) is used for the
  158. // incall_touch_ui, because CDMA and GSM button layouts are noticeably different.
  159. final ViewStub touchUiStub = (ViewStub) findViewById(
  160. mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA
  161. ? R.id.inCallTouchUiCdmaStub : R.id.inCallTouchUiStub);
  162. if (touchUiStub != null) touchUiStub.inflate();
  163.  
  164. log("adlx - touchUiStub=" + touchUiStub);
  165.  
  166. initInCallScreen();
  167.  
  168.  
  169. I can see in the logcat:
  170.  
  171. 06-09 02:19:09.556: D/InCallScreen(635): adlx - setContentView(R.layout.incall_screen);
  172. 06-09 02:19:09.817: D/InCallScreen(635): adlx - touchUiStub=android.view.ViewStub{41018010 G.E..... ......I. 0,0-0,0 #7f080047}
  173.  
  174. So touchUiStub != null , which means touchUiStub should get inflated. Furthermore,
  175.  
  176. 06-09 02:26:26.440: D/InCallScreen(633): adlx - mPhone.getPhoneType()=1
  177. 06-09 02:26:26.440: D/InCallScreen(633): adlx - PhoneConstants.PHONE_TYPE_CDMA=2
  178.  
  179. So, it should inflate the inCallTouchUiStub (not the inCallTouchUiCdmaStub ).
  180.  
  181. ./res/layout-land/incall_touch_ui.xml:
  182.  
  183. Code:
  184. <com.android.phone.InCallTouchUi xmlns:android="http://schemas.android.com/apk/res/android"
  185. xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android"
  186. android:id="@+id/inCallTouchUi"
  187. android:layout_width="match_parent"
  188. android:layout_height="match_parent">
  189. ...
  190. 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