summaryrefslogtreecommitdiffstats
path: root/android/src
AgeCommit message (Collapse)AuthorFilesLines
2011-07-19Android: Change headphone detection to call into native.Thomas Martitz1-3/+4
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: Rework RunForegroundManager (again)Thomas Martitz3-66/+88
Restore pre-r29562 way of doing compatibility and adapt it to what MediaButtonReceiver looks like. I.e. assume the new API is there, and fall back to the old API if an exception is raised because the API isn't there. The old API still needs to be discovered through reflection because it's removed entirely from Honeycomb. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30165 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Android: Fix long unnoticed typo in function call, leading to the wrong ↵Thomas Martitz1-1/+1
function being called. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30163 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Forgot to add new class file in r30161.Thomas Martitz1-0/+44
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30162 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Android: Slightly rework logging to logcat by offloading duplicated code to ↵Thomas Martitz5-35/+6
a new helper class. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30161 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Android: Refactor some of the glue code.Thomas Martitz4-84/+137
* 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-07-18Android: Fix sporadic force closes.Thomas Martitz1-1/+5
Android restarts services that are killed during memory pressure. The intent parameter is null then. This caused a null pointer exception. Now replace this null intent with one saying we've been restarted. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30156 a1c6a512-1295-4272-9138-f99709370657
2011-06-05Android: Greatly simplify the pcm callback mechanism on both, the Java and ↵Thomas Martitz1-6/+7
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-04Hopefully FS#12064 - Android: Possible fix for audio stopping on high CPU load.Thomas Martitz1-52/+47
It's not enterly clear what fixed it but it seems to be a combination of increasing the buffer size and reducing the amount of code run in the callback. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29961 a1c6a512-1295-4272-9138-f99709370657
2011-06-04Android: listen to ACTION_AUDIO_BECOMING_NOISY for headphone (FS#12097).Dominik Riebeling1-0/+16
This event is sent before the audio is routed back to the speaker so we get the information about the unplugged headphone notably earlier. Decrease the debouncing of the headphone status from 1s to 0.5s to work around audio still getting played back via the speaker due to the pause delay by debouncing. On Android we shouldn't need the debouncing at all. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29957 a1c6a512-1295-4272-9138-f99709370657
2011-06-04Android: implement headphone detection thus enabling pause on unplug (FS#12097).Dominik Riebeling1-0/+21
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-13Rework MediaButtonReceiver a bit:Thomas Martitz2-19/+32
* Get rid of reflection since the lack of methods can be detected via exceptions * Use requestAudioFocus/abandonAudioFocus APIs on 2.2+ to play nice with other music apps. * Don't unregister the receiver on exit so we can receive media button presses (and startup the service) after idle poweroff (hopefully it's ok if mMediaButtonReceiver is garbage collected) This should fix that Android calls the standard music app sometimes when those buttons are pressed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29865 a1c6a512-1295-4272-9138-f99709370657
2011-04-14Fix some whitespace errors.Dominik Riebeling1-60/+60
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29712 a1c6a512-1295-4272-9138-f99709370657
2011-03-31Only set volume on SYS_VOLUME_CHANGED the first time. Workaround for FS#12034.Björn Stenberg1-3/+13
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29663 a1c6a512-1295-4272-9138-f99709370657
2011-03-16Android: Implement app shutdown and thus, sleep timer.Thomas Martitz2-1/+16
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29602 a1c6a512-1295-4272-9138-f99709370657
2011-03-16Android: Fix widget albumart display on pre-2.2 devices.Thomas Martitz1-1/+4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29600 a1c6a512-1295-4272-9138-f99709370657
2011-03-14Listen to and follow external Android volume changes. (Based on FS#11914 by ↵Björn Stenberg1-3/+49
Maurus Cuelenaere) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29586 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Use the pcm volume to add finer steps between every android stream volume step.Björn Stenberg1-14/+37
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29573 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: get rid of warnings (no functional changes)Maurus Cuelenaere6-20/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29566 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android: future-proof the RunForegroundManager code to HoneycombMaurus Cuelenaere1-87/+62
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29562 a1c6a512-1295-4272-9138-f99709370657
2011-03-11Android port: generate initial config when none is present with dynamicallyMaurus Cuelenaere1-0/+23
generated values depending on your environment. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29560 a1c6a512-1295-4272-9138-f99709370657
2011-03-09Ask for track information to be resent after creating a new widget.Antoine Cellerier4-7/+32
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29553 a1c6a512-1295-4272-9138-f99709370657
2011-03-09Looks like Android 2.3 is more strict when enforcing permissions. Explicitly ↵Antoine Cellerier1-25/+19
declare allowed intents under the Service tag in AndroidManifest.xml. Remove useless rockbox intent class. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29552 a1c6a512-1295-4272-9138-f99709370657
2011-02-27Android: Show cover art in the widget (including option to hide it).Thomas Martitz3-2/+18
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29437 a1c6a512-1295-4272-9138-f99709370657
2011-02-26Android: Add a 3x3 sized widget.Thomas Martitz1-0/+27
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29409 a1c6a512-1295-4272-9138-f99709370657
2011-02-26Android: Remove notification item on pausing too.Thomas Martitz2-7/+10
Technically, the difference between stop and pause isn't important enough to keep it when no music is playing. This is how other media apps also act. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29405 a1c6a512-1295-4272-9138-f99709370657
2011-02-26Android: Simplify media button intent generation in the widget and cleanup ↵Thomas Martitz4-52/+69
RockboxService accordingly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29404 a1c6a512-1295-4272-9138-f99709370657
2011-02-23Android:Thomas Martitz4-94/+69
* 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: Fix some race conditions and crashes on startup.Thomas Martitz2-18/+40
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29341 a1c6a512-1295-4272-9138-f99709370657
2011-02-19Android: Re-attach the media button receiver when entering Rockbox.Thomas Martitz1-2/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29335 a1c6a512-1295-4272-9138-f99709370657
2011-02-19Correct setServiceActivity implementationThomas Martitz1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29334 a1c6a512-1295-4272-9138-f99709370657
2011-02-19Android: Rewrite lcd subsystem to use the SurfaceView API.Thomas Martitz3-97/+94
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-01-29Add widgets to android port.Antoine Cellerier8-2/+399
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29170 a1c6a512-1295-4272-9138-f99709370657
2011-01-24Oops, this line wasn't supposed to make it into svn.Antoine Cellerier1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29133 a1c6a512-1295-4272-9138-f99709370657
2011-01-24Move android notification display format logic to java code (no functional ↵Antoine Cellerier1-3/+7
change, this is used by FS #11902). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29132 a1c6a512-1295-4272-9138-f99709370657
2010-12-10Android: Rework notification and change icon sizes to better meet the ↵Thomas Martitz2-21/+31
systems' standard. The notification now announces the new track on track change, and the the area in the scrolled down notification area shows track infos (title, artist, album). Someone should check if it looks good on hdpi and ldpi screens as I can't verify it right now (emulator crashes). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28785 a1c6a512-1295-4272-9138-f99709370657
2010-12-10Android: Replace the java based tick timer implemented with a not as bloated ↵Thomas Martitz1-76/+0
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-06Fix extracting libmisc.soThomas Martitz1-2/+7
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28754 a1c6a512-1295-4272-9138-f99709370657
2010-12-02Android: Make lcd updates synchronous, doesn't make it faster but smoother ↵Thomas Martitz1-15/+8
(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: When the backlight goes off, the RockboxFramebuffer/View isn't made ↵Thomas Martitz1-0/+3
invisible. Force that in order to disable screen updates while backlight is off. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28569 a1c6a512-1295-4272-9138-f99709370657
2010-11-12Android: Change how detecting call state (introduced in r27746) works, from ↵Thomas Martitz2-31/+101
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/+19
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-07android: don't crash if the user presses HOME while the loading screen is ↵Jonathan Gordon1-3/+6
showing, this shuld also be made canceleable later git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28530 a1c6a512-1295-4272-9138-f99709370657
2010-11-06Android: replace hardcoded strings with Android strings, allowing translationsMaurus Cuelenaere2-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28518 a1c6a512-1295-4272-9138-f99709370657
2010-11-06Android: Use our translations for the yes/no/ok/cancel buttons in the yesno ↵Thomas Martitz2-8/+6
and keyboard dialog. Second part of FS#11708. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28515 a1c6a512-1295-4272-9138-f99709370657
2010-11-06Android: only display progress dialog when extraction happensMaurus Cuelenaere1-17/+19
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28514 a1c6a512-1295-4272-9138-f99709370657
2010-11-06Android: greatly simplify Android YesNo and KeyboardInput widgetsMaurus Cuelenaere6-136/+69
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28513 a1c6a512-1295-4272-9138-f99709370657
2010-11-06Android: Use wakeup objects instead of polling for the dialog results in the ↵Thomas Martitz2-39/+10
keyboard and yesno dialog, allowing a lot of code to be removed. First part of FS#11708 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28512 a1c6a512-1295-4272-9138-f99709370657
2010-11-05Android: prevent NullPointerException in RockboxServiceMaurus Cuelenaere1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28511 a1c6a512-1295-4272-9138-f99709370657
2010-11-05Android: don't display the loading screen etc. when the library is already ↵Maurus Cuelenaere1-0/+4
loaded git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28510 a1c6a512-1295-4272-9138-f99709370657