if you do a adb shell getprop | grep dolby
you'll see there is a system property dolby.ds.state that toggles between On and Off when it's active (playing audio)
To query the active status from your application this lets you query a System property (note that you'll probably have to wrap try/catch blocks round it to keep Java happy)
Class getSysProp = null;
getSysProp = Class.forName("android.os.SystemProperties");
Method method = null;
method = getSysProp.getDeclaredMethod("get", String.class);
String prop = null;
prop = (String)method.invoke(null, "dolby.ds.state");
It looks like different sorts of audio trigger the Dolby status - if you watch logcat with something like iHeartRadio playing you'll see the the Dolby setting gets bypassed for orbis so you might simply be able to change the codec you are using when you don't want it turned on.
** Edit: Update with new official Dolby API **
See http://developer.dolby.com/ for a more complete (and less hacky!) solution