am 9f4e67c5: Merge "Clean up native AlarmManagerService tabs/spaces and unused parameter warnings"
* commit '9f4e67c50b5c311adeaaf6135ef79214a46d0e26': Clean up native AlarmManagerService tabs/spaces and unused parameter warnings
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
|
||||
namespace android {
|
||||
|
||||
static jint android_server_AlarmManagerService_setKernelTimezone(JNIEnv* env, jobject obj, jint fd, jint minswest)
|
||||
static jint android_server_AlarmManagerService_setKernelTimezone(JNIEnv*, jobject, jint, jint minswest)
|
||||
{
|
||||
struct timezone tz;
|
||||
|
||||
@@ -55,40 +55,40 @@ static jint android_server_AlarmManagerService_setKernelTimezone(JNIEnv* env, jo
|
||||
return 0;
|
||||
}
|
||||
|
||||
static jint android_server_AlarmManagerService_init(JNIEnv* env, jobject obj)
|
||||
static jint android_server_AlarmManagerService_init(JNIEnv*, jobject)
|
||||
{
|
||||
return open("/dev/alarm", O_RDWR);
|
||||
}
|
||||
|
||||
static void android_server_AlarmManagerService_close(JNIEnv* env, jobject obj, jint fd)
|
||||
static void android_server_AlarmManagerService_close(JNIEnv*, jobject, jint fd)
|
||||
{
|
||||
close(fd);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void android_server_AlarmManagerService_set(JNIEnv* env, jobject obj, jint fd, jint type, jlong seconds, jlong nanoseconds)
|
||||
static void android_server_AlarmManagerService_set(JNIEnv*, jobject, jint fd, jint type, jlong seconds, jlong nanoseconds)
|
||||
{
|
||||
struct timespec ts;
|
||||
ts.tv_sec = seconds;
|
||||
ts.tv_nsec = nanoseconds;
|
||||
|
||||
int result = ioctl(fd, ANDROID_ALARM_SET(type), &ts);
|
||||
if (result < 0)
|
||||
{
|
||||
int result = ioctl(fd, ANDROID_ALARM_SET(type), &ts);
|
||||
if (result < 0)
|
||||
{
|
||||
ALOGE("Unable to set alarm to %lld.%09lld: %s\n", seconds, nanoseconds, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
static jint android_server_AlarmManagerService_waitForAlarm(JNIEnv* env, jobject obj, jint fd)
|
||||
static jint android_server_AlarmManagerService_waitForAlarm(JNIEnv*, jobject, jint fd)
|
||||
{
|
||||
int result = 0;
|
||||
int result = 0;
|
||||
|
||||
do
|
||||
{
|
||||
result = ioctl(fd, ANDROID_ALARM_WAIT);
|
||||
} while (result < 0 && errno == EINTR);
|
||||
do
|
||||
{
|
||||
result = ioctl(fd, ANDROID_ALARM_WAIT);
|
||||
} while (result < 0 && errno == EINTR);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
if (result < 0)
|
||||
{
|
||||
ALOGE("Unable to wait on alarm: %s\n", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
@@ -98,9 +98,9 @@ static jint android_server_AlarmManagerService_waitForAlarm(JNIEnv* env, jobject
|
||||
|
||||
static JNINativeMethod sMethods[] = {
|
||||
/* name, signature, funcPtr */
|
||||
{"init", "()I", (void*)android_server_AlarmManagerService_init},
|
||||
{"close", "(I)V", (void*)android_server_AlarmManagerService_close},
|
||||
{"set", "(IIJJ)V", (void*)android_server_AlarmManagerService_set},
|
||||
{"init", "()I", (void*)android_server_AlarmManagerService_init},
|
||||
{"close", "(I)V", (void*)android_server_AlarmManagerService_close},
|
||||
{"set", "(IIJJ)V", (void*)android_server_AlarmManagerService_set},
|
||||
{"waitForAlarm", "(I)I", (void*)android_server_AlarmManagerService_waitForAlarm},
|
||||
{"setKernelTimezone", "(II)I", (void*)android_server_AlarmManagerService_setKernelTimezone},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user