led分析(app->framework->jni->hal)
来源:互联网 发布:手机恶作剧软件大全 编辑:程序博客网 时间:2024/05/21 09:01
从上往下分析
1.notification的使用(app)
/** * 发送通知 */ public void setNotification(){ /** start */ //1.得到NotificationManager: mNotificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); // 创建一个新的Notification对象,并添加图标 notification = new Notification(); // 通知显示的图标 notification.icon = R.drawable.icon_bao; // 在状态栏(Status Bar)显示的通知文本提示,如: notification.tickerText = "收到一个新的通知"; //发出提示音,如: notification.defaults |= Notification.DEFAULT_SOUND;//或// notification.sound =Uri.parse("file:///sdcard/notification/ringer.mp3");//或// notification.sound = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,"6"); //填充Notification的各个属性: Context context = getApplicationContext(); CharSequence contentTitle = "通知标题"; CharSequence contentText = "通知内容"; //点击通知跳转到哪里 Intent notificationIntent = new Intent(this,CreateMemberActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0,notificationIntent, 0); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); //在通知栏上点击此通知后自动清除此通知 notification.flags |= Notification.FLAG_AUTO_CANCEL; //LED灯闪烁 notification.defaults |= Notification.DEFAULT_LIGHTS;// 或者可以自己的LED提醒模式:// notification.ledARGB = 0xff00ff00;// notification.ledOnMS = 300; //亮的时间// notification.ledOffMS = 1000; //灭的时间// notification.flags |= Notification.FLAG_SHOW_LIGHTS; //手机振动 notification.defaults |= Notification.DEFAULT_VIBRATE;// 或// long[] vibrate = {0,100,200,300};// notification.vibrate = vibrate; //发送通知 mNotificationManager.notify(1,notification); /** end */}
NotificationManager.java(framework)
NotificationManagerService.java(framework)
mNotificationLight是一个Light对象,Light是一个抽象类,LightsService中定义了继承该类的实现类LightImpl
com_android_server_lights_LightsService.cpp(JNI)
HAL层
vendor/mediatek/proprietary/hardware/liblights/lights.c
这里可以控制各种通知对led控制的优先级
其他博客参考http://blog.csdn.net/u011630458/article/details/22280841
阅读全文
0 0
- led分析(app->framework->jni->hal)
- led HAL简单案例分析
- Android HAL JNI实例解析-led
- Android HAL JNI实例解析-led
- Android5.0编写hello从APP->framework->jni->hal->驱动的BUG
- Android GPIO LED 驱动与HAL分析(转)
- s5p4418 android 驱动 hal 应用之led 串口 rs485 can总线应用(JNI层)
- Android GPIO LED 驱动与HAL分析
- Android GPIO LED 驱动与HAL分析
- Android GPIO LED 驱动与HAL分析
- Android GPIO LED 驱动与HAL分析
- Android GPIO LED 驱动与HAL分析
- Android驱动模型(kernel-hal-framework-app)
- s5p4418 android 驱动 hal 应用之led 串口 rs485 can总线应用(app 有源码)
- JNI HAL 分析得不错的博客
- 深入浅出 - Android系统移植与平台开发(十) - led HAL简单设计案例分析
- 深入浅出 - Android系统移植与平台开发(十) - led HAL简单设计案例分析
- 深入浅出 - Android系统移植与平台开发(十) - led HAL简单设计案例分析
- 链表基础
- python常用函数
- Spring添加了注解@Transactional事务不回滚总结
- 51 NOD 1007 正整数分组(0-1背包)
- 获取浏览器指纹指引
- led分析(app->framework->jni->hal)
- 基于python3.5的scrapy框架搭建(一)
- 构建高可用、可扩展的redis集群
- Android OTA升级原理和流程分析(三)---Android系统的三种启动模式
- DataBinding使用教程(三):各个注解详解
- leetcode 241. Different Ways to Add Parentheses
- 转载博客帮助文档
- Python8:logging Module
- Linux文件系统无法mount 由superblock损坏导致