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 ...
随机推荐
- 开发客户端软件时,出现System.Windows.Markup.XamlParseException错误
开发客户端软件时,出现System.Windows.Markup.XamlParseException错误,通过查看错误消息,发现TCPIP的一个COM组件在安装软件过程中被删除了,重新注册了一下TC ...
- 2D空间中判断一点是否在三角形内
要注意如果是XY坐标轴的2D空间,要取差乘分量z而不是y. 实现原理是,将三角形ABC三个边(AB,BC,CA)分别与比较点判断差乘,如果这3个差乘结果表示的方向一致,说明就在三角形内. 效果: 代码 ...
- (9) 深入了解Java Class文件格式(八)
转载:http://blog.csdn.net/zhangjg_blog/article/details/22205831 在本专栏的第一篇文章 深入理解Java虚拟机到底是什么 中, 我们主要讲解了 ...
- Javascript > Eclipse > problems encountered during text search
Reproduce: Ctrl + H, Select "File Search", will encounter eclipse kinds of bug/error alert ...
- SuiteScript > Apply script to Assembly and Kit
Path: Customization > Scripting > Scripts > New Limitation: Client script can't apply to As ...
- SVN服务器搭建和使用(一)
SVN服务器搭建和使用(一) Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说. 首先来下载和搭建SVN服务器. 现在Subversion已经迁移到apache网站上 ...
- AngularJs开发环境搭建
1. 安装Sublime Text3 常用插件安装:AngularJs, Autoprefixer, BracketHighlighter,ConvertToUTF8,CSScomb,DocBlock ...
- 【2014-05-06】C++ 设计模式----单例模式
1.何为单例模式? 单例模式(Singleton),保证一个类仅有一个实例,并提供一个访问它的全局访问点(static).可能有人会想这和全局变量有什么区别呢? 通常我们可以让一个全局成员变量使得一个 ...
- ASP.NET中的文件操作(文件信息,新建,移动,复制,重命名,上传,遍历)(亲测详细)
做了几天的文件操作,现在来总结一下,错误之处,还望指点!以文件为例,如果对文件夹操作,基本上将File换为Directory即可(例:FileInfo file = new FileInfo(Path ...
- 升级openssl环境至openssl-1.1.0c
升级openssl环境至openssl-1.1.0c1.查看源版本 [root@zj ~]# openssl version -aOpenSSL 1.0.1e-fips 11 Feb 2013 2.下 ...