summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-12-10 15:14:18 +0000
committerThomas Martitz <kugel@rockbox.org>2010-12-10 15:14:18 +0000
commitc47d81345151166083ab10d6f5d11e56462056d5 (patch)
treef01d6b866113ca8998147d98425fa700db42ca48 /android
parent44cdce9b290d4ae9e1a436ef85c5b0ed56827784 (diff)
Android: Replace the java based tick timer implemented with a not as bloated and more accurate linux hrtimer based one. Further reduces idle cpu usage (0% on my phone but still 1-2% on a Samsung Galaxy S).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28784 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android')
-rw-r--r--android/src/org/rockbox/RockboxTimer.java76
1 files changed, 0 insertions, 76 deletions
diff --git a/android/src/org/rockbox/RockboxTimer.java b/android/src/org/rockbox/RockboxTimer.java
deleted file mode 100644
index ff48b3f53a..0000000000
--- a/android/src/org/rockbox/RockboxTimer.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2010 Thomas Martitz
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-package org.rockbox;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import android.content.Context;
-import android.util.Log;
-
-public class RockboxTimer extends Timer
-{
- private class RockboxTimerTask extends TimerTask {
- private RockboxTimer timer;
- public RockboxTimerTask(RockboxTimer parent)
- {
- super();
- timer = parent;
- }
-
- @Override
- public void run()
- {
- timerTask();
- synchronized(timer) {
- timer.notify();
- }
- }
- }
-
- public RockboxTimer(Context c, long period_inverval_in_ms)
- {
- super("tick timer");
- schedule(new RockboxTimerTask(this), 0, period_inverval_in_ms);
- }
-
- @SuppressWarnings("unused")
- private void LOG(CharSequence text)
- {
- Log.d("Rockbox", (String) text);
- }
-
-
- /* methods called from native, keep them simple */
- public void java_wait_for_interrupt()
- {
- synchronized(this)
- {
- try {
- this.wait();
- } catch (InterruptedException e) {
- /* Not an error: wakeup and return */
- }
- }
- }
- public native void timerTask();
-}