Detect if music is playing in other apps on Android

I’m trying to detect whether music is playing in any other apps (Which should mute my game’s music).

(AudioManager)UnityPlayer.currentActivity.getSystemService(Context.AUDIO_SERVICE).isMusicActive
seems to always return true.

I made a native plugin which works, in so far that it returns a value, but it’s always true. Am I missing something?

package com.glitchnap.glitchandroid;
import android.os.Bundle;
import android.util.Log;
import android.content.Context;
import android.media.AudioManager;
import com.unity3d.player.UnityPlayer;
public class GlitchAndroid {

	public boolean isMusicPlaying() {
	Log.i("GLITCHANDROID", "isMusicPlaying?");
	AudioManager aMan = (AudioManager)UnityPlayer.currentActivity.getSystemService(Context.AUDIO_SERVICE);
	return aMan.isMusicActive();
}

}

We heard back from Unity today, it sounds like when they revamped the audio for 5.0 they completely rewrote the Android player and introduced this issue. They should be working on a fix for a future 5.x release.