summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/android
AgeCommit message (Collapse)AuthorFilesLines
2011-09-01Shuffle some functions around so that interfacing with playback.c in ↵Michael Sevakis1-1/+1
particular isn't required. Though playback does finish the audio init, pcm doesn't care who does it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30403 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Fix typo in and clarify comment.Thomas Martitz1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30309 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Android: Minor changes in ldebugf.Thomas Martitz1-2/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30304 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Remove hosted_get_volume(), as event data is available in button_get_data().Thomas Martitz1-16/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30300 a1c6a512-1295-4272-9138-f99709370657
2011-07-22Android: Fix crash on start up.Thomas Martitz1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30190 a1c6a512-1295-4272-9138-f99709370657
2011-07-19Android: Change headphone detection to call into native.Thomas Martitz2-15/+25
Making a JNI call from tick tasks is not permitted as the underlying thread is not attached to the Java VM. This is an error and crashes in the emulator (which has stricter JNI checks enabled by default). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30173 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Android: Refactor some of the glue code.Thomas Martitz3-35/+37
* Cleanup RockboxService.java by moving the battery and headphone monitors to separate classes and detaching their instances * Move those monitors and RockboxTelephony.java into a new monitors subdirectory * Call those monitors all the same from native code by creating the objects there git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30160 a1c6a512-1295-4272-9138-f99709370657
2011-06-29Commit FS#12150 - Fully-functional audio mixer - and finally whip old ↵Michael Sevakis1-2/+52
limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
2011-06-05Android: Greatly simplify the pcm callback mechanism on both, the Java and ↵Thomas Martitz1-49/+34
the C side. Should be more reliable now (if the old wasn't already). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29963 a1c6a512-1295-4272-9138-f99709370657
2011-06-04Android: implement headphone detection thus enabling pause on unplug (FS#12097).Dominik Riebeling1-0/+28
Listen to headphone plug events. There are currently two glitches with this: - Android takes a while until it reports the unplug event, so there will be some delay until playback gets paused. This is an Android limitation. - Rockbox debounces headphone state changes for one second. Therefore playback will shortly be routed to the speaker on unplug until Rockbox does the actual pause. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29956 a1c6a512-1295-4272-9138-f99709370657
2011-05-29Fix an implicit declaration warning.Dominik Riebeling1-2/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29930 a1c6a512-1295-4272-9138-f99709370657
2011-05-25Fix a problem where hardware keypresses dont reset the idle poweroff timer ↵Jonathan Gordon1-0/+1
on android git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29924 a1c6a512-1295-4272-9138-f99709370657
2011-05-08Fix tabs in .c and .h files in firmware/ Bertrik Sikken1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29832 a1c6a512-1295-4272-9138-f99709370657
2011-05-05Fix whitespace errors aka tabs.Dominik Riebeling1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29826 a1c6a512-1295-4272-9138-f99709370657
2011-03-16Android: Implement app shutdown and thus, sleep timer.Thomas Martitz2-6/+32
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29602 a1c6a512-1295-4272-9138-f99709370657
2011-03-16Android: Partly revert r29569 and only call the new getJavaEnvironment() ↵Thomas Martitz7-39/+42
when needed. The environment is fine to share in general, just not across OS threads, so it's only needed for functions which are possibly called from multiple OS threads (only 1 currently). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29601 a1c6a512-1295-4272-9138-f99709370657
2011-03-14Listen to and follow external Android volume changes. (Based on FS#11914 by ↵Björn Stenberg1-0/+25
Maurus Cuelenaere) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29586 a1c6a512-1295-4272-9138-f99709370657
2011-03-12Android: allocate native_buffer locally, which does away with the need to holdMaurus Cuelenaere1-6/+9
a global reference to it (fixes bug). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29576 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: Switch to pthread_cond+SIGEV_THREAD for tick task handling.Thomas Martitz1-26/+19
The implementation wasn't really safe (sem_post from signal handler), and the new one simplifies things a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29575 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Create GlobalRef in surfaceCreated, in accordance to r29572.Thomas Martitz1-8/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29574 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: delete the global reference in surfaceDestroyedMaurus Cuelenaere2-14/+5
This gets rid of the lcd_deinit() boilerplate. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29572 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: no need to keep RockboxPCM_class aroundMaurus Cuelenaere1-2/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29571 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Partly revert "Android: use NewGlobalRef for references that are used globally"Maurus Cuelenaere3-28/+8
The added complexity wasn't needed for most subsystems, as main() never returns so local references can't be freed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29570 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: Don't share the JNI environment across threads, but obtain it theMaurus Cuelenaere7-8/+44
correct way git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29569 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: use NewGlobalRef for references that are used globallyMaurus Cuelenaere3-12/+43
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29568 a1c6a512-1295-4272-9138-f99709370657
2011-03-10Enable volume keys in Android.Björn Stenberg2-0/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29559 a1c6a512-1295-4272-9138-f99709370657
2011-03-08Bring idle poweroff to RaaA and the simThomas Jarosch1-4/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29543 a1c6a512-1295-4272-9138-f99709370657
2011-03-05Android: Fix black display after unzipping libmisc.so.Thomas Martitz1-2/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29527 a1c6a512-1295-4272-9138-f99709370657
2011-03-02Introduce "power" thread for RaaAThomas Jarosch1-5/+1
I tried to move the #ifdefs and the code in firmware/powermgmt.c around and it was still a big mess for hosted applications (RaaA/sim builds). Create our own "power" thread as recently discussed on IRC. Fixes the sleep timer for RaaA. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29501 a1c6a512-1295-4272-9138-f99709370657
2011-02-28Move sleep timer code outside of PLATFORM_NATIVE ifdef so RaaA can access itThomas Jarosch1-11/+0
Also remove redundant RaaA stubs for it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29467 a1c6a512-1295-4272-9138-f99709370657
2011-02-23Android:Thomas Martitz2-53/+54
* Re-create RockboxFramebuffer instance with every time there's a new Activity. * Also, allow Rockbox to be started via multimedia buttons, immediately starting playback if wanted. We don't need to keep the fb instance around when it backround, and it makes us less depending on it and the activity (less race conditions). And this is how you usually do it in Android apps. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29384 a1c6a512-1295-4272-9138-f99709370657
2011-02-19Android: Rewrite lcd subsystem to use the SurfaceView API.Thomas Martitz2-81/+61
That enables drawing from outside the apps UI thread, i.e. from within the Rockbox native thread, without needing synchronization means, and adds determinism as to when the draw happens. It simplifies the drawing routines and adds a convinient way of detecting whether drawing should happen or not (surfaceCreated/Destroyed). It also restores max. fps on my phone which went down drastically with the gingerbread(CM7) update. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29333 a1c6a512-1295-4272-9138-f99709370657
2011-02-18Implement cooperative threads on hosted platforms using C code.Thomas Martitz1-98/+0
This replaces SDL threads with real cooperative threads, which are less cpu intensive and allow priority scheduling. The backend for context switching is dependant on the host (sigaltstack/longjmp on Unix, Fibers on Windows). configure has options to force or disallow SDL threads. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29327 a1c6a512-1295-4272-9138-f99709370657
2011-01-29Add widgets to android port.Antoine Cellerier1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29170 a1c6a512-1295-4272-9138-f99709370657
2010-12-23RaaA: Improve tagcache search to make the database built.Thomas Martitz1-12/+23
First, it add the ability to tagcache to walk through multiple search roots. Second, it adds symlinks targets to the search roots if they're are not inside any of the current search roots, otherwise the symlink is ignored (unless it's a file). The default search root is still /, so no search root will be actually added. But the tagcache now isn't trapped by recursive symlinks anymore and successfully builds, and it's prepared for a future music directory setting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28884 a1c6a512-1295-4272-9138-f99709370657
2010-12-13Android: Protect lcd updates with a mutex.Thomas Martitz1-0/+6
The scrolling engine could lock out the main thread which may be waiting for its update to finish (wakeups are not reentrant). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28821 a1c6a512-1295-4272-9138-f99709370657
2010-12-10Android: Replace the java based tick timer implemented with a not as bloated ↵Thomas Martitz3-51/+63
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
2010-12-06Get rid of get_user_file_path and do the path handling in wrappers for ↵Thomas Martitz2-4/+18
open() and friends. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-12-04Android: Fix yellowThomas Martitz1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28734 a1c6a512-1295-4272-9138-f99709370657
2010-12-02Android: Make lcd updates synchronous, doesn't make it faster but smoother ↵Thomas Martitz1-10/+35
(no updates are skipped) and guaranteed to be glitch free. test_fps can also now report reasonable numbers: ~62 fps for both 1/1 and 1/4 updates (was 300-400 previously). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28728 a1c6a512-1295-4272-9138-f99709370657
2010-11-12Android: Change how detecting call state (introduced in r27746) works, from ↵Thomas Martitz3-24/+70
polling to event based. * For some reason, the polling methid is much more inefficient than I thought. According to htop it caused up to 15% CPU load on some phones (e.g. Galaxy S). The event based causes no CPU load. Rockbox' idle CPU load is now back to 0%, while it was previously dominated by polling the call state. * Also stop on outgoing calls (no need to explicitely pause for making a call anymore). * Factor out the detection mechanism to separate files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28564 a1c6a512-1295-4272-9138-f99709370657
2010-11-10Touchscreen: Improved scroll thresholdThomas Martitz1-0/+26
Remove the hardcoded (and way too small) scroll threshold (the distance moved in pixels before we think the users wants to scroll) and replace it with something based on the actual DPI of the screen. On Android we call the API for that, on other touchscreens we reimplemented Android's formula (as of 2.2) and calculate it. Flyspray: 11727 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28548 a1c6a512-1295-4272-9138-f99709370657
2010-11-07remove an unused variable and #includeJonathan Gordon1-2/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28526 a1c6a512-1295-4272-9138-f99709370657
2010-11-03Remote android button handling (again). do the press/unpress more like other ↵Jonathan Gordon3-23/+53
targets (i.e correctly). The DPAD is special in that the press/unpress happens too quickly, so always post it with the BUTTON_REL. This means all keymaps using the dpad need to remember it will always have a BUTTON_REL (which also means they cant do repeats, which are impossible anyway). Also make the back button go back to the OS home from the rockbox main menu git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28475 a1c6a512-1295-4272-9138-f99709370657
2010-10-31Add support multimedia keys/buttons to the core, and adapt Rockbox on ↵Thomas Martitz3-4/+37
android for it (multimedia buttons are found on wired headsets and the lock screen in cyanogenmod). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28421 a1c6a512-1295-4272-9138-f99709370657
2010-10-31Pass the framebuffer to the service in the constructor rather than later ↵Thomas Martitz1-4/+0
from native code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28411 a1c6a512-1295-4272-9138-f99709370657
2010-10-31Clean up usage of RockboxService. Add a proper way to check if rockbox is ↵Jonathan Gordon1-5/+3
actually running (checking RockboxService.fb != null was very very bad) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28406 a1c6a512-1295-4272-9138-f99709370657
2010-10-29Initialize (instantiate) RockboxFramebuffer from the C code like with the ↵Thomas Martitz1-36/+42
othe java objects. Remove some @Override annotations to make the Java code build with certain javac versions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28386 a1c6a512-1295-4272-9138-f99709370657
2010-10-24Fix android hardware button handling so it actually works.Jonathan Gordon1-7/+11
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28345 a1c6a512-1295-4272-9138-f99709370657
2010-09-20Redirect (L)DEBUGFs to adb logcat in DEBUG enabled builds.Thomas Martitz3-6/+54
Exclude compilation of firmware/debug.c for hosted platforms. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28125 a1c6a512-1295-4272-9138-f99709370657