Chinaunix首页 | 论坛 | 博客
  • 博客访问: 463625
  • 博文数量: 65
  • 博客积分: 573
  • 博客等级: 中士
  • 技术积分: 693
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-09 17:16
文章分类

全部博文(65)

文章存档

2015年(12)

2014年(9)

2013年(22)

2012年(7)

2011年(15)

分类: Android平台

2014-09-15 09:03:13

简单使用:
(1)定义一个结构体
    struct early_suspend Test_early_suspend;
 (2)注册:
    Test_early_suspend .level = 0x02;//EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1; //等级,等级大小和suspend顺序一致,和resume顺序相反
    //即此次休眠执行在EARLY_SUSPEND_LEVEL_BLANK_SCREEN 之后执行。
    Test_early_suspend .suspend = test_suspend;
    Test_early_suspend .resume = tset_resume;
     register_early_suspend(&Test_early_suspend );
(3)休眠唤醒函数的实现
static void test_suspend (struct early_suspend *handler)
{
    print_debug("run to %s\n", __func__);

}
static void tset_resume (struct early_suspend *handler)
{
    print_debug("run to %s\n", __func__);
}
(4)模块删除时取消:
            unregister_early_suspend(&Test_early_suspend );
阅读(2370) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~