请问,应用发了这个广播后,android系统是不是会重启? android系统( 有SDK系统源码包)中是不是有服务接到这个广播,就要会进行重启动作?
Intent in= new Intent("android.intent.action.MASTER_CLEAR");
sendBroadcast(in);
------解决思路----------------------
这个获取权限后,应该是进行工厂重设的,可以参考一下Settings的代码(你确定你不是在做什么邪恶的功能吗?)
private void showFactoryReset() {
// Hide the encryption-bot to make room for the "factory reset" button
findViewById(R.id.encroid).setVisibility(View.GONE);
// Show the reset button, failure text, and a divider
final Button button = (Button) findViewById(R.id.factory_reset);
button.setVisibility(View.VISIBLE);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Factory reset the device.
sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
}
});
// Alert the user of the failure.
((TextView) findViewById(R.id.title)).setText(R.string.crypt_keeper_failed_title);
((TextView) findViewById(R.id.status)).setText(R.string.crypt_keeper_failed_summary);
final View view = findViewById(R.id.bottom_divider);
// TODO(viki): Why would the bottom divider be missing in certain layouts? Investigate.
if (view != null) {
view.setVisibility(View.VISIBLE);
}
}
------解决思路----------------------
可以android SDK 源码中 search "android.intent.action.MASTER_CLEAR"字符串。
MasterClearReceiver.java onReceive() 中有关于收到"android.intent.action.MASTER_CLEAR" 的处理.