Squashed Optimization commits

https://github.com/LiquidSmooth/android_build/commit/151bdb50158cf0485c4fa1e3b6429a8f2848f8ff
https://github.com/LiquidSmooth/android_build/commit/ca950e96a95a0fcd635a3ce405e4166a5baf44c0

Credit/Thanks topbeeler, Cl3Kener and LiquidSmooth