port changes from https://github.com/Quarx2k/android_device_moto_jordan-common