Handle unsupported operations in the time consuming pref activity.

There are some requests which can be made (e.g. for Call barring) which
an operator will not support.  Rather than raising a "sim error" dialog
in this case, we will just disable the preference and NOT show an error
for a better user experience.

Also, moving the logs for CallBarringEditPreference out of the "DBG"
block and raising some to info.  It was hard to diagnose logs in this area
since most were missing or not available in standard info level logs.

Test: See other CL; this was tested manually by forcing the call barring
screen to be available on TMO.
Fixes: 231284401

Change-Id: I23d0929d04353077c8a22a12df0b97e6df3c9fd4
diff --git a/src/com/android/phone/CallBarringEditPreference.java b/src/com/android/phone/CallBarringEditPreference.java
index 757600e..34c017c 100644
--- a/src/com/android/phone/CallBarringEditPreference.java
+++ b/src/com/android/phone/CallBarringEditPreference.java
@@ -101,9 +101,8 @@
     }
 
     void init(TimeConsumingPreferenceListener listener, boolean skipReading, Phone phone) {
-        if (DBG) {
-            Log.d(LOG_TAG, "init: phone id = " + phone.getPhoneId());
-        }
+        Log.d(LOG_TAG, "init: phone id = " + phone.getPhoneId());
+
         mPhone = phone;
 
         mTcpListener = listener;
@@ -184,10 +183,9 @@
     @Override
     protected void onDialogClosed(boolean positiveResult) {
         super.onDialogClosed(positiveResult);
-        if (DBG) {
-            Log.d(LOG_TAG, "onDialogClosed: mButtonClicked=" + mButtonClicked + ", positiveResult="
-                    + positiveResult);
-        }
+        Log.d(LOG_TAG, "onDialogClosed: mButtonClicked=" + mButtonClicked + ", positiveResult="
+                + positiveResult);
+
         if (mButtonClicked != DialogInterface.BUTTON_NEGATIVE) {
             String password = getEditText().getText().toString();
 
@@ -199,9 +197,8 @@
                 return;
             }
 
-            if (DBG) {
-                Log.d(LOG_TAG, "onDialogClosed: password=" + password);
-            }
+            Log.d(LOG_TAG, "onDialogClosed");
+
             // Send set call barring message to RIL layer.
             mPhone.setCallBarring(mFacility, !mIsActivated, password,
                     mHandler.obtainMessage(MyHandler.MESSAGE_SET_CALL_BARRING),
@@ -214,9 +211,7 @@
 
     void handleCallBarringResult(boolean status) {
         mIsActivated = status;
-        if (DBG) {
-            Log.d(LOG_TAG, "handleCallBarringResult: mIsActivated=" + mIsActivated);
-        }
+        Log.i(LOG_TAG, "handleCallBarringResult: mIsActivated=" + mIsActivated);
     }
 
     private static int getServiceClassForCallBarring(Phone phone) {
@@ -277,9 +272,7 @@
                 return;
             }
 
-            if (DBG) {
-                Log.d(LOG_TAG, "handleGetCallBarringResponse: done");
-            }
+            Log.i(LOG_TAG, "handleGetCallBarringResponse: done");
 
             AsyncResult ar = (AsyncResult) msg.obj;
 
@@ -291,9 +284,7 @@
 
             // Unsuccessful query for call barring.
             if (ar.exception != null) {
-                if (DBG) {
-                    Log.d(LOG_TAG, "handleGetCallBarringResponse: ar.exception=" + ar.exception);
-                }
+                Log.i(LOG_TAG, "handleGetCallBarringResponse: ar.exception=" + ar.exception);
                 pref.mTcpListener.onException(pref, (CommandException) ar.exception);
             } else {
                 if (ar.userObj instanceof Throwable) {
@@ -301,18 +292,14 @@
                 }
                 int[] ints = (int[]) ar.result;
                 if (ints.length == 0) {
-                    if (DBG) {
-                        Log.d(LOG_TAG, "handleGetCallBarringResponse: ar.result.length==0");
-                    }
+                    Log.i(LOG_TAG, "handleGetCallBarringResponse: ar.result.length==0");
                     pref.setEnabled(false);
                     pref.mTcpListener.onError(pref, RESPONSE_ERROR);
                 } else {
                     pref.handleCallBarringResult(ints[0] != 0);
-                    if (DBG) {
-                        Log.d(LOG_TAG,
-                                "handleGetCallBarringResponse: CB state successfully queried: "
-                                        + ints[0]);
-                    }
+                    Log.i(LOG_TAG,
+                            "handleGetCallBarringResponse: CB state successfully queried: "
+                                    + ints[0]);
                 }
             }
             // Update call barring status.
@@ -329,13 +316,9 @@
             AsyncResult ar = (AsyncResult) msg.obj;
 
             if (ar.exception != null || ar.userObj instanceof Throwable) {
-                if (DBG) {
-                    Log.d(LOG_TAG, "handleSetCallBarringResponse: ar.exception=" + ar.exception);
-                }
+                Log.i(LOG_TAG, "handleSetCallBarringResponse: ar.exception=" + ar.exception);
             }
-            if (DBG) {
-                Log.d(LOG_TAG, "handleSetCallBarringResponse: re-get call barring option");
-            }
+            Log.i(LOG_TAG, "handleSetCallBarringResponse: re-get call barring option");
             pref.mPhone.getCallBarring(
                     pref.mFacility,
                     "",