summaryrefslogtreecommitdiffstats
path: root/services/java/com/android
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2013-12-17 20:09:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-17 20:09:09 +0000
commit10df052c6a6cf74ef08ed5f28a45aade07b9796d (patch)
treeaaf3a863a22b75a15fc1837875947f25d724d2ac /services/java/com/android
parentbd6877f968a83435e1f59013eb1689e1a3b54a4e (diff)
parentf1bdbdd1bea9662f6731b7a366de1f602f43e5a9 (diff)
downloadframeworks_base-10df052c6a6cf74ef08ed5f28a45aade07b9796d.zip
frameworks_base-10df052c6a6cf74ef08ed5f28a45aade07b9796d.tar.gz
frameworks_base-10df052c6a6cf74ef08ed5f28a45aade07b9796d.tar.bz2
am f1bdbdd1: resolved conflicts for merge of 08579921 to klp-modular-dev
* commit 'f1bdbdd1bea9662f6731b7a366de1f602f43e5a9': Add timerfd backend to AlarmManagerService
Diffstat (limited to 'services/java/com/android')
-rw-r--r--services/java/com/android/server/AlarmManagerService.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
index 1fb164d..3cdf170 100644
--- a/services/java/com/android/server/AlarmManagerService.java
+++ b/services/java/com/android/server/AlarmManagerService.java
@@ -98,7 +98,7 @@ class AlarmManagerService extends SystemService {
final Object mLock = new Object();
- int mDescriptor;
+ long mNativeData;
private long mNextWakeup;
private long mNextNonWakeup;
int mBroadcastRefCount = 0;
@@ -462,7 +462,7 @@ class AlarmManagerService extends SystemService {
@Override
public void onStart() {
- mDescriptor = init();
+ mNativeData = init();
mNextWakeup = mNextNonWakeup = 0;
// We have to set current TimeZone info to kernel
@@ -488,7 +488,7 @@ class AlarmManagerService extends SystemService {
mClockReceiver.scheduleDateChangedEvent();
mUninstallReceiver = new UninstallReceiver();
- if (mDescriptor != -1) {
+ if (mNativeData != 0) {
AlarmThread waitThread = new AlarmThread();
waitThread.start();
} else {
@@ -501,7 +501,7 @@ class AlarmManagerService extends SystemService {
@Override
protected void finalize() throws Throwable {
try {
- close(mDescriptor);
+ close(mNativeData);
} finally {
super.finalize();
}
@@ -529,7 +529,7 @@ class AlarmManagerService extends SystemService {
// Update the kernel timezone information
// Kernel tracks time offsets as 'minutes west of GMT'
int gmtOffset = zone.getOffset(System.currentTimeMillis());
- setKernelTimezone(mDescriptor, -(gmtOffset / 60000));
+ setKernelTimezone(mNativeData, -(gmtOffset / 60000));
}
TimeZone.setDefault(null);
@@ -975,7 +975,7 @@ class AlarmManagerService extends SystemService {
}
private void setLocked(int type, long when) {
- if (mDescriptor != -1) {
+ if (mNativeData != 0) {
// The kernel never triggers alarms with negative wakeup times
// so we ensure they are positive.
long alarmSeconds, alarmNanoseconds;
@@ -987,7 +987,7 @@ class AlarmManagerService extends SystemService {
alarmNanoseconds = (when % 1000) * 1000 * 1000;
}
- set(mDescriptor, type, alarmSeconds, alarmNanoseconds);
+ set(mNativeData, type, alarmSeconds, alarmNanoseconds);
} else {
Message msg = Message.obtain();
msg.what = ALARM_EVENT;
@@ -1031,11 +1031,11 @@ class AlarmManagerService extends SystemService {
}
}
- private native int init();
- private native void close(int fd);
- private native void set(int fd, int type, long seconds, long nanoseconds);
- private native int waitForAlarm(int fd);
- private native int setKernelTimezone(int fd, int minuteswest);
+ private native long init();
+ private native void close(long nativeData);
+ private native void set(long nativeData, int type, long seconds, long nanoseconds);
+ private native int waitForAlarm(long nativeData);
+ private native int setKernelTimezone(long nativeData, int minuteswest);
void triggerAlarmsLocked(ArrayList<Alarm> triggerList, long nowELAPSED, long nowRTC) {
// batches are temporally sorted, so we need only pull from the
@@ -1175,7 +1175,7 @@ class AlarmManagerService extends SystemService {
while (true)
{
- int result = waitForAlarm(mDescriptor);
+ int result = waitForAlarm(mNativeData);
triggerList.clear();
@@ -1357,7 +1357,7 @@ class AlarmManagerService extends SystemService {
// daylight savings information.
TimeZone zone = TimeZone.getTimeZone(SystemProperties.get(TIMEZONE_PROPERTY));
int gmtOffset = zone.getOffset(System.currentTimeMillis());
- setKernelTimezone(mDescriptor, -(gmtOffset / 60000));
+ setKernelTimezone(mNativeData, -(gmtOffset / 60000));
scheduleDateChangedEvent();
}
}