问题描述
我放弃了我的手机,看起来像我接近传感器不再可靠地工作。它返回的近的所有的时间。问题是,在通话过程中显示关闭,我将无法使用数字键盘输入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的Android版本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 Liteand set it as below:
-
屏幕开/关模式检查封面并保持打开屏幕超时:1秒选中禁用Accidentla锁超时:4秒
Screen On/Off ModesCheck "Cover and hold to turn on Screen"Timeout: 1 secondCheck "Disable Accidentla Lock"Timeout: 4 seconds
所有的设置选中禁用Lanscape选中锁定的手机屏幕上的
All settingsCheck "Disable in Lanscape"Check "Lock phone on screen ON"
[高级]配置Sensore选择传感器:接近传感器当传感器覆盖值:0当传感器未覆盖的价值:1
[Advanced] Configure SensoreSelect sensor: Proximity sensorValue when sensor covered: 0Value when sensor un-covered: 1
这篇关于通话过程中禁止接近传感器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!