android四种启动模式_android:windowSoftInputMode

android四种启动模式_android:windowSoftInputMode(1)添加头文件:#include(2)在特定驱动结构体中添加early_suspend结构:#ifdefCONFIG_HAS_EARLYSUSPENDstructearly_suspendearly_suspend;#endif(3)在驱动probe函数中注册相关early_suspend结构体:#ifdefCONFIG_HAS_EARLYSUSPEND


Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺


(1)添加头文件:

#include <linux/earlysuspend.h>

(2)在特定驱动结构体中添加early_suspend结构:

#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
#endif

(3)在驱动probe函数中注册相关early_suspend结构体:

#ifdef CONFIG_HAS_EARLYSUSPEND
ftk_ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
ftk_ts->early_suspend.suspend = stm_ts_early_suspend;
ftk_ts->early_suspend.resume =stm_ts_late_resume;
register_early_suspend(&ftk_ts->early_suspend);
#endif

     所有注册到系统中的early_suspend结构都会按level值按顺序加入到全局链表early_suspend_handlers中。 

     希望执行early suspend的设备,他的设备驱动程序需要向电源管理系统注册,该结构体用于向电源管理系统注册earlysuspend/lateresume,当电源管理系统启动suspend流程时,回调函数suspend会被调用,相反,resume的最后阶段,回调函数resume会被调用,level字段用于调整该结构体在注册链表中的位置,suspend时,level的数值越小,回调函数的被调用的时间越早,resume时则反过来。Android预先定义了3个level等级:

 

[cpp] 
view plain
copy

  1. enum {  
  2.     EARLY_SUSPEND_LEVEL_BLANK_SCREEN = 50,  
  3.     EARLY_SUSPEND_LEVEL_STOP_DRAWING = 100,  
  4.     EARLY_SUSPEND_LEVEL_DISABLE_FB = 150,  
  5. };  
  6. struct early_suspend {  
  7. #ifdef CONFIG_HAS_EARLYSUSPEND  
  8.     struct list_head link;  
  9.     int level;  
  10.     void (*suspend)(struct early_suspend *h);  
  11.     void (*resume)(struct early_suspend *h);  
  12. #endif  
  13. };  

 

(4)在驱动remove函数取消early_suspend结构体的注册:

#ifdef CONFIG_HAS_EARLYSUSPEND
unregister_early_suspend(&ts->early_suspend);
#endif

(5)定义相关suspend和resume函数:

#ifdef CONFIG_HAS_EARLYSUSPEND
static void stm_ts_early_suspend(struct early_suspend *h)
{

struct ftk_ts *ts;
ts = container_of(h, struct ftk_ts, early_suspend);
stm_ts_suspend(ts->client, PMSG_SUSPEND);
}

static void stm_ts_late_resume(struct early_suspend *h)
{

struct ftk_ts *ts;
ts = container_of(h, struct ftk_ts, early_suspend);
stm_ts_resume(ts->client);
}
#endif

(6)在系统驱动结构体中设置未使用earlysuspend的函数接口:

#ifndef CONFIG_HAS_EARLYSUSPEND
.suspend = stm_ts_suspend,
.resume = stm_ts_resume,
#endif

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/192134.html原文链接:https://javaforall.net

赞 (0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 淡蓝风格的手机登录HTML模板

    查看效果:http://hovertree.com/texiao/mobile/10/或者手机扫描二维码查看效果:效果图:代码如下:转自:http://hovertree.com/h/bjaf/l

    2021年12月22日
  • P3P解决cookie跨域

    P3P解决cookie跨域P3P是什么P3P(PlatformforPrivacyPreferences)是W3C公布的一项隐私保护推荐标准,以为用户提供隐私保护。 P3P标准的构想是:Web站点的隐私策略应该告之访问者该站点所收集的信息类型、信息将提供给哪些人、信息将被保留多少时间及其使用信息的方式,如站点应做诸如“本网站将监测您所访问的页面以提高站点的使用率”或“本网站将尽可能为您提供更合适的广告”等

    2022年11月2日
  • C# winform美化窗体

    C# winform美化窗体记录一下winform美化工具CSkin一个.Net的UI库。参考链接:https://blog.csdn.net/yyl7727/article/details/78904125?spm=1001.2014.3001.5502

    2022年5月24日
  • PyCharm配置_pycharm安装配置

    PyCharm配置_pycharm安装配置pycharmpycharm是一个比较好的pythonIDE,可以在MACOS和windows上使用,补全功能强大,而且界面十分友好,特别适合python编程人员使用。pycharmPycharm安装Pycharm配置修改成灰底主题显示行号修改字体大小编程字体我推荐运行调试Pycharm安装pycharm的安装地址:http://www.jetbrains.com/

    2022年8月26日
  • SM4加密运算_数据加密标准des采用的密码类型是

    SM4加密运算_数据加密标准des采用的密码类型是javaSM4加密运算自己的理解:sm4加密,其实就是将字符串转成byte数组,再设置一个与解密相同的字符串,将byte的数据再转成二级制的数据,进行异或的运算,得到一组没有规则的字符串!案例上面是一些算法下面是应用方法这是自己的认知,有什么不同建议可以留言,XXXX是自己加密的字符串…

    2022年10月6日
  • 安装pycharm教程最新版激活_Mac序列号

    安装pycharm教程最新版激活_Mac序列号激活码+汉化+Python安装包汉化下载汉化包resources_en.jar找到Pycharm,右键点击显示包内容,把resources_en.jar拷贝到/Applications/PyCharmCE.app/Contents/lib/里面重启Pycharm激活目前比较好用的Python开发工具是PyCharm,但是正版软件需要购买,要不然只能试…

    2022年8月28日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号