(_env: JNIEnv, _class: JClass)
| 116 | |
| 117 | #[no_mangle] |
| 118 | pub extern "system" fn isPlaying(_env: JNIEnv, _class: JClass) -> jint { |
| 119 | let result = std::panic::catch_unwind(|| { |
| 120 | block_on(async { |
| 121 | match get_spotify_session()? { |
| 122 | Some(session) => { |
| 123 | let playback_info = session.GetPlaybackInfo()?; |
| 124 | let status = playback_info.PlaybackStatus()?; |
| 125 | Ok( |
| 126 | (status == GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing) |
| 127 | as jint, |
| 128 | ) |
| 129 | } |
| 130 | _ => Err(Error::new(E_FAIL, "Spotify session not found")), |
| 131 | } |
| 132 | }) |
| 133 | }); |
| 134 | |
| 135 | match result { |
| 136 | Ok(Ok(val)) => val, |
| 137 | _ => -1, |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | #[no_mangle] |
| 142 | pub extern "system" fn getCoverArt(out_ptr: *mut *mut u8, out_len: *mut usize) -> i32 { |
nothing calls this directly
no test coverage detected