gpt4 book ai didi

android - 如何在 Android 设备上禁用 "air command"?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:02:44 24 4
gpt4 key购买 nike

您好,我开发了一个使用手写笔(例如三星笔)的应用程序。如您所知,当我们点击手写笔上的某个按钮时,会出现“Air command”(弹出窗口)。我的目标是“空中命令覆盖到我的自定义函数中

首先,我从“*SpenHoverListener”(Samsung Spen SDK 5.0 支持)开始,并按如下方式覆盖 onHover 函数。

private SpenHoverListener mHoverListener = new SpenHoverListener() {
@Override
public boolean onHover(View view, MotionEvent event) {
Log.e("Test",""+event.getButtonState());
updateHoverUI(event.getRawX(), event.getRawY(), event.getPressure(), event.getAction(), "Hover");
return true;
}
};

我可以成功监听按钮点击事件(BUTTON_STYLUS_PRIMARY => 按钮被点击)。 但是,我无法禁用空中命令

有什么方法可以禁用空中指令吗?

最好的问候。

最佳答案

序言

在以前的笔记本模型和平板电脑中可以禁用 Air command .
在 Marshmallow(版本 6)上,没有这样的开关
要关闭 Samsung Galaxy Note 4(发布时)的浮窗指令功能:

Go to Settings > Controls.
Tap on S Pen.
Tap on Air Command.
Disable Air Command.

Air 命令(packagecom.samsung.android.service.aircommand)是通过 system service 实现的.

代码

理论上不能以编程方式删除/禁用此 Air 服务(权限)并且作为系统服务似乎 在硬件事件上获得优先权(您稍后/也得到它们,如果 Air 处于 Activity 状态,现在停止为时已晚)。话虽如此Greenify这样做所以我寻找其他选择并找到Brevent .这是 GitHub (AS 3) 上完全免费的源代码,我现在正在玩它(请注意它包含 C 代码,所以如果你想构建它,需要 NDK或查看 ->)。 Brevent Play Store

空中指令在 Galaxy Note 5 中是灰色的

对于用户here这个graying out是一个问题,对你来说它可能是一个解决方案。

这里有一些选择评论:

Some owners reported that air command in Galaxy Note 5 was grayed out. The cause of grayed out Galaxy Note 5 air command is usually due to some accessibility settings (Go to Accessibility and switch on Voice Assistant ?). Actually, when you enabled such accessibility settings, there were the warning message on air command. But most of time, nobody reads it.

I have a galaxy note 5 and everything was fine until the device suggest me to update its android software from 5.1.1 to 6.0.1

I have Note 5 and the Air command stopped working after I installed Norton Antivirus.

绿化

对于个人用途,您可以使用“免费”应用:
(Android 版本 6+,即使没有 root!)Greenify禁用 Air Command Service(要禁用系统应用程序/服务,您需要进行小额“捐赠”,该功能被描述为“实验性").

关于android - 如何在 Android 设备上禁用 "air command"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48240232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com