Use CallManager.getMute() in PhoneUtils.
Currently, PhoneUtils.getMute() only get mute state from the foreground phone.
But if the fg phone is idle while a bg phone is off-hook, then we should get
the mute state from the bg phone. All the logic should be done in
CallManager.getMute() so PhoneUtils just needs to call that.
Bug: 3323789
Change-Id: I21ad6df19aa82f720e746f8d3f6a4ba5933c639e
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 126af4f..a06760e 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1832,17 +1832,16 @@
* foreground call
*/
static boolean getMute() {
- Phone phone = PhoneApp.getInstance().mCM.getFgPhone();
+ PhoneApp app = PhoneApp.getInstance();
- Context context = phone.getContext();
boolean routeToAudioManager =
- context.getResources().getBoolean(R.bool.send_mic_mute_to_AudioManager);
+ app.getResources().getBoolean(R.bool.send_mic_mute_to_AudioManager);
if (routeToAudioManager) {
AudioManager audioManager =
- (AudioManager) phone.getContext().getSystemService(Context.AUDIO_SERVICE);
+ (AudioManager) app.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isMicrophoneMute();
} else {
- return phone.getMute();
+ return app.mCM.getMute();
}
}