mimics https://github.com/CyanogenMod/android_vendor_cm/commit/5d4847b8e4e53bf3107c22a3f8edfb0a307e4e8c