“com.android.systemui.demo” sendBroadcast - Not working?

不想你离开。 提交于 2021-02-18 18:12:21

问题


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

Link to an example

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

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

Thank you very much!


回答1:


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.



来源:https://stackoverflow.com/questions/38988529/com-android-systemui-demo-sendbroadcast-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!