summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorJacky Kao <jackykao@google.com>2021-04-07 10:41:52 +0800
committerJacky Kao <jackykao@google.com>2021-04-20 13:20:13 +0800
commit8048d256c2ad86d4e1dacabd6041a6f03a5fbe32 (patch)
tree2dff581f4bee3eb226ec4a4bee3814a9b418e4ac /tools/aapt2/java/JavaClassGenerator_test.cpp
parent9dea87c0d168d655e939ba524b7233c686b2cfdf (diff)
Fix the crash due to multi-register callbacks
For multi-display device, like pixel_jumbojack, when this device is folded, the secondary display is removed. The A11y framework stops tracking windows on the removed display by un-registering its callback. When the A11y framework un-registers a callback, it checks if the display is embedded. If it is, the observer is not removed since the same observer will be observing the parent display. When the display disappears entirely, however, its context disappears and there's no way to know if it was embedded or not. The observer was therefore not removed. When the device is unfolded and the display reappears, the attempt to register an observer causes an exception because the previous one is still there. Due to there's no multi-display device for android S now, so we adopt simple solution as below to fix it: 1. Throws the exception for debug builds only. 2. Adds this exception into the error log. 3. Recovers by unregistering the current observer and proceeding to register the new one The fully solution will phase in the master. Bug: 182963008 Test: a11y CTS & unit tests Change-Id: Iff9776ac6e054c0198c0d8739d9446a785716612
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions