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: chenchaoli <chenchaoli@xiaomi.com>
This commit is contained in:
chenchaoli
2021-12-03 13:39:10 +08:00
committed by Charley Chen
parent c0d2b740f0
commit beb8f3f4b3

View File

@@ -8448,13 +8448,13 @@ public final class ViewRootImpl implements ViewParent,
MotionEvent me = (MotionEvent) event;
if (me.getAction() == MotionEvent.ACTION_CANCEL) {
EventLog.writeEvent(EventLogTags.VIEW_ENQUEUE_INPUT_EVENT, "Motion - Cancel",
getTitle());
getTitle().toString());
}
} else if (event instanceof KeyEvent) {
KeyEvent ke = (KeyEvent) event;
if (ke.isCanceled()) {
EventLog.writeEvent(EventLogTags.VIEW_ENQUEUE_INPUT_EVENT, "Key - Cancel",
getTitle());
getTitle().toString());
}
}
// Always enqueue the input event in order, regardless of its time stamp.