Fix issue 1795088 Improve audio routing code
Initial commit for review.
This commit is contained in:
@@ -1365,17 +1365,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
* @return Whether music is being played right now.
|
||||
*/
|
||||
boolean isMusicActive() {
|
||||
final IAudioService audio = getAudioInterface();
|
||||
if (audio == null) {
|
||||
Log.w(TAG, "isMusicActive: couldn't get IAudioService reference");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return audio.isMusicActive();
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "IAudioService.isMusicActive() threw RemoteException " + e);
|
||||
final AudioManager am = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
|
||||
if (am == null) {
|
||||
Log.w(TAG, "isMusicActive: couldn't get AudioManager reference");
|
||||
return false;
|
||||
}
|
||||
return am.isMusicActive();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user