I've added hooks into PhoneWindowManager which allows the user to press power + volume up start/stop screen recording. Once recording is started there is an ongoing notification that can be pressed to stop recording as well. For those that don't have volume rockers or don't like pressing those two buttons together, I have a couple commits for you to pick which will add an option to the global actions menu that is displayed when you hold down the power button.
Now for the stuff you'll need to get this up and running in your own ROM.
For the core functionality you'll need one commit from frameworks/base and one from Settings as well as the ScreenRecorder app which contains the service that does the majority of the work.
Screen Recorder app
To get these built into your ROM you will need to add a couple products to PRODUCT_PACKAGES, you can decide where you want to add this.
# Screen recorder PRODUCT_PACKAGES += \ ScreenRecorder \ libscreenrecorder
NEW - Audio recording
I currently have 3 patches
And if you want to test it out in the screenrecord binary, you can check out this patch.
And now I leave you with a couple of screenshots and a short video that was taken using this feature.
And a video showing off audio recording!