Commit graph

145 commits

Author SHA1 Message Date
Thomas Martitz
c6ca81329a Android: Fix a few java warnings. Upgrade ndk platform to 2.0 (don't support 1.6 anymore).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30293 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 08:55:16 +00:00
Thomas Martitz
b2f52477df Android: Change headphone detection to call into native.
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-19 23:44:56 +00:00
Thomas Martitz
64b5f1c625 Android: Rework RunForegroundManager (again)
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-18 22:04:08 +00:00
Thomas Martitz
a5e7354b20 Android: Fix long unnoticed typo in function call, leading to the wrong function being called.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30163 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 21:30:06 +00:00
Thomas Martitz
5721d4cfbf Forgot to add new class file in r30161.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30162 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 21:28:02 +00:00
Thomas Martitz
02b2b285d6 Android: Slightly rework logging to logcat by offloading duplicated code to a new helper class.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30161 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 21:26:03 +00:00
Thomas Martitz
33de9cdaef Android: Refactor some of the glue code.
* 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-18 21:02:47 +00:00
Thomas Martitz
76b6db375a Android: Fix sporadic force closes.
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-07-18 18:56:29 +00:00
Björn Stenberg
35cd408196 Added NODEPS define to skip recompilation for zip and apk builds. Usage: make zip NODEPS=1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30050 a1c6a512-1295-4272-9138-f99709370657
2011-06-22 14:14:49 +00:00
Dominik Riebeling
a3ed2c1552 Support installing the Android toolchain on Cygwin and OS X.
Update the download URLs to the most recent versions of SDK and NDK, the
previously used r09 of the SDK isn't available at that location anymore, and
differentiate between host platforms.

Note: while the script now can install the toolchain on Cygwin building for
Android on Cygwin does not work.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29993 a1c6a512-1295-4272-9138-f99709370657
2011-06-11 20:22:14 +00:00
Thomas Martitz
dace72166e Android: Greatly simplify the pcm callback mechanism on both, the Java and 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-05 09:44:57 +00:00
Thomas Martitz
b9747ca206 Hopefully FS#12064 - Android: Possible fix for audio stopping on high CPU load.
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-04 20:39:56 +00:00
Dominik Riebeling
d25a61f01c Android: listen to ACTION_AUDIO_BECOMING_NOISY for headphone (FS#12097).
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-04 19:17:51 +00:00
Dominik Riebeling
6c22be4a3d Android: implement headphone detection thus enabling pause on unplug (FS#12097).
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-06-04 19:17:47 +00:00
Dominik Riebeling
26a92fa9e1 Android: adjust screen orientation based on LCD size.
If the screen size specified is wider than higher specify the orientation as
landscape in AndroidManifest.xml. This usually applies to tablets where Rockbox
in portrait mode feels unnatural.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29951 a1c6a512-1295-4272-9138-f99709370657
2011-06-04 10:36:34 +00:00
Dominik Riebeling
70b81e65cc Android: install codecs as native libs instead of extracting them (FS#12134).
Codec files are loaded as dynamic libraries. Instead of extracting them from
the packaged libmisc.so and therefore having them present twice on the device
put them into the apk as native libraries. Decreases the size of the installed
Rockbox by the compressed size of the codecs. Also, the extraction on first
Rockbox startup gets notably faster since it's less data to extract.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29940 a1c6a512-1295-4272-9138-f99709370657
2011-05-31 21:26:18 +00:00
Dominik Riebeling
fc68a0d3b0 Android: rework r29929 AndroidManifest.xml version handling.
Put the generated AndroidManifest.xml into the bin subfolder and remove it from
clean list. Avoids problems with cleaning if you're building in the android/
folder. Thanks to kugel for pointing out that people are actually doing that.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29931 a1c6a512-1295-4272-9138-f99709370657
2011-05-29 18:44:42 +00:00
Dominik Riebeling
bc3f9c1b71 Add source tree version into AndroidManifest.xml
Use the source tree version as versionName string. As result the Android
Settings menu will now show that version instead of a rather unhelpful "1.0".

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29929 a1c6a512-1295-4272-9138-f99709370657
2011-05-29 17:23:52 +00:00
Thomas Martitz
94dacca559 Rework MediaButtonReceiver a bit:
* 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-05-13 11:26:18 +00:00
Thomas Martitz
c77b014283 Use mkdir -p in the previous commit. Thanks sideral for spotting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29754 a1c6a512-1295-4272-9138-f99709370657
2011-04-21 09:35:35 +00:00
Thomas Martitz
f29c9d2289 Android: Fix creation of debug key if ~/.android doesn't exist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29753 a1c6a512-1295-4272-9138-f99709370657
2011-04-21 09:04:04 +00:00
Dominik Riebeling
968db0edff Fix some whitespace errors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29712 a1c6a512-1295-4272-9138-f99709370657
2011-04-14 17:22:52 +00:00
Björn Stenberg
ce755dd9c5 Only set volume on SYS_VOLUME_CHANGED the first time. Workaround for FS#12034.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29663 a1c6a512-1295-4272-9138-f99709370657
2011-03-31 07:04:44 +00:00
Thomas Martitz
8c46ddf9d7 Android: Implement app shutdown and thus, sleep timer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29602 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 15:17:24 +00:00
Thomas Martitz
efa9f13500 Android: Fix widget albumart display on pre-2.2 devices.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29600 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 11:38:49 +00:00
Björn Stenberg
e50cc0e3d7 Listen to and follow external Android volume changes. (Based on FS#11914 by Maurus Cuelenaere)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29586 a1c6a512-1295-4272-9138-f99709370657
2011-03-14 12:25:48 +00:00
Björn Stenberg
00f75c92bf Use the pcm volume to add finer steps between every android stream volume step.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29573 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 20:40:19 +00:00
Maurus Cuelenaere
78d0fdab9c Android: get rid of warnings (no functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29566 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:46:02 +00:00
Maurus Cuelenaere
42f69c28c6 Android: replace installApk.sh "launching Rockbox activity"-behaviour with
'make launch'

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29565 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:45:55 +00:00
Maurus Cuelenaere
cae7560f32 Android: future-proof the RunForegroundManager code to Honeycomb
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29562 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:45:38 +00:00
Maurus Cuelenaere
4364111267 Android: update project to SDKv11
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29561 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:45:34 +00:00
Maurus Cuelenaere
fe6faf2e2c Android port: generate initial config when none is present with dynamically
generated values depending on your environment.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29560 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:45:22 +00:00
Antoine Cellerier
fd7375c307 Ask for track information to be resent after creating a new widget.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29553 a1c6a512-1295-4272-9138-f99709370657
2011-03-09 18:46:55 +00:00
Antoine Cellerier
64cf0dd765 Looks like Android 2.3 is more strict when enforcing permissions. Explicitly 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-03-09 18:04:05 +00:00
Antoine Cellerier
c9190dc188 Add a scrollbar to the android widget's configuration activity.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29551 a1c6a512-1295-4272-9138-f99709370657
2011-03-09 17:24:08 +00:00
Thomas Martitz
ab60101dd3 Android: Add a nowplaying bar to the 3x3 widget
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29529 a1c6a512-1295-4272-9138-f99709370657
2011-03-05 22:14:19 +00:00
Thomas Martitz
883ff8507e Android: Show cover art in the widget (including option to hide it).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29437 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 20:47:44 +00:00
Thomas Martitz
f1e3f5e6c4 Android: Add a 3x3 sized widget.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29409 a1c6a512-1295-4272-9138-f99709370657
2011-02-26 21:00:38 +00:00
Thomas Martitz
e6ae867206 Android: Remove notification item on pausing too.
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-26 20:27:00 +00:00
Thomas Martitz
eb01664804 Android: Simplify media button intent generation in the widget and cleanup RockboxService accordingly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29404 a1c6a512-1295-4272-9138-f99709370657
2011-02-26 19:54:03 +00:00
Thomas Martitz
95e24dd7a5 Android:
* 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-23 01:10:54 +00:00
Thomas Martitz
d6ce7fe3d4 Android: Fix some race conditions and crashes on startup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29341 a1c6a512-1295-4272-9138-f99709370657
2011-02-19 16:42:44 +00:00
Thomas Martitz
36af29f4d8 Android: Re-attach the media button receiver when entering Rockbox.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29335 a1c6a512-1295-4272-9138-f99709370657
2011-02-19 01:31:45 +00:00
Thomas Martitz
c9c28200c0 Correct setServiceActivity implementation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29334 a1c6a512-1295-4272-9138-f99709370657
2011-02-19 01:26:45 +00:00
Thomas Martitz
144df92bfb Android: Rewrite lcd subsystem to use the SurfaceView API.
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-19 01:13:38 +00:00
Dave Chapman
82140061a6 Update Android README in line with configure changes from r29286
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29296 a1c6a512-1295-4272-9138-f99709370657
2011-02-13 13:26:16 +00:00
Frank Gevaerts
38084784ad Make $(DIRS) an order-only dependency, to avoid needless rebuilding of some files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29197 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 23:10:51 +00:00
Frank Gevaerts
276321e6d8 Change the way java files are compiled (do them all at once) in order to speed up builds. There is now an intermediate jar file to help (although that's not strictly necessary), so for rebuilds of single java files this may be a bit slower
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29196 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 22:13:51 +00:00
Thomas Martitz
0f4dfc4e9d Android/Java: Disable implicit compilation of dependecies to make the life easier for make.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29187 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 13:57:01 +00:00
Jonathan Gordon
b5562a10c8 update the toolchains install script to grab the latest and greatest
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29173 a1c6a512-1295-4272-9138-f99709370657
2011-01-30 02:33:47 +00:00