Patched for AOSP from CM