Add "cmd input_method tracing save-for-bugreport"
This CL reworks our previous CL [1], which enabled "adb bugreport" to
include ime-tracing files into bugreport with some unpleasant
side-effect described in Bug 177462676.
Basically what this CL aims to do is to mirror my CL [2] for
InputMethodManagerService. Instead of relying on heuristics, this CL
introduces a clear and dedicated command
adb shell cmd input_method tracing save-for-bugreport
so that "adb bugreport" can explicitly tell IMMS to dump the tracing
files.
See the corresponding CL for frameworks/native [3] about how it's
triggered from "adb bugreport".
[1]: Ie87eb8423e2bb70f28c330983d45b95e2e07062d
ac24994aaa5bd1f70608cb8c72b93b5ae00d90eb
[2]: I887ae6941b4844a606675b447f67ecee88d7f192
96a51f9971ed7559c17d4f9aff98c83b2fa28f4a
[3]: I62105334e4efbb4514390ffa8be5416482ca3b29
02b1d2c70b2f4703a9dd51ba69d78604d66916e1
Bug: 177462676
Test: Manually done as follows.
1. adb shell cmd input_method tracing start
2. adb logcat -d -s imeTracing:*
Make sure ime tracing is running
3. adb shell dumpsys input_method \
--dump-priority CRITICAL --proto > /dev/null
4. adb logcat -d -s imeTracing:*
Make sure ime tracing has not been stopped.
5. adb shell cmd input_method tracing save-for-bugreport
6. adb logcat -d -s imeTracing:*
Make sure ime-tracing was dumped and is still running.
7. adb root && adb shell ls /data/misc/wmtrace/ -al
Make sure ime tracing files are saved.
Test: Manually done as follows.
1. adb shell cmd input_method tracing start
2. adb logcat -d -s imeTracing:*
Make sure ime tracing is running
3. adb bugreport bugreport.zip
4. adb logcat -d -s imeTracing:*
Make sure ime-tracing was dumped and is still running.
5. unzip -v bugreport.zip | grep ime_trace_
Make sure ime_trace_{clients,service,managerservice}.pb are
included.
Change-Id: Ib106e077a10eb6a4f37b38aa9172e7c99a81f898
4 files changed