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

Commit beb8f3f4 authored by chenchaoli's avatar chenchaoli Committed by Charley Chen
Browse files

ANDROID: Fix EventLog string class problem in ViewRootImpl#enqueueInputEvent()



    EventLog function can handle string,integer class and long class. (in android_util_EventLog.cpp)
    If menu title string are used bold tag(like <b>test</b>), it'll be android.text.SpannedString.
    therefore any android activity using tag menu string(like <b></b>) can be crashed by IllegalArgumentException.

    Bug: 208862322

Change-Id: I2432b0cd28c8f5fcb07cdf3e29560bf6b6c0f7b6
Signed-off-by: default avatarchenchaoli <chenchaoli@xiaomi.com>
parent c0d2b740
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -8448,13 +8448,13 @@ public final class ViewRootImpl implements ViewParent,
            MotionEvent me = (MotionEvent) event;
            MotionEvent me = (MotionEvent) event;
            if (me.getAction() == MotionEvent.ACTION_CANCEL) {
            if (me.getAction() == MotionEvent.ACTION_CANCEL) {
                EventLog.writeEvent(EventLogTags.VIEW_ENQUEUE_INPUT_EVENT, "Motion - Cancel",
                EventLog.writeEvent(EventLogTags.VIEW_ENQUEUE_INPUT_EVENT, "Motion - Cancel",
                        getTitle());
                        getTitle().toString());
            }
            }
        } else if (event instanceof KeyEvent) {
        } else if (event instanceof KeyEvent) {
            KeyEvent ke = (KeyEvent) event;
            KeyEvent ke = (KeyEvent) event;
            if (ke.isCanceled()) {
            if (ke.isCanceled()) {
                EventLog.writeEvent(EventLogTags.VIEW_ENQUEUE_INPUT_EVENT, "Key - Cancel",
                EventLog.writeEvent(EventLogTags.VIEW_ENQUEUE_INPUT_EVENT, "Key - Cancel",
                        getTitle());
                        getTitle().toString());
            }
            }
        }
        }
        // Always enqueue the input event in order, regardless of its time stamp.
        // Always enqueue the input event in order, regardless of its time stamp.