Merge "Fix for battery temperature display"
diff --git a/src/com/android/settings/deviceinfo/MiscFilesHandler.java b/src/com/android/settings/deviceinfo/MiscFilesHandler.java
index 1e0cc46..93e352b 100644
--- a/src/com/android/settings/deviceinfo/MiscFilesHandler.java
+++ b/src/com/android/settings/deviceinfo/MiscFilesHandler.java
@@ -144,8 +144,8 @@
         // Returns true if all deletions were successful.
         // If a deletion fails, the method stops attempting to delete and returns false.
         private boolean deleteDir(File dir) {
-            if (dir.isDirectory()) {
-                String[] children = dir.list();
+            String[] children = dir.list();
+            if (children != null) {
                 for (int i=0; i < children.length; i++) {
                     boolean success = deleteDir(new File(dir, children[i]));
                     if (!success) {
@@ -283,4 +283,4 @@
             return view;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/wifi/WifiConfigInfo.java b/src/com/android/settings/wifi/WifiConfigInfo.java
index 2ed4f02..9b680a8 100644
--- a/src/com/android/settings/wifi/WifiConfigInfo.java
+++ b/src/com/android/settings/wifi/WifiConfigInfo.java
@@ -31,15 +31,9 @@
  */
 public class WifiConfigInfo extends Activity {
 
-    private static final String TAG = "WifiConfigInfo";
-
     private TextView mConfigList;
     private WifiManager mWifiManager;
 
-    //============================
-    // Activity lifecycle
-    //============================
-
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -52,12 +46,16 @@
     @Override
     protected void onResume() {
         super.onResume();
-        final List<WifiConfiguration> wifiConfigs = mWifiManager.getConfiguredNetworks();
-        StringBuffer configList  = new StringBuffer();
-        for (int i = wifiConfigs.size() - 1; i >= 0; i--) {
-            configList.append(wifiConfigs.get(i));
+        if (mWifiManager.isWifiEnabled()) {
+            final List<WifiConfiguration> wifiConfigs = mWifiManager.getConfiguredNetworks();
+            StringBuffer configList  = new StringBuffer();
+            for (int i = wifiConfigs.size() - 1; i >= 0; i--) {
+                configList.append(wifiConfigs.get(i));
+            }
+            mConfigList.setText(configList);
+        } else {
+            mConfigList.setText(R.string.wifi_state_disabled);
         }
-        mConfigList.setText(configList);
     }
 
 }