summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/pcm-android.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/pcm-android.c')
-rw-r--r--firmware/target/hosted/android/pcm-android.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/firmware/target/hosted/android/pcm-android.c b/firmware/target/hosted/android/pcm-android.c
index cbd6cb3228..3143bc90ec 100644
--- a/firmware/target/hosted/android/pcm-android.c
+++ b/firmware/target/hosted/android/pcm-android.c
@@ -224,16 +224,6 @@ void pcm_shutdown(void)
224 e->CallVoidMethod(env_ptr, RockboxPCM_instance, release); 224 e->CallVoidMethod(env_ptr, RockboxPCM_instance, release);
225 pthread_mutex_destroy(&audio_lock_mutex); 225 pthread_mutex_destroy(&audio_lock_mutex);
226} 226}
227
228/* Due to limitations of default_event_handler(), parameters gets swallowed when
229 * being posted with queue_broadcast(), so workaround this by caching the last
230 * value.
231 */
232static int lastPostedVolume = -1;
233int hosted_get_volume(void)
234{
235 return lastPostedVolume;
236}
237 227
238JNIEXPORT void JNICALL 228JNIEXPORT void JNICALL
239Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env, 229Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env,
@@ -242,10 +232,7 @@ Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env,
242{ 232{
243 (void) env; 233 (void) env;
244 (void) this; 234 (void) this;
245 235 /* for the main queue, the volume will be available through
246 if (volume != lastPostedVolume) 236 * button_get_data() */
247 { 237 queue_broadcast(SYS_VOLUME_CHANGED, volume);
248 lastPostedVolume = volume;
249 queue_broadcast(SYS_VOLUME_CHANGED, 0);
250 }
251} 238}