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

Commit aa5e09d6 authored by Michael Gernoth's avatar Michael Gernoth
Browse files

DcSwitchStateMachine: support RILs not implementing REQUEST_ALLOW_DATA

When a RIL returns REQUEST_NOT_SUPPORTED in response to
RIL_REQUEST_ALLOW_DATA this is seen as an error and no state
transition to attached is carried out when the modem is already
attached. Fix this by handling REQUEST_NOT_SUPPORTED as success.

This fixes devices randomly not attaching data after reboot if
the modem returns attached in DATA_REGISTRATION_STATE before
setDataAllowed is called.

Change-Id: I1e58be9d8a8bfe67df4c266e5670a47acedf6f03
parent 536cddc7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -288,7 +288,12 @@ public class DcSwitchStateMachine extends StateMachine {
                        loge("EVENT_DATA_ALLOWED ignored arg1=" + msg.arg1 + ", seq=" +
                                mCurrentAllowedSequence);
                    } else {
                        if (ar.exception != null) {
                        boolean requestNotSupported = (ar.exception != null &&
                                ar.exception instanceof CommandException &&
                                ((CommandException)(ar.exception)).getCommandError() ==
                                        CommandException.Error.REQUEST_NOT_SUPPORTED);

                        if (ar.exception != null && !requestNotSupported) {
                            loge("EVENT_DATA_ALLOWED failed, " + ar.exception);
                            if (mResponseMsg != null) {
                                // Inform DctController about the failure.