1 android 5.0, encrypt phone,必须电量达到80%以上.
packages/apps/Settings ./src/com/android/settings/CryptKeeperSettings.java // Minimum battery charge level (in percent) to launch encryption. If the battery charge is // lower than this, encryption should not be activated. private static final int MIN_BATTERY_LEVEL = 1;2 setMobileDataEnabled() 4.4和之前版本是可用的,android 5.0之后, 所以不能通过代码反射,只能手动去关闭mobile data(uiautormator也可以呀) 4.4 code:
5.1 code:
http://stackoverflow.com/questions/26539445/the-setmobiledataenabled-method-is-no-longer-callable-as-of-android-l-and-later
3 Anroid 升级到M之后,很多代码发生变化。有些代码只能在M上使用,会提示 Call requires API level 23 (current min is 。。) 。这时候需要区分注明这个只能在M上用,可以加:
@TargetApi(Build.VERSION_CODE.M)
4