Add extra USSD code logging.

Test: Manual
Bug: 37561464
Change-Id: Ia3447d5984e83d5848dd8dba57e0758cfe3d3185
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index d92d349..40025c1 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -787,7 +787,7 @@
                                           MmiCode mmiCode,
                                           Message buttonCallbackMessage,
                                           Dialog previousAlert) {
-        if (DBG) log("displayMMIInitiate: " + mmiCode);
+        log("displayMMIInitiate: " + android.telecom.Log.pii(mmiCode.toString()));
         if (previousAlert != null) {
             previousAlert.dismiss();
         }
@@ -824,13 +824,13 @@
         boolean isCancelable = (mmiCode != null) && mmiCode.isCancelable();
 
         if (!isCancelable) {
-            if (DBG) log("not a USSD code, displaying status toast.");
+            log("displayMMIInitiate: not a USSD code, displaying status toast.");
             CharSequence text = context.getText(R.string.mmiStarted);
             Toast.makeText(context, text, Toast.LENGTH_SHORT)
                 .show();
             return null;
         } else {
-            if (DBG) log("running USSD code, displaying indeterminate progress.");
+            log("displayMMIInitiate: running USSD code, displaying intermediate progress.");
 
             // create the indeterminate progress dialog and display it.
             ProgressDialog pd = new ProgressDialog(context, THEME);
@@ -862,13 +862,13 @@
         int title = 0;  // title for the progress dialog, if needed.
         MmiCode.State state = mmiCode.getState();
 
-        if (DBG) log("displayMMIComplete: state=" + state);
+        log("displayMMIComplete: state=" + state);
 
         switch (state) {
             case PENDING:
                 // USSD code asking for feedback from user.
                 text = mmiCode.getMessage();
-                if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
+                log("displayMMIComplete: using text from PENDING MMI message: '" + text + "'");
                 break;
             case CANCELLED:
                 text = null;
@@ -887,7 +887,7 @@
 
             case FAILED:
                 text = mmiCode.getMessage();
-                if (DBG) log("- using text from MMI message: '" + text + "'");
+                log("displayMMIComplete (failed): using text from MMI message: '" + text + "'");
                 break;
             default:
                 throw new IllegalStateException("Unexpected MmiCode state: " + state);
@@ -929,9 +929,9 @@
             // A USSD in a pending state means that it is still
             // interacting with the user.
             if (state != MmiCode.State.PENDING) {
-                if (DBG) log("MMI code has finished running.");
+                log("displayMMIComplete: MMI code has finished running.");
 
-                if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
+                log("displayMMIComplete: Extended NW displayMMIInitiate (" + text + ")");
                 if (text == null || text.length() == 0)
                     return;
 
@@ -966,7 +966,8 @@
                 sUssdDialog.setMessage(sUssdMsg.toString());
                 sUssdDialog.show();
             } else {
-                if (DBG) log("USSD code has requested user input. Constructing input dialog.");
+                log("displayMMIComplete: USSD code has requested user input. Constructing input "
+                        + "dialog.");
 
                 // USSD MMI code that is interacting with the user.  The
                 // basic set of steps is this: