请问,应用发了这个广播后,android系统是不是会重启?

huabinsir 2014-11-19 10:44:55
请问,应用发了这个广播后,android系统是不是会重启? android系统( 有SDK系统源码包)中是不是有服务接到这个广播,就要会进行重启动作?

Intent in= new Intent("android.intent.action.MASTER_CLEAR");
sendBroadcast(in);

...全文
130 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shenzhentom 2014-11-19
  • 打赏
  • 举报
回复
可以android SDK 源码中 search "android.intent.action.MASTER_CLEAR"字符串。 MasterClearReceiver.java onReceive() 中有关于收到"android.intent.action.MASTER_CLEAR" 的处理.
heaven_wsh 2014-11-19
  • 打赏
  • 举报
回复
这个获取权限后,应该是进行工厂重设的,可以参考一下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);
        }
    }

80,359

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧