dumpstate: calculate logcat timeout using readable buffer size

Calculate logcat timeout using readable buffer size instead of the
allotted buffer size for three reasons:

1) With log buffer compression, the readable buffer size may be much
larger than the consumed buffer size, so the timeout should be based
on the former.

2) __android_logger_get_buffer_size() reports the wrong value if
`logcat -G` is used to set the log buffer size, since that directly
informs logd of the new size, without writing to the properties.

3) Given 2), __android_logger_get_buffer_size() is an implementation
detail for logd and should not be generally used.  The
android_logger_get_log_*_size() functions should be used instead.
Future CLs will remove __android_logger_get_buffer_size() from liblog.

Test: bug reports capture logcat correctly
Test: bug reports succeed if `logd` is stopped, after timing out when
      reading from logcat
Change-Id: Iac5dcba4f729c022073a812b48cd028ca2d59e52
1 file changed