I want to encapsulate screenrecord command by java code and invoke it in android application. Luckly I can start and kill the screenrecord process with root Process, and get a valid mp4 file.
I know that I can run screenrecord command under ADB without root, so I think I could do the same thing via java code which invoke a shell, but no luck, the command will produce a file but the file size is zero.
Am I doing something wrong?
ADB has the privilege: AID_GRAPHICS, which normal application doesn't have.