frameworks/av: unified patch from Jellaxy original branch