Added info about why Wi-Fi is required

Added a new optional textview to wifi settings, informing that wifi
is required during setup. For use on Nakasi 3G.

Bug: 7383934
Change-Id: I231472438e61ccddedc1e680a362f90738d64a2d
diff --git a/res/layout/setup_preference.xml b/res/layout/setup_preference.xml
index c2f6989..04e120c 100644
--- a/res/layout/setup_preference.xml
+++ b/res/layout/setup_preference.xml
@@ -74,6 +74,15 @@
         android:background="@android:color/transparent"
         android:orientation="vertical" >
 
+        <TextView
+            android:id="@+id/wifi_required_info"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="6dip"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:text="@string/wifi_required_info_text"
+            android:visibility="gone" />
+
         <ListView
             android:id="@android:id/list"
             android:layout_width="match_parent"
@@ -180,4 +189,4 @@
                 </LinearLayout>
         </RelativeLayout>
     </LinearLayout>
-</view>
\ No newline at end of file
+</view>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6eb2a26..236c0b3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -32,7 +32,7 @@
     <string name="show_dev_on">You are now a developer!</string>
     <!-- [CHAR LIMIT=NONE] Device Info screen. Okay we get it, stop pressing, you already have it on -->
     <string name="show_dev_already">No need, you are already a developer.</string>
-    
+
     <!-- Category headings in left-pane header menu --> <skip />
     <!-- Settings main menu category heading. Wireless and networks (Wi-Fi, Bluetooth, data usage...). [CHAR LIMIT=40] -->
     <string name="header_category_wireless_networks">WIRELESS &amp; NETWORKS</string>
@@ -1317,6 +1317,8 @@
     <string name="wifi_more">More</string>
     <!-- Wi-Fi settings. wps menu title [CHAR LIMIT=25]-->
     <string name="wifi_setup_wps">Automatic setup (WPS)</string>
+    <!-- Message informing that wifi is required during setup [CHAR LIMIT=NONE] -->
+    <string name="wifi_required_info_text">To complete setup, your tablet needs access to Wi-Fi. After setup, you can switch between mobile data and Wi-Fi.</string>
 
     <!-- Dialog for Access Points --> <skip />
     <!-- Label to show/hide advanced options -->
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 9c3f07f..aedb79e 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -152,6 +152,9 @@
     // this boolean extra shows a custom button that we can control
     protected static final String EXTRA_SHOW_CUSTOM_BUTTON = "wifi_show_custom_button";
 
+    // show a text regarding data charges when wifi connection is required during setup wizard
+    protected static final String EXTRA_SHOW_WIFI_REQUIRED_INFO = "wifi_show_wifi_required_info";
+
     // this boolean extra is set if we are being invoked by the Setup Wizard
     private static final String EXTRA_IS_FIRST_RUN = "firstRun";
 
@@ -238,7 +241,8 @@
                 });
             }
 
-            if (getActivity().getIntent().getBooleanExtra(EXTRA_SHOW_CUSTOM_BUTTON, false)) {
+            Intent intent = getActivity().getIntent();
+            if (intent.getBooleanExtra(EXTRA_SHOW_CUSTOM_BUTTON, false)) {
                 view.findViewById(R.id.button_bar).setVisibility(View.VISIBLE);
                 view.findViewById(R.id.back_button).setVisibility(View.INVISIBLE);
                 view.findViewById(R.id.skip_button).setVisibility(View.INVISIBLE);
@@ -258,6 +262,10 @@
                 });
             }
 
+            if (intent.getBooleanExtra(EXTRA_SHOW_WIFI_REQUIRED_INFO, false)) {
+                view.findViewById(R.id.wifi_required_info).setVisibility(View.VISIBLE);
+            }
+
             return view;
         } else {
             return super.onCreateView(inflater, container, savedInstanceState);