无法通过 root 访问绕过主页按钮延迟
我正在开发一个供私人使用的应用程序。问题是,我用来在按下主页按钮时启动活动的服务仍然存在 5 秒的延迟。我使用此代码授予 root 权限,并通过打开超级用户 toast 通知进行验证:
try {
Runtime.getRuntime().exec("su");
} catch (IOException exception) {
exception.printStackTrace();
}
我需要执行其他操作才能绕过规则吗?我不会使用家庭助手,它会阻止 Android 系统将 LauncherPro 保留在内存中并正常运行。
I'm developing an app for private use. The problem is that the service I'm using to launch an activity when the home button is pressed, still suffers from the 5-second delay. I used this code to grant root, and verified by turning on superuser toast notifications:
try {
Runtime.getRuntime().exec("su");
} catch (IOException exception) {
exception.printStackTrace();
}
Do I need to do anything else for it to bypass the rule? I am not going to use a home helper, it prevents android system from keeping LauncherPro in memory and running properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你说的5秒延迟是多少? Android 上没有这样的东西。我唯一能想到的是在收到 ANR 之前有 5 秒的时间限制。如果您在 UI 线程上执行操作的时间超过 5 秒,则会向用户显示 ANR 错误。
What 5-seconds delay are you talking about? There is no such thing on Android. The only thing that I can think of the 5 seconds time limit before you get an ANR. If you spend more than 5 seconds performing an action on the UI thread, an ANR error is presented to the user.
如果您的意思是从用户按主页返回主屏幕以及其他人可以启动活动将其切换离开时起的延迟,那么这是核心平台的一部分,仅以 root 身份运行并不会神奇地使其消失。
If you mean the delay from when the user presses home to return to the home screen and someone else can launch an activity to switch them away from it, this is part of the core platform and just running as root doesn't magically make it disappear.
在 widgetlocker 高级菜单中有一个 root 助手,然后您可以禁用 5 秒超时。
in widgetlocker advanced menu there is a root helper and then you can disable the 5 second timeout.