diff options
| author | 2021-06-29 21:39:10 +0800 | |
|---|---|---|
| committer | 2021-06-29 21:47:02 +0800 | |
| commit | 08280849dc0039dd1646e12b34ef0933cb9418da (patch) | |
| tree | 6d78cfcb68269ed4ad753e9abca76f52874ffab7 /libs/androidfw/misc.cpp | |
| parent | 42bdea36536bb776451a482d26efbd3846ed33bd (diff) | |
Fix "already registered" error
Root cause:
Upon running into the method "UiAutomationManager.registerUiTestAutomationServiceLocked", after assigning "mUiAutomationService" with newly created object, the calling of "mUiAutomationService.onAdded()" may throw an exception which simply skipping the next code line "mUiAutomationService.mServiceInterface.asBinder().linkToDeath", which preventing it from getting notification when the "mServiceInterface" process dies, then, the "mUiAutomationService" will never have a chance to be clean-up-ed. And, next time, upon running into registerUiTestAutomationServiceLocked again, it has to complain "already registered".
Solution:
Move the line "mUiAutomationService.onAdded()" to after the line "linkToDeath", so that, the possible exception will not prohibit the linkToDeath operation.
Bug: 192317057
Test: monkey test for one day and one night
Co-authored-by: Zheng Xiaoying <zheng.xiaoying@gm.com>
Signed-off-by: Jintao Zhu <zhujtcsieee@gmail.com>
Change-Id: Ife4584804910290fac70dbe6d6934333f9a7486a
Diffstat (limited to 'libs/androidfw/misc.cpp')
0 files changed, 0 insertions, 0 deletions