pick code from android 4.2, fix media scanner slow issue