Add a command line interface to SystemUI
This CL adds some basic support for a command line interface in SystemUI, using `adb shell cmd` as the jump-off point. The basic design is kind of as follows: [ shell ] -> [ system_server ] -> [ StatusBarService ] -> [ SystemUI ] | [ shell output ] <- [ sbm service ] <- [ CommandRegistry ] Where StatusBarManagerService implements a new `passthrough` interface and forwards all remaining arguments to SystemUI. SystemUI then spawns a new thread and sends the commands off to the CommandRegistry. Commands are parsed and executed from there, and all output is written to the given ParcelFileDescriptor, which is piped back to SBMService using a TransferPipe. Commands will by default run on the main executor, but can register with an executor in order to send work off to any other thread. The command registry thread will block on the completion of the command. Implementing new commands as of now is trivial: create a new concrete implementation of CommandLine and add it to the command map inside of CommandRegistry. Test: `adb shell cmd statusbar prefs list-prefs` should have output Change-Id: I189fa55df6caabe25d693c2241a4d994e7473a2c
Loading
Please register or sign in to comment