Optimize logcat fetching by using logcat -t option
WifiLogger::getOutput() sometimes takes more than a few
seconds because it fetchs the entire logcat buffer then takes
the most recent 127 lines.
Since it is a blocking call, it may increase the chance that
WifiService being killed by WatchDog.
This change uses logcat -t option, only fetching the
most recent 127 lines. It significantly reduces the time of the
blocking call.
BUG=28298654
TEST=unit tests, manual test
Manual test:
- boot device
$ adb logcat -d | wc -l
-> repeat until >127
$ adb bugreport > /tmp/bugreport
- check that ‘system log:’ section contains 127 lines.
Change-Id: Ifcfb9e53a7c8b731e76cab1f25cec1bc0c83f33e
1 file changed