Permalink
Browse files

Phone: Enable audio & call related logs

Add logs when
-enabling/disabling MIC and Speaker
through AudioManager.
-for call related operations.
This would help in debugging call issues.

Change-Id: I48e09a8e68737444009a0deac3cb0550f8bd1ed8
CRs-Fixed: 359921
  • Loading branch information...
1 parent 84b61d6 commit 645ec725370079dd461e4f175789c63409c7afa9 Shruthi N.K committed with Gerrit Code Review Jul 19, 2012
@@ -2374,13 +2374,13 @@ public AtCommandResult handleSetCommand(Object[] args) {
if (phoneType == Phone.PHONE_TYPE_CDMA) {
if (ringingCall.isRinging()) {
// Hangup the active call and then answer call waiting call.
- if (VDBG) log("CHLD:1 Callwaiting Answer call");
+ log("CHLD:1 Callwaiting Answer call");
PhoneUtils.hangupRingingAndActive(phone);
} else {
// If there is no Call waiting then just hangup
// the active call. In CDMA this mean that the complete
// call session would be ended
- if (VDBG) log("CHLD:1 Hangup Call");
+ log("CHLD:1 Hangup Call");
PhoneUtils.hangup(PhoneApp.getInstance().mCM);
}
return new AtCommandResult(AtCommandResult.OK);
@@ -2404,15 +2404,15 @@ public AtCommandResult handleSetCommand(Object[] args) {
// If the Phone state is already in CONF_CALL then we simply send
// a flash cmd by calling switchHoldingAndActive()
if (ringingCall.isRinging()) {
- if (VDBG) log("CHLD:2 Callwaiting Answer call");
+ log("CHLD:2 Callwaiting Answer call");
PhoneUtils.answerCall(ringingCall);
PhoneUtils.setMute(false);
// Setting the second callers state flag to TRUE (i.e. active)
cdmaSetSecondCallState(true);
} else if (PhoneApp.getInstance().cdmaPhoneCallState
.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
- if (VDBG) log("CHLD:2 Swap Calls");
+ log("CHLD:2 Swap Calls");
PhoneUtils.switchHoldingAndActive(backgroundCall);
// Toggle the second callers active state flag
cdmaSwapSecondCallState();
@@ -2430,7 +2430,7 @@ public AtCommandResult handleSetCommand(Object[] args) {
PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState();
// For CDMA, we need to check if the call is in THRWAY_ACTIVE state
if (state == CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
- if (VDBG) log("CHLD:3 Merge Calls");
+ log("CHLD:3 Merge Calls");
PhoneUtils.mergeCalls();
} else if (state == CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
// State is CONF_CALL already and we are getting a merge call
@@ -450,7 +450,7 @@ private void updateNoCall(CallManager cm) {
* (ie. the stuff in the primaryCallInfo block) based on the specified Call.
*/
private void displayMainCallStatus(CallManager cm, Call call) {
- if (DBG) log("displayMainCallStatus(call " + call + ")...");
+ log("displayMainCallStatus(call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
@@ -460,7 +460,7 @@ private void displayMainCallStatus(CallManager cm, Call call) {
mPrimaryCallInfo.setVisibility(View.VISIBLE);
Call.State state = call.getState();
- if (DBG) log(" - call.state: " + call.getState());
+ log(" - call.state: " + call.getState());
switch (state) {
case ACTIVE:
@@ -203,7 +203,7 @@ public void update() {
canHold = false;
}
- if (DBG) dumpState();
+ dumpState();
}
public void dumpState() {
@@ -1186,7 +1186,7 @@ private void internalResolveIntent(Intent intent) {
return;
}
String action = intent.getAction();
- if (DBG) log("internalResolveIntent: action=" + action);
+ log("internalResolveIntent: action=" + action);
// In gingerbread and earlier releases, the InCallScreen used to
// directly handle certain intent actions that could initiate phone
@@ -1730,8 +1730,8 @@ private void onPhoneStateChanged(AsyncResult r) {
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
- if (DBG) log("onDisconnect: connection '" + c + "', cause = " + cause
- + ", showing screen: " + mApp.isShowingCallScreen());
+ log("onDisconnect: connection '" + c + "', cause = " + cause
+ + ", showing screen: " + mApp.isShowingCallScreen());
boolean currentlyIdle = !phoneIsInUse();
int autoretrySetting = AUTO_RETRY_OFF;
@@ -3009,7 +3009,7 @@ private void closeDialpadInternal(boolean animate) {
* Handles button clicks from the InCallTouchUi widget.
*/
/* package */ void handleOnscreenButtonClick(int id) {
- if (DBG) log("handleOnscreenButtonClick(id " + id + ")...");
+ log("handleOnscreenButtonClick(id " + id + ")...");
switch (id) {
// Actions while an incoming call is ringing:
@@ -3745,7 +3745,7 @@ private void internalSwapCalls() {
* necessary.
*/
private void setInCallScreenMode(InCallScreenMode newMode) {
- if (DBG) log("setInCallScreenMode: " + newMode);
+ log("setInCallScreenMode: " + newMode);
mApp.inCallUiState.inCallScreenMode = newMode;
switch (newMode) {
@@ -1879,7 +1879,7 @@ static boolean isConferenceCall(Call call) {
* @param store True when the settings should be stored in the device.
*/
/* package */ static void turnOnSpeaker(Context context, boolean flag, boolean store) {
- if (DBG) log("turnOnSpeaker(flag=" + flag + ", store=" + store + ")...");
+ log("turnOnSpeaker(flag=" + flag + ", store=" + store + ")...");
final PhoneApp app = PhoneApp.getInstance();
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
@@ -1990,19 +1990,17 @@ static void setMute(boolean muted) {
*/
private static void setMuteInternal(Phone phone, boolean muted) {
final PhoneApp app = PhoneApp.getInstance();
- if (phone != null) {
- Context context = phone.getContext();
- boolean routeToAudioManager =
- context.getResources().getBoolean(R.bool.send_mic_mute_to_AudioManager);
- if (routeToAudioManager) {
- AudioManager audioManager =
- (AudioManager) phone.getContext().getSystemService(Context.AUDIO_SERVICE);
- if (DBG) log("setMuteInternal: using setMicrophoneMute(" + muted + ")...");
- audioManager.setMicrophoneMute(muted);
- } else {
- if (DBG) log("setMuteInternal: using phone.setMute(" + muted + ")...");
- phone.setMute(muted);
- }
+ Context context = phone.getContext();
+ boolean routeToAudioManager =
+ context.getResources().getBoolean(R.bool.send_mic_mute_to_AudioManager);
+ if (routeToAudioManager) {
+ AudioManager audioManager =
+ (AudioManager) phone.getContext().getSystemService(Context.AUDIO_SERVICE);
+ log("setMuteInternal: using setMicrophoneMute(" + muted + ")...");
+ audioManager.setMicrophoneMute(muted);
+ } else {
+ log("setMuteInternal: using phone.setMute(" + muted + ")...");
+ phone.setMute(muted);
}
app.notificationMgr.updateMuteNotification();
}

0 comments on commit 645ec72

Please sign in to comment.