Fix crash on AOSP build caused by optimized method