通话过程中禁止接近传感器 [英] Disable Proximity Sensor during call

查看:262
本文介绍了通话过程中禁止接近传感器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我放弃了我的手机,看起来像我接近传感器不再可靠地工作。它返回的的所有的时间。问题是,在通话过程中显示关闭,我将无法使用数字键盘输入PIN或会议另一个呼叫,甚至挂断电话。我发现,在辅助功能设置电源键断开选项并使用了。

I dropped my phone and looks like my proximity sensor no longer works reliably. It returns Near all the time. The problem is, the display turns off during call and I wont be able to use the number pad to enter pin or conference another call, or even disconnect the call. I found the Power button disconnect option in Accessibility settings and uses that now.

我试图创建一个应用程序,试图获得一个时接到电话希望它会继续在显示屏上全wakelock。

I tried to create an app that tries to obtain a full wakelock when a call is received hoping that it will keep the display on.

  • 创建一个广播接收器调用服务的时候,手机状态改变为OFFHOOK

  • Created a broadcast receiver that invokes a service when the phone state changes to OFFHOOK

该服务获得一个完整的wakelock并释放它,只有当手机状态是空闲的。

The service acquires a full wakelock and releases it only when phone state is IDLE.

但尽管如此,接近传感器关闭显示。我用了isHeld()方法来确保已获得了锁。我用电源管理器的isScreenOn()方法,它返回真实的,即使当屏幕在通话过程中是关闭的。我试图获得wakelocks每两个第二测试循环中,仍然显示不上去。

But still, proximity sensor turns the display off. I used the isHeld() method to make sure that the lock is acquired. I used PowerManager's isScreenOn() method and it returned true even when the screen was off during the call. I tried to obtain the wakelocks every two second in a loop for testing, still the display won't come up.

我使用的是一台Nexus 5的Andr​​oid版本4.4.4

I'm using a Nexus 5 Android version 4.4.4

任何人都可以提出一个想法,以覆盖接近传感器的行为?根要求的选项也很好。

Can anyone suggest an idea to override the proximity sensor behaviour? A root-required option is also fine.

谢谢!

推荐答案

我发现我的解决方案的这里。 基本上使用的应用程序称为接近屏幕关闭精简版 并设置如下:

I found my solution here. Basically use an app called Proximity Screen Off Lite and set it as below:

  1. 屏幕开/关模式 检查封面并保持打开屏幕 超时:1秒 选中禁用Accidentla锁 超时:4秒

  1. Screen On/Off Modes Check "Cover and hold to turn on Screen" Timeout: 1 second Check "Disable Accidentla Lock" Timeout: 4 seconds

所有的设置 选中禁用Lanscape 选中锁定的手机屏幕上的

All settings Check "Disable in Lanscape" Check "Lock phone on screen ON"

[高级]配置Sensore 选择传感器:接近传感器 当传感器覆盖值:0 当传感器未覆盖的价值:1

[Advanced] Configure Sensore Select sensor: Proximity sensor Value when sensor covered: 0 Value when sensor un-covered: 1

这篇关于通话过程中禁止接近传感器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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