diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/system.h | 4 | ||||
-rw-r--r-- | firmware/target/hosted/android/pcm-android.c | 19 |
2 files changed, 3 insertions, 20 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index 0f709cdae6..5128801725 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -143,10 +143,6 @@ int get_cpu_boost_counter(void); | |||
143 | #undef swap32 | 143 | #undef swap32 |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(PLATFORM_HAS_VOLUME_CHANGE) | ||
147 | int hosted_get_volume(void); | ||
148 | #endif | ||
149 | |||
150 | /* Get the byte offset of a type's member */ | 146 | /* Get the byte offset of a type's member */ |
151 | #define OFFSETOF(type, membername) ((off_t)&((type *)0)->membername) | 147 | #define OFFSETOF(type, membername) ((off_t)&((type *)0)->membername) |
152 | 148 | ||
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 | */ | ||
232 | static int lastPostedVolume = -1; | ||
233 | int hosted_get_volume(void) | ||
234 | { | ||
235 | return lastPostedVolume; | ||
236 | } | ||
237 | 227 | ||
238 | JNIEXPORT void JNICALL | 228 | JNIEXPORT void JNICALL |
239 | Java_org_rockbox_RockboxPCM_postVolumeChangedEvent(JNIEnv *env, | 229 | Java_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 | } |