" com.android.systemui.demo"sendBroadcast-无法正常工作? [英] "com.android.systemui.demo" sendBroadcast - Not working?

查看:80
本文介绍了" com.android.systemui.demo"sendBroadcast-无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式成功激活Android状态栏的演示模式?我已经尝试过这种方法,但没有成功:

How can I successfully activate the demo mode for the status bar in android programmatically? I already tried this approach without any success:

链接到示例

// Enable demo mode
Intent intent = new Intent("com.android.systemui.demo");
intent.putExtra("command", "enter");
sendBroadcast(intent);

有人能成功完成此工作吗?adb命令可以正常工作.

Did anyone get this to work successfully? The adb commands are working without an issue.

非常感谢!

推荐答案

我发现,没有系统应用程序不可能以编程方式执行此操作.需要仅授予系统应用程序的"android.permission.DUMP"权限.我将寻找替代方案.

I found out that it's not possible for not system apps to do this programmatically. Requires the "android.permission.DUMP" permission wich is only granted to system apps. I'll search for an alternative.

这篇关于" com.android.systemui.demo"sendBroadcast-无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆