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

Skip to content
Commit f750aa8e authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

InputDispatcher: Properly store values inside optional

Before this CL, we were storing values inside the optional incorrectly.
The variable was first dereferenced (which is always valid, even if
there's no value contained inside), and then the value was stored.
However, the optional bool flag itself was not updated. As a result, the
assertion ALOG_ASSERT was failing. This was not observed in our runs
likely due to the behaviour of ALOG_ASSERT.

The failure could be reproduced when this was switched to LOG_IF(FATAL
locally. The test `PolicyNotifiedForUnhandledKey` was hitting that
assertion and failing.

The incorrect behaviour was introduced in ag/22679128: Use std::map
for fallback keys.

In this CL, the code is changed to properly update the optional and to
crash always when the unexpected condition occurs.

Bug: 377853843
Flag: EXEMPT bugfix
Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
Change-Id: I1f74ff11ac62fcf577ecd146067858d43adc0288
parent 20f9ecf0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment