Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 645ec725370079dd461e4f175789c63409c7afa9 1 parent 84b61d6
Shruthi N.K authored Gerrit Code Review committed
10 src/com/android/phone/BluetoothHandsfree.java
@@ -2374,13 +2374,13 @@ public AtCommandResult handleSetCommand(Object[] args) {
2374 2374 if (phoneType == Phone.PHONE_TYPE_CDMA) {
2375 2375 if (ringingCall.isRinging()) {
2376 2376 // Hangup the active call and then answer call waiting call.
2377   - if (VDBG) log("CHLD:1 Callwaiting Answer call");
  2377 + log("CHLD:1 Callwaiting Answer call");
2378 2378 PhoneUtils.hangupRingingAndActive(phone);
2379 2379 } else {
2380 2380 // If there is no Call waiting then just hangup
2381 2381 // the active call. In CDMA this mean that the complete
2382 2382 // call session would be ended
2383   - if (VDBG) log("CHLD:1 Hangup Call");
  2383 + log("CHLD:1 Hangup Call");
2384 2384 PhoneUtils.hangup(PhoneApp.getInstance().mCM);
2385 2385 }
2386 2386 return new AtCommandResult(AtCommandResult.OK);
@@ -2404,7 +2404,7 @@ public AtCommandResult handleSetCommand(Object[] args) {
2404 2404 // If the Phone state is already in CONF_CALL then we simply send
2405 2405 // a flash cmd by calling switchHoldingAndActive()
2406 2406 if (ringingCall.isRinging()) {
2407   - if (VDBG) log("CHLD:2 Callwaiting Answer call");
  2407 + log("CHLD:2 Callwaiting Answer call");
2408 2408 PhoneUtils.answerCall(ringingCall);
2409 2409 PhoneUtils.setMute(false);
2410 2410 // Setting the second callers state flag to TRUE (i.e. active)
@@ -2412,7 +2412,7 @@ public AtCommandResult handleSetCommand(Object[] args) {
2412 2412 } else if (PhoneApp.getInstance().cdmaPhoneCallState
2413 2413 .getCurrentCallState()
2414 2414 == CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
2415   - if (VDBG) log("CHLD:2 Swap Calls");
  2415 + log("CHLD:2 Swap Calls");
2416 2416 PhoneUtils.switchHoldingAndActive(backgroundCall);
2417 2417 // Toggle the second callers active state flag
2418 2418 cdmaSwapSecondCallState();
@@ -2430,7 +2430,7 @@ public AtCommandResult handleSetCommand(Object[] args) {
2430 2430 PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState();
2431 2431 // For CDMA, we need to check if the call is in THRWAY_ACTIVE state
2432 2432 if (state == CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
2433   - if (VDBG) log("CHLD:3 Merge Calls");
  2433 + log("CHLD:3 Merge Calls");
2434 2434 PhoneUtils.mergeCalls();
2435 2435 } else if (state == CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
2436 2436 // State is CONF_CALL already and we are getting a merge call
4 src/com/android/phone/CallCard.java
@@ -450,7 +450,7 @@ private void updateNoCall(CallManager cm) {
450 450 * (ie. the stuff in the primaryCallInfo block) based on the specified Call.
451 451 */
452 452 private void displayMainCallStatus(CallManager cm, Call call) {
453   - if (DBG) log("displayMainCallStatus(call " + call + ")...");
  453 + log("displayMainCallStatus(call " + call + ")...");
454 454
455 455 if (call == null) {
456 456 // There's no call to display, presumably because the phone is idle.
@@ -460,7 +460,7 @@ private void displayMainCallStatus(CallManager cm, Call call) {
460 460 mPrimaryCallInfo.setVisibility(View.VISIBLE);
461 461
462 462 Call.State state = call.getState();
463   - if (DBG) log(" - call.state: " + call.getState());
  463 + log(" - call.state: " + call.getState());
464 464
465 465 switch (state) {
466 466 case ACTIVE:
2  src/com/android/phone/InCallControlState.java
@@ -203,7 +203,7 @@ public void update() {
203 203 canHold = false;
204 204 }
205 205
206   - if (DBG) dumpState();
  206 + dumpState();
207 207 }
208 208
209 209 public void dumpState() {
10 src/com/android/phone/InCallScreen.java
@@ -1186,7 +1186,7 @@ private void internalResolveIntent(Intent intent) {
1186 1186 return;
1187 1187 }
1188 1188 String action = intent.getAction();
1189   - if (DBG) log("internalResolveIntent: action=" + action);
  1189 + log("internalResolveIntent: action=" + action);
1190 1190
1191 1191 // In gingerbread and earlier releases, the InCallScreen used to
1192 1192 // directly handle certain intent actions that could initiate phone
@@ -1730,8 +1730,8 @@ private void onPhoneStateChanged(AsyncResult r) {
1730 1730 private void onDisconnect(AsyncResult r) {
1731 1731 Connection c = (Connection) r.result;
1732 1732 Connection.DisconnectCause cause = c.getDisconnectCause();
1733   - if (DBG) log("onDisconnect: connection '" + c + "', cause = " + cause
1734   - + ", showing screen: " + mApp.isShowingCallScreen());
  1733 + log("onDisconnect: connection '" + c + "', cause = " + cause
  1734 + + ", showing screen: " + mApp.isShowingCallScreen());
1735 1735
1736 1736 boolean currentlyIdle = !phoneIsInUse();
1737 1737 int autoretrySetting = AUTO_RETRY_OFF;
@@ -3009,7 +3009,7 @@ private void closeDialpadInternal(boolean animate) {
3009 3009 * Handles button clicks from the InCallTouchUi widget.
3010 3010 */
3011 3011 /* package */ void handleOnscreenButtonClick(int id) {
3012   - if (DBG) log("handleOnscreenButtonClick(id " + id + ")...");
  3012 + log("handleOnscreenButtonClick(id " + id + ")...");
3013 3013
3014 3014 switch (id) {
3015 3015 // Actions while an incoming call is ringing:
@@ -3745,7 +3745,7 @@ private void internalSwapCalls() {
3745 3745 * necessary.
3746 3746 */
3747 3747 private void setInCallScreenMode(InCallScreenMode newMode) {
3748   - if (DBG) log("setInCallScreenMode: " + newMode);
  3748 + log("setInCallScreenMode: " + newMode);
3749 3749 mApp.inCallUiState.inCallScreenMode = newMode;
3750 3750
3751 3751 switch (newMode) {
26 src/com/android/phone/PhoneUtils.java
@@ -1879,7 +1879,7 @@ static boolean isConferenceCall(Call call) {
1879 1879 * @param store True when the settings should be stored in the device.
1880 1880 */
1881 1881 /* package */ static void turnOnSpeaker(Context context, boolean flag, boolean store) {
1882   - if (DBG) log("turnOnSpeaker(flag=" + flag + ", store=" + store + ")...");
  1882 + log("turnOnSpeaker(flag=" + flag + ", store=" + store + ")...");
1883 1883 final PhoneApp app = PhoneApp.getInstance();
1884 1884
1885 1885 AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
@@ -1990,19 +1990,17 @@ static void setMute(boolean muted) {
1990 1990 */
1991 1991 private static void setMuteInternal(Phone phone, boolean muted) {
1992 1992 final PhoneApp app = PhoneApp.getInstance();
1993   - if (phone != null) {
1994   - Context context = phone.getContext();
1995   - boolean routeToAudioManager =
1996   - context.getResources().getBoolean(R.bool.send_mic_mute_to_AudioManager);
1997   - if (routeToAudioManager) {
1998   - AudioManager audioManager =
1999   - (AudioManager) phone.getContext().getSystemService(Context.AUDIO_SERVICE);
2000   - if (DBG) log("setMuteInternal: using setMicrophoneMute(" + muted + ")...");
2001   - audioManager.setMicrophoneMute(muted);
2002   - } else {
2003   - if (DBG) log("setMuteInternal: using phone.setMute(" + muted + ")...");
2004   - phone.setMute(muted);
2005   - }
  1993 + Context context = phone.getContext();
  1994 + boolean routeToAudioManager =
  1995 + context.getResources().getBoolean(R.bool.send_mic_mute_to_AudioManager);
  1996 + if (routeToAudioManager) {
  1997 + AudioManager audioManager =
  1998 + (AudioManager) phone.getContext().getSystemService(Context.AUDIO_SERVICE);
  1999 + log("setMuteInternal: using setMicrophoneMute(" + muted + ")...");
  2000 + audioManager.setMicrophoneMute(muted);
  2001 + } else {
  2002 + log("setMuteInternal: using phone.setMute(" + muted + ")...");
  2003 + phone.setMute(muted);
2006 2004 }
2007 2005 app.notificationMgr.updateMuteNotification();
2008 2006 }

Git Notes

review

Code-Review+2: Gergely Szell (sethyx) <sethyx@gmail.com>
Verified+1: Gergely Szell (sethyx) <sethyx@gmail.com>
Submitted-by: Gergely Szell (sethyx) <sethyx@gmail.com>
Submitted-at: Sun, 21 Oct 2012 16:37:30 +0100
Reviewed-on: http://gerrit.sudoservers.com/4042
Project: AOKP/packages_apps_Phone
Branch: refs/heads/jb

0 comments on commit 645ec72

Please sign in to comment.
Something went wrong with that request. Please try again.