Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb98165a authored by Daniel Velazco's avatar Daniel Velazco
Browse files

Log the correct string to avoid a crash when HFP client fails to dial

When a HFP client fails to initiate a call, the error logged was trying
to cast message.obj to a String when it is a BluetoothHeadsetClientCall,
this was causing a ClassCastException. Replacing with c.toString(true)
outputs the correct loggable string.

Test: atest --host bluetooth_test_common
Tag: #stability

Bug: 157082875
Change-Id: I21ccdb9e09eaf12904056baee695ef155e876982
parent d08243c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1181,7 +1181,7 @@ public class HeadsetClientStateMachine extends StateMachine {
                        sendMessage(QUERY_CURRENT_CALLS);
                    } else {
                        Log.e(TAG,
                                "ERROR: Cannot dial with a given number:" + (String) message.obj);
                                "ERROR: Cannot dial with a given number:" + c.toString(true));
                        // Set the call to terminated remove.
                        c.setState(BluetoothHeadsetClientCall.CALL_STATE_TERMINATED);
                        sendCallChangedIntent(c);