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

Commit 8aa30e66 authored by vnori's avatar vnori Committed by android-build-merger
Browse files

Merge "Dont crash when test devices send bad messages. tested this on master with go/ag/4552612"

am: 5ee35baa

Change-Id: I8e1560d051e75fcf285c5aee372f1fd391ad4d2c
parents 2296a373 5ee35baa
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -456,8 +456,12 @@ final class MceStateMachine extends StateMachine {
                            Log.d(TAG, "Message Sent......." + messageHandle);
                            Log.d(TAG, "Message Sent......." + messageHandle);
                        }
                        }
                        // ignore the top-order byte (converted to string) in the handle for now
                        // 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),
                            mSentMessageLog.put(messageHandle.substring(2),
                                    ((RequestPushMessage) message.obj).getBMsg());
                                    ((RequestPushMessage) message.obj).getBMsg());
                        }
                    } else if (message.obj instanceof RequestGetMessagesListing) {
                    } else if (message.obj instanceof RequestGetMessagesListing) {
                        processMessageListing((RequestGetMessagesListing) message.obj);
                        processMessageListing((RequestGetMessagesListing) message.obj);
                    }
                    }
@@ -605,6 +609,9 @@ final class MceStateMachine extends StateMachine {
            if (DBG) {
            if (DBG) {
                Log.d(TAG, "got a status for " + handle + " Status = " + status);
                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;
            PendingIntent intentToSend = null;
            // ignore the top-order byte (converted to string) in the handle for now
            // ignore the top-order byte (converted to string) in the handle for now
            String shortHandle = handle.substring(2);
            String shortHandle = handle.substring(2);