rtc 关机闹钟1 app层
private static void enableAlertPowerOn(Context context, final Alarm alarm, final long atTimeInMillis) {
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
am.cancel(MyPendingIntent);
Log.d(TAG, "** setAlert id " + alarm.mId + " atTime " + atTimeInMillis);
// Intent intent = new Intent(ALARM_ALERT_ACTION);
// Intent intent = new Intent(context, SchedulePowerOff.class);
Intent intent = new Intent(context, com.borqs.schpwronoff.SchPwrOnReceiver.class);
// XXX: This is a slight hack to avoid an exception in the remote
// AlarmManagerService process. The AlarmManager adds extra data to
// this Intent which causes it to inflate. Since the remote process
// does not know about the Alarm class, it throws a
// ClassNotFoundException.
//
// To avoid this, we marshall the data ourselves and then parcel a plain
// byte[] array. The AlarmReceiver class knows to build the Alarm
// object from the byte[] array.
Parcel out = Parcel.obtain();
alarm.writeToParcel(out, 0);
out.setDataPosition(0);
intent.putExtra(ALARM_RAW_DATA, out.marshall());
PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
MyPendingIntent = sender;
am.set(5 , atTimeInMillis, sender);
Log.d(TAG, "Alarms.enableAlertPowerOn(): setAlert id " + alarm.mId + " atTime " + atTimeInMillis);
long now = System.currentTimeMillis();
// setStatusBarIcon(context, true);
Calendar c = Calendar.getInstance();
c.setTime(new java.util.Date(atTimeInMillis));
// String timeString = formatDayAndTime(context, c);
// saveNextAlarm(context, timeString);
}
rtc 关机闹钟1 app层的更多相关文章
- rtc关机闹钟7 jni层 com_android_server_AlarmManagerService
frameworks/base/services/core/jni/com_android_server_AlarmManagerService.cpp int AlarmImplAlarmDrive ...
- rtc关机闹钟3 IAlarmManager
vim framework/base/core/java/android/app/IAlarmManager.aidl import android.app.AlarmManager;import a ...
- [RK3288][Android6.0] 调试笔记 --- 录音音量从HAL到APP层会变小问题【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/72783843?locationNum=9&fps=1 Platform: Rockc ...
- rtc关机闹钟5 AlarmManager研究
AlarmManager研究 侯 亮 转自 http://blog.csdn.net/codefly/article/details/17058425 1.概述 在Android系统中,闹钟和唤醒功能 ...
- Android 从上层到底层-----app层
CPU:RK3288 系统:Android 5.1 功能:上层 app 控制 led 亮灭 开发板:Firefly RK3288 MainActivity.java package com.aaron ...
- rtc关机闹钟2 Alarm manager
public void set(int type, long triggerAtMillis, long windowMillis, long intervalMillis, PendingInten ...
- rtc关机闹钟6 AlarmManagerService研究
这个是 private void setLocked(int type, long when) { if (mNativeData != 0) { // The kernel n ...
- rtc关机闹钟4 AlarmManagerService.java
vim base/services/core/java/com/android/server/AlarmManagerService.java AlarmManager 调用 IAlarmManage ...
- Android Native Binder,在Native层与App交互数据
Binder底层是基于C实现的,因此可以作为Native进程与App层交互数据的渠道.其应用场景为:Native Service.Hal驱动设置.应用层JNI服务等. Android 4.4引入SEA ...
随机推荐
- C# 调用Excel 出现服务器出现意外情况. (异常来自 HRESULT:0x80010105 (RPC_E_SERVERFAULT)
C# 调用Excel 出现服务器出现意外情况. (异常来自 HRESULT:0x80010105 (RPC_E_SERVERFAULT) private Microsoft.Office.Intero ...
- ICTCLAS20160405分词系统调试过程
一.前期准备: 1.下载最新版本的资源包:CTCLAS20160405171043_ICTCLAS2016分词系统下载包 2.下载最新版本的licence:https://github.com/NLP ...
- Lucky and Good Months by Gregorian Calendar - POJ3393模拟
Lucky and Good Months by Gregorian Calendar Time Limit: 1000MS Memory Limit: 65536K Description Have ...
- 在Ubuntu14.04安装torch7笔记
http://www.linuxdiyf.com/linux/18979.html 附编译例子: https://github.com/vic-w/torch-practice
- 挑战程序2.1.5 穷竭搜索>>宽度优先搜索
先对比一下DFS和BFS 深度优先搜索DFS 宽度优先搜索BFS 明显可以看出搜索顺序不同. DFS是搜索单条路径到 ...
- Life is short
相信不少码农曾看过类似“life is short, use Python”等之类略带调侃意味的小段子(譬如我),而其也并非不无道理.每门编程语言都是合理的存在,都有它们的优点,及缺陷. 码农们也大多 ...
- 兼容IE7音乐播放器之jplayer的使用
首先列出为何要写这篇随笔的原因: 1:兼容IE7 2:音乐播放器 3:任意控制播放器 1: 最近做的网站需要兼容IE7,在此之前已经写好了关于音乐播放的插件,火狐,IE8以上,以及谷歌浏览器等都可以随 ...
- nignx 启动,重启命令
1.查看进程号 ps -ef|grep nginx 强制停止 [root@LinuxServer ~]# pkill -9 nginx 重启 1.验证nginx配置文件是否正确 方法一:进入ngin ...
- 【树莓派】树莓派使用4G模块上网
想了解一下树莓派通过4G网络模块通信如何实现,看到这篇文章(http://www.lxway.com/95811506.htm),准备接下来有机会实践一下,先留存学习: 一.4G Luci配置 1. ...
- 跨站请求伪造 CSRF / XSRF<一:介绍>
跨站请求伪造(英语:Cross-site request forgery),也被称为 one-click attack 或者 session riding,通常缩写为 CSRF 或者 XSRF, 是一 ...