Merge "Show roaming icon in status bar."
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 55623f0..ee9aa41 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1795,30 +1795,34 @@
                 pw.println("    [" + i + "] icon=" + ic);
             }
             
-            pw.println("see the logcat for a dump of the views we have created.");
-            // must happen on ui thread
-            mHandler.post(new Runnable() {
-                    public void run() {
-                        mStatusBarView.getLocationOnScreen(mAbsPos);
-                        Slog.d(TAG, "mStatusBarView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
-                                + ") " + mStatusBarView.getWidth() + "x"
-                                + mStatusBarView.getHeight());
-                        mStatusBarView.debug();
+            if (false) {
+                pw.println("see the logcat for a dump of the views we have created.");
+                // must happen on ui thread
+                mHandler.post(new Runnable() {
+                        public void run() {
+                            mStatusBarView.getLocationOnScreen(mAbsPos);
+                            Slog.d(TAG, "mStatusBarView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
+                                    + ") " + mStatusBarView.getWidth() + "x"
+                                    + mStatusBarView.getHeight());
+                            mStatusBarView.debug();
 
-                        mExpandedView.getLocationOnScreen(mAbsPos);
-                        Slog.d(TAG, "mExpandedView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
-                                + ") " + mExpandedView.getWidth() + "x"
-                                + mExpandedView.getHeight());
-                        mExpandedView.debug();
+                            mExpandedView.getLocationOnScreen(mAbsPos);
+                            Slog.d(TAG, "mExpandedView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
+                                    + ") " + mExpandedView.getWidth() + "x"
+                                    + mExpandedView.getHeight());
+                            mExpandedView.debug();
 
-                        mTrackingView.getLocationOnScreen(mAbsPos);
-                        Slog.d(TAG, "mTrackingView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
-                                + ") " + mTrackingView.getWidth() + "x"
-                                + mTrackingView.getHeight());
-                        mTrackingView.debug();
-                    }
-                });
+                            mTrackingView.getLocationOnScreen(mAbsPos);
+                            Slog.d(TAG, "mTrackingView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
+                                    + ") " + mTrackingView.getWidth() + "x"
+                                    + mTrackingView.getHeight());
+                            mTrackingView.debug();
+                        }
+                    });
+            }
         }
+
+        mNetworkController.dump(fd, pw, args);
     }
 
     void onBarViewAttached() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 3c85814..b50ebcd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -296,6 +296,7 @@
             }
             mServiceState = state;
             updateTelephonySignalStrength();
+            updateDataNetType();
             updateDataIcon();
             refreshViews();
         }
@@ -831,7 +832,12 @@
                 mHasMobileDataFeature ? mDataSignalIconId : mWifiIconId;
             mContentDescriptionCombinedSignal = mHasMobileDataFeature
                 ? mContentDescriptionDataType : mContentDescriptionWifi;
-            mDataTypeIconId = 0;
+
+            if ((isCdma() && isCdmaEri()) || mPhone.isNetworkRoaming()) {
+                mDataTypeIconId = R.drawable.stat_sys_data_connected_roam;
+            } else {
+                mDataTypeIconId = 0;
+            }
         }
 
         if (DEBUG) {
@@ -969,6 +975,7 @@
     }
 
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+        pw.println("Network Controller state:");
         pw.println("  - telephony ------");
         pw.print("  mHspaDataDistinguishable=");
         pw.println(mHspaDataDistinguishable);
@@ -982,6 +989,10 @@
         pw.println(mDataState);
         pw.print("  mDataActivity=");
         pw.println(mDataActivity);
+        pw.print("  mDataNetType=");
+        pw.print(mDataNetType);
+        pw.print("/");
+        pw.println(TelephonyManager.getNetworkTypeName(mDataNetType));
         pw.print("  mServiceState=");
         pw.println(mServiceState);
         pw.print("  mNetworkName=");
@@ -989,7 +1000,7 @@
         pw.print("  mNetworkNameDefault=");
         pw.println(mNetworkNameDefault);
         pw.print("  mNetworkNameSeparator=");
-        pw.println(mNetworkNameSeparator);
+        pw.println(mNetworkNameSeparator.replace("\n","\\n"));
         pw.print("  mPhoneSignalIconId=0x");
         pw.print(Integer.toHexString(mPhoneSignalIconId));
         pw.print("/");
@@ -1060,7 +1071,7 @@
     }
 
     private String getResourceName(int resId) {
-        if (resId == 0) {
+        if (resId != 0) {
             final Resources res = mContext.getResources();
             try {
                 return res.getResourceName(resId);