am 5ac90432: Don\'t show scan-always text if it is off.

* commit '5ac904321d81a0a0b7892c5722c464dc3c693f9f':
  Don't show scan-always text if it is off.
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 82d15e5..cb35e10 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -743,16 +743,19 @@
     private void setOffMessage() {
         if (mEmptyView != null) {
             mEmptyView.setText(R.string.wifi_empty_list_wifi_off);
-            mEmptyView.append("\n\n");
-            int resId;
-            if (Settings.Secure.isLocationProviderEnabled(getActivity().getContentResolver(),
-                    LocationManager.NETWORK_PROVIDER)) {
-                resId = R.string.wifi_scan_notify_text_location_on;
-            } else {
-                resId = R.string.wifi_scan_notify_text_location_off;
+            if (Settings.Global.getInt(getActivity().getContentResolver(),
+                    Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 1) {
+                mEmptyView.append("\n\n");
+                int resId;
+                if (Settings.Secure.isLocationProviderEnabled(getActivity().getContentResolver(),
+                        LocationManager.NETWORK_PROVIDER)) {
+                    resId = R.string.wifi_scan_notify_text_location_on;
+                } else {
+                    resId = R.string.wifi_scan_notify_text_location_off;
+                }
+                CharSequence charSeq = getText(resId);
+                mEmptyView.append(charSeq);
             }
-            CharSequence charSeq = getText(resId);
-            mEmptyView.append(charSeq);
         }
         getPreferenceScreen().removeAll();
     }