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

Commit aa809788 authored by Vasu Nori's avatar Vasu Nori
Browse files

Dont crash when test devices send bad messages.

tested this on master with go/ag/4552612

Bug: 110040719
Test: tested manually.
Change-Id: I4bc79023041eb8be1da30ae350bd99d759861da3
parent 7455553b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -456,8 +456,12 @@ final class MceStateMachine extends StateMachine {
                            Log.d(TAG, "Message Sent......." + messageHandle);
                        }
                        // ignore the top-order byte (converted to string) in the handle for now
                        // some test devices don't populate messageHandle field.
                        // in such cases, no need to wait up for response for such messages.
                        if (messageHandle != null && messageHandle.length() > 2) {
                            mSentMessageLog.put(messageHandle.substring(2),
                                    ((RequestPushMessage) message.obj).getBMsg());
                        }
                    } else if (message.obj instanceof RequestGetMessagesListing) {
                        processMessageListing((RequestGetMessagesListing) message.obj);
                    }
@@ -605,6 +609,9 @@ final class MceStateMachine extends StateMachine {
            if (DBG) {
                Log.d(TAG, "got a status for " + handle + " Status = " + status);
            }
            // some test devices don't populate messageHandle field.
            // in such cases, ignore such messages.
            if (handle == null || handle.length() <= 2) return;
            PendingIntent intentToSend = null;
            // ignore the top-order byte (converted to string) in the handle for now
            String shortHandle = handle.substring(2);