Adapt misc bionic patch to AOSP