imported latest upstream patches from CM11 repo