Closed ghost closed 12 years ago
I've just implemented the hangup function in dialer.py, but even sending what it seems to be the correct data to the rild, it is not working properly. So I have done some tests with the android dialer from a fresh B2G build in order to discard issues with the RIL implementation and I've found out that the hangup function is also not working with the android dialer. The RIL log gives this exception:
GET_CURRENT_CALLS exception, possible invalid RIL response W/RILJ ( 3306): com.android.internal.telephony.ATParseEx: illegal presentation 3538998 W/RILJ ( 3306): at com.android.internal.telephony.DriverCall.presentationFromCLIP(DriverCall.java:141) W/RILJ ( 3306): at com.android.internal.telephony.RIL.responseCallList(RIL.java:2908) W/RILJ ( 3306): at com.android.internal.telephony.RIL.processSolicited(RIL.java:2174) W/RILJ ( 3306): at com.android.internal.telephony.RIL.processResponse(RIL.java:2086) W/RILJ ( 3306): at com.android.internal.telephony.RIL.access$300(RIL.java:206) W/RILJ ( 3306): at com.android.internal.telephony.RIL$RILReceiver.run(RIL.java:573) W/RILJ ( 3306): at java.lang.Thread.run(Thread.java:1019)
What call are you making to hangup the phone? It looks like there's a ton of choices based on multi-call state, but the stock firmware (no B2G) uses HANGUP_FOREGROUND_RESUME_BACKGROUND if there's a single conversation happening.
Interestingly enough, even the stock firmware has some sort of hangup error:
D/GSM ( 2837): [GsmCallTracker] hangupForegroundResumeBackground
D/GSM ( 2837): [GsmCallTracker] obtainCompleteMessage: pendingOperations=1, needsPoll=true
D/RILJ ( 2837): [0706]> HANGUP_FOREGROUND_RESUME_BACKGROUND
D/RILJ ( 2837): [0706]< HANGUP_FOREGROUND_RESUME_BACKGROUND
D/GSM ( 2837): [GsmCallTracker] operationComplete: pendingOperations=0, needsPoll=true
D/RILJ ( 2837): [0707]> GET_CURRENT_CALLS
D/RILJ ( 2837): [0707]< GET_CURRENT_CALLS error: com.android.internal.telephony.CommandException: GENERIC_FAILURE
D/RILJ ( 2837): [0708]> SET_MUTE false
D/RILJ ( 2837): [0708]< SET_MUTE
D/GSM ( 2837): [GsmCallTracker] handle EVENT_POLL_CALL_RESULT: set needsPoll=F
D/RILJ ( 2837): [UNSL]< UNSOL_RESPONSE_CALL_STATE_CHANGED
D/RILJ ( 2837): [0709]> GET_CURRENT_CALLS
D/RILJ ( 2837): [0709]< GET_CURRENT_CALLS
D/GSM ( 2837): [GsmCallTracker] handle EVENT_POLL_CALL_RESULT: set needsPoll=F
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=0]= incoming: true state: DISCONNECTING post dial state: NOT_STARTED fake: false, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=1]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=2]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=3]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=4]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=5]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=6]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=7]=null, dc=null
D/GSM ( 2837): [GSMConn] onDisconnect: cause=LOCAL
D/STK ( 2837): StkService: MSG_ID_PHONE_DISCONNECT
D/GSM ( 2837): [GsmMultiDCT] GSMDataConnTrack handleMessage { what=15 when=-5ms obj=android.os.AsyncResult@40623f18 }
D/GSM ( 2837): getDataConnectionState() GPRS state: 0 Data connection state: CONNECTED
D/GSM ( 2837): getDataConnectionState() GPRS state: 0 Data connection state: CONNECTED
D/GSM ( 2701): [GsmMultiDCT] notify to callback: CONNECTED
D/GSM ( 2701): [GsmMultiDCT] broadcast: CONNECTED
D/GSM ( 2837): [GsmMultiDCT] type default is already active
D/GSM ( 2837): [GsmMultiDCT] trySetupNextData: Nothing to try(mCurrReqApnType: default)
E/RILClient( 2584): + SetCallVolume
E/RILClient( 2584): + RegisterRequestCompleteHandler: req_id - 101
E/RILClient( 2584): + SendOemRequestHookRaw: req_id - 101
E/RILClient( 2584): - SendOemRequestHookRaw: req_id - 101
E/RILClient( 2584): - SetCallVolume
D/RILJ ( 2837): [0710]> GET_CURRENT_CALLS
D/RILJ ( 2837): [0710]< GET_CURRENT_CALLS
D/GSM ( 2837): [GsmCallTracker] handle EVENT_POLL_CALL_RESULT: set needsPoll=F
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=0]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=1]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=2]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=3]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=4]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=5]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=6]=null, dc=null
D/GSM ( 2837): [GsmCallTracker] poll: conn[i=7]=null, dc=null
D/RILJ ( 2837): [0711]> REQUEST_GET_NEIGHBORING_CELL_IDS
D/RILJ ( 2837): [0711]< REQUEST_GET_NEIGHBORING_CELL_IDS error: com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED
E/RILClient( 2584): + SetTwoMicControl
E/RILClient( 2584): + RegisterRequestCompleteHandler: req_id - 108
E/RILClient( 2584): + SendOemRequestHookRaw: req_id - 108
E/RILClient( 2584): - SendOemRequestHookRaw: req_id - 108
E/RILClient( 2584): - SetTwoMicControl
E/RILClient( 2584): + SetTwoMicControl
E/RILClient( 2584): + RegisterRequestCompleteHandler: req_id - 108
E/RILClient( 2584): + SendOemRequestHookRaw: req_id - 108
E/RILClient( 2584): - SendOemRequestHookRaw: req_id - 108
E/RILClient( 2584): - SetTwoMicControl
Notice the exception in GET_CURRENT_CALLS, then it works fine again. I wonder if it's just something that errors out every so often?
I am sending a different command depending on the state of the current call, just like the stock firmware seems to be doing. I've noticed that it uses HANGUP_FOREGROUND_RESUME_BACKGROUND to finish an unattended call and HANGUP for an attended call in progress. In both cases, the GET_CURRENT_CALLS exception appears on the Samsung Galaxy SII but not in the Nexus S.
I think there's just something wrong in the Galaxy S2 libril implementation.
Done as part of b2g-js-ril
We can dial, but we can't hang up. We should probably be able to hang up.