InCallScreen.java/enableTouchLock(boolen enable)方法分析
来源:互联网 发布:苹果windows系统黑屏 编辑:程序博客网 时间:2024/04/29 19:49
该函数是设置是否需要在通话是锁屏(双击屏幕解锁)的, 因为在通话时脸颊会贴近电容屏,导致误操作
如果参数enable为真,
1,如果不在通话,直接返回
2,扬声器工作,返回,因为扬声器工作的话脸颊不用贴近
3,如果锁没有构造,则构造一个锁
4,消失菜单
5,将锁淡入
如果参数为假,且锁不为null,使锁消失,函数源代码如下
private void enableTouchLock(boolean enable) {
if (VDBG) log("enableTouchLock(" + enable + ")...");
if (enable) {
// The "touch lock" overlay is only ever used on top of the
// DTMF dialpad.
if (!mDialer.isOpened()) {
if (VDBG) log("enableTouchLock: dialpad isn't up, no need to lock screen.");
return;
}
// Also, the "touch lock" overlay NEVER appears if the speaker is in use.
if (PhoneUtils.isSpeakerOn(getApplicationContext())) {
if (VDBG) log("enableTouchLock: speaker is on, no need to lock screen.");
return;
}
// Initialize the UI elements if necessary.
if (mTouchLockOverlay == null) {
initTouchLock();
}
// First take down the menu if it's up (since it's confusing
// to see a touchable menu *above* the touch lock overlay.)
// Note dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
// Bring up the touch lock overlay (with an animated fade)
mTouchLockOverlay.setVisibility(View.VISIBLE);
mTouchLockOverlay.startAnimation(mTouchLockFadeIn);
} else {
// TODO: it might be nice to immediately kill the animation if
// we're in the middle of fading-in:
// if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
// mTouchLockOverlay.clearAnimation();
// }
// but the fade-in is so quick that this probably isn't necessary.
// Take down the touch lock overlay (immediately)
if (mTouchLockOverlay != null) mTouchLockOverlay.setVisibility(View.GONE);
}
}
- InCallScreen.java/enableTouchLock(boolen enable)方法分析
- InCallScreen.java/updateScreen()分析
- 来电接听InCallScreen界面源码分析
- InCallScreen是什么
- Bluetooth 分析Enable流程
- NFC Enable 过程分析(三)
- 蓝牙开启流程(enable)分析
- OutgoingCallBroadcaster启动InCallScreen流程
- C语言实现Boolen数据类型
- Boolen()函数的转换结果
- Android4.2蓝牙Enable完全分析
- Android4.2蓝牙Enable完全分析
- Android4.2蓝牙Enable完全分析
- # Android6.0 之Bluetooth Enable流程分析
- java 静态方法分析
- Android 4.2 InCallScreen UI浅析
- Android 4.2 InCallScreen UI浅析
- Android 4.2 InCallScreen UI浅析
- ifconfig 命令的用法
- [lucene]倒排笔记
- 优秀驾驶员开车技巧
- SPSS学习
- 结合Maven2进行J2EE项目构建
- InCallScreen.java/enableTouchLock(boolen enable)方法分析
- 对于Struts框架中的令牌机制
- 空闲期
- 移植2.6.30.4到MINI2440的学习笔记
- Maven入门--概念与实例
- 画圆并保存细分点坐标
- 端口操作 + ftp +Oracle
- hdoj1010
- JVM/JDK/JRE/IDE—区别