Ensure that IInputMethoedManager#shellCommand() is locked down
We are going to lock down IInputMethoedManager#shellCommand() based on
caller UID [1]. This CL adds explicit CTS test cases for this effort.
The point is that application can make a Binder call to
IMMS#onShellCommand() as follows if private API check can be ignored.
ServiceManager.getService(Context.INPUT_METHOD_SERVICE)
.shellCommand(in, out, err, new String[]{"ime", "list"},
null, receiver);
The newly added tests will emulate the above situation with
DeviceTestRunOptions#setDisableHiddenApiCheck(false), which internally
adds a special option '--no-hidden-api-checks' when running the
instrumentation test.
[1]: If87189563ccaacd4f9c666bab4f9ad08a9343084
Bug: 34886274
Bug: 121989657
Test: atest CtsInputMethodServiceHostTestCases:ShellCommandFromAppTest
Change-Id: Ie2415698d67ce505f6e7108ce41ec2abb5a0ca15
4 files changed