是否可以关闭带有android辅助功能服务的手机
无障碍服务为我们提供了一种为用户采取行动的方法,是否可以使用此功能关闭手机?如代码所示:是否可以关闭带有android辅助功能服务的手机,android,accessibility,shutdown,Android,Accessibility,Shutdown,无障碍服务为我们提供了一种为用户采取行动的方法,是否可以使用此功能关闭手机?如代码所示: public class MyAccessibilityService extends AccessibilityService { @Override public void onAccessibilityEvent(AccessibilityEvent event) { // get the source node of the event AccessibilityNodeInfo
public class MyAccessibilityService extends AccessibilityService {
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
// get the source node of the event
AccessibilityNodeInfo nodeInfo = event.getSource();
// Use the event and node information to determine
// what action to take
// take action on behalf of the user
nodeInfo.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
// recycle the nodeInfo object
nodeInfo.recycle();
}
...
}
我们能否在“//采取什么行动”部分实施“关闭”?您可以在中查看此项服务,该服务可能不是我想要的,而是我想要的thanks@AlexFlorescuCould请您澄清您想要什么,以及如何/为什么其他问题没有涵盖,以帮助人们给您一个好的答案?谢谢否,从4.4.4开始,无法从AccessibilityService.Ok关闭设备。我想通过为用户采取操作来实现“关机”,这样我就不需要请求root权限。对于其他方式,我总是被告知拥有root权限,或者只有系统应用程序有权关机。很抱歉,我的问题不清楚,英语不好,我是这里的新手。@AlexFlorescu