diff options
author | Yohei Yukawa <yukawa@google.com> | 2018-12-28 13:21:52 -0800 |
---|---|---|
committer | Yohei Yukawa <yukawa@google.com> | 2018-12-28 13:21:52 -0800 |
commit | e14bda80851a137214ab2991e73e5a80ca9e2517 (patch) | |
tree | 980130e1e60421eeb1933a27b6053e5b8e53b7a9 /tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp | |
parent | ade742872ce1e6044580af0f27d9a9299d7b269b (diff) |
Avoid unnecessary File.delete() for nonexistent directory
This is a follow up CL to my previous CL [1], which aimed to delete
/data/system/inputmethod/ when it's empty.
One thing I overlooked was the case where the directory does not exist
already. In that case, further trying to delete such a nonexistent
directory simply failed hence resulted in outputting the following
error message to logcat.
Failed to delete the empty parent directory /data/system/inputmethod
With this CL, the existence of /data/system/inputmethod/ will be
checked first to see if there is anything to clean up in the first
place.
[1]: I2307b5e4edf7b90d2fc03138f233d6051f80cf90
b1a3fdb99f5c577227fe80298f01bfbeb01322ad
Bug: 121223050
Test: Manually verified as follows
1. Build and flash aosp_taimen-userdebug into taimen
2. Wait until the device fully boots up
3. adb reboot # to avoid Bug 121259290
4. adb root
5. adb shell cat /data/system/inputmethod/subtypes.xml
-> make sure the content looks as follows:
<subtypes>
<imi id="com.android.inputmethod.latin/.LatinIME">
<subtype ....>
<subtype ....>
</imi/>
</subtypes>
6. Open AOSP Keyboard settings
7. Go to "Appearance & Layouts" -> "Custom input styles"
8. Remove all layouts
9. adb shell cat /data/system/inputmethod/subtypes.xml
-> make sure the file no longer exists
10. adb shell ls /data/system/inputmethod
-> make sure the directory no longer exists
11. adb reboot
12. adb logcat -s InputMethodManagerService:*
-> no error message about /data/system/inputmethod
Change-Id: I0428a1ec6300ef346503c53928ddbcf5bb38aab0
Diffstat (limited to 'tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp')
0 files changed, 0 insertions, 0 deletions