meta模式是mtk提供的一种测试的模式。常常在工厂测试中使用,他不用载入整个android系统,就跟recovery模式一样,是一种启动模式。常用的启动模式有
1.normal(就是正常用手机的模式啦)
2.recovery(刷机的时候用)
3.meta模式(工厂测试的时候常常用,不用加载庞大的android系统,减少检测硬件好坏的干扰)
使用adb指令可以进入不同的模式
adb reboot meta
adb reboot recovery
应用层面可以用PowerManager.reboot方法实现
PowerManager powerManager = (PowerManager)this.getSystemService(Context.POWER_SERVICE);
powerManager.reboot(PowerManager.REBOOT_META_WIFI ); //进入meta的wifi测试
下面深入系统看看是怎么进入meta模式的
在PowerManager 中调用reboot方法
public static final String REBOOT_META_WIFI = "meta_wifi";
public void reboot(String reason) {
try {
mService.reboot(false, reason, true);//mService会通过binder调用到PowerManagerService
} catch (RemoteException e) {
}
}
进入PowerManagerService的reboot方法
publi