OSDN Git Service

Proxy and IP fixes
authorIrfan Sheriff <isheriff@google.com>
Wed, 2 Mar 2011 22:39:32 +0000 (14:39 -0800)
committerIrfan Sheriff <isheriff@google.com>
Thu, 3 Mar 2011 22:32:47 +0000 (14:32 -0800)
Fix dual display of IP addresses for static IP
Fix inputType for proxy and IP fields
Add hint texts for IP fields

Change-Id: I478c915b245592d4738c7d7da2ca1485a247ed39

res/layout/wifi_config_preference.xml
res/layout/wifi_dialog.xml
res/values/strings.xml
src/com/android/settings/wifi/WifiConfigController.java

index f19a9ec..6103fb9 100644 (file)
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
+                    android:inputType="textNoSuggestions"
                     android:hint="@string/proxy_hostname_hint" />
 
             <TextView android:layout_width="fill_parent"
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
+                    android:inputType="number"
                     android:hint="@string/proxy_port_hint" />
 
             <TextView android:layout_width="fill_parent"
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
+                    android:inputType="textNoSuggestions"
                     android:hint="@string/proxy_exclusionlist_hint" />
 
         </LinearLayout>
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:singleLine="true"
+                android:hint="wifi_ip_address_hint"
                 android:inputType="textNoSuggestions" />
 
             <TextView
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:singleLine="true"
+                android:hint="wifi_gateway_hint"
                 android:inputType="textNoSuggestions" />
 
             <TextView
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:singleLine="true"
-                android:inputType="textNoSuggestions" />
+                android:hint="wifi_network_prefix_length_hint"
+                android:inputType="number" />
 
             <TextView
                 android:layout_width="fill_parent"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:singleLine="true"
+                android:hint="wifi_dns1_hint"
                 android:inputType="textNoSuggestions" />
 
             <TextView
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:singleLine="true"
+                android:hint="wifi_dns2_hint"
                 android:inputType="textNoSuggestions" />
     </LinearLayout>
 
index 7d199bd..f502d6d 100644 (file)
                 <EditText android:id="@+id/proxy_hostname"
                         style="@style/wifi_item_content"
                         android:hint="@string/proxy_hostname_hint"
+                        android:inputType="textNoSuggestions"
                         android:singleLine="true" />
             </LinearLayout>
             <LinearLayout style="@style/wifi_item">
                 <EditText android:id="@+id/proxy_port"
                         style="@style/wifi_item_content"
                         android:hint="@string/proxy_port_hint"
+                        android:inputType="number"
                         android:singleLine="true" />
             </LinearLayout>
             <LinearLayout style="@style/wifi_item">
                 <EditText android:id="@+id/proxy_exclusionlist"
                         style="@style/wifi_item_content"
                         android:hint="@string/proxy_exclusionlist_hint"
+                        android:inputType="textNoSuggestions"
                         android:singleLine="true" />
             </LinearLayout>
         </LinearLayout>
                 <EditText android:id="@+id/ipaddress"
                         style="@style/wifi_item_content"
                         android:singleLine="true"
+                        android:hint="@string/wifi_ip_address_hint"
                         android:inputType="textNoSuggestions" />
             </LinearLayout>
 
                 <EditText android:id="@+id/gateway"
                         style="@style/wifi_item_content"
                         android:singleLine="true"
+                        android:hint="@string/wifi_gateway_hint"
                         android:inputType="textNoSuggestions" />
             </LinearLayout>
 
                 <EditText android:id="@+id/network_prefix_length"
                         style="@style/wifi_item_content"
                         android:singleLine="true"
-                        android:inputType="textNoSuggestions" />
+                        android:hint="@string/wifi_network_prefix_length_hint"
+                        android:inputType="number" />
             </LinearLayout>
             <LinearLayout
                     style="@style/wifi_item" >
                 <EditText android:id="@+id/dns1"
                         style="@style/wifi_item_content"
                         android:singleLine="true"
+                        android:hint="@string/wifi_dns1_hint"
                         android:inputType="textNoSuggestions" />
             </LinearLayout>
 
                 <EditText android:id="@+id/dns2"
                         style="@style/wifi_item_content"
                         android:singleLine="true"
+                        android:hint="@string/wifi_dns2_hint"
                         android:inputType="textNoSuggestions" />
             </LinearLayout>
         </LinearLayout>
index 0b39a2c..374b8df 100644 (file)
     <string name="wifi_speed">Link speed</string>
     <!-- Label for the IP address of the connection -->
     <string name="wifi_ip_address">IP address</string>
+    <!-- Hint text for the IP address [CHAR LIMIT=25]-->
+    <string name="wifi_ip_address_hint">192.168.1.128</string>
     <!-- Label for the EAP method of the network -->
     <string name="wifi_eap_method">EAP method</string>
     <!-- Label for the phase2 -->
     <string name="wifi_ip_settings_invalid_network_prefix_length">Please type a network prefix length between 0 and 32.</string>
     <!-- Label for the DNS (first one) -->
     <string name="wifi_dns1">DNS 1</string>
+    <!-- Hint text for DNS [CHAR LIMIT=25]-->
+    <string name="wifi_dns1_hint">8.8.8.8</string>
     <!-- Label for the DNS (second one)-->
     <string name="wifi_dns2">DNS 2</string>
+    <!-- Hint text for DNS [CHAR LIMIT=25]-->
+    <string name="wifi_dns2_hint">4.4.4.4</string>
     <!-- Label for the gateway of the network -->
     <string name="wifi_gateway">Gateway</string>
+    <!-- Hint text for the gateway [CHAR LIMIT=25]-->
+    <string name="wifi_gateway_hint">192.168.1.1</string>
     <!-- Label for the network prefix of the network [CHAR LIMIT=25]-->
     <string name="wifi_network_prefix_length">Network prefix length</string>
+    <!-- Hint text for network prefix length [CHAR LIMIT=25] -->
+    <string name="wifi_network_prefix_length_hint">24</string>
 
     <!-- Wifi AP settings-->
     <!-- Label for wifi tether checkbox. Toggles Access Point on/off -->
index 3efedf6..0d24298 100644 (file)
@@ -198,11 +198,6 @@ public class WifiConfigController implements TextWatcher,
             WifiInfo info = mAccessPoint.getInfo();
             if (info != null) {
                 addRow(group, R.string.wifi_speed, info.getLinkSpeed() + WifiInfo.LINK_SPEED_UNITS);
-                // TODO: fix the ip address for IPv6.
-                int address = info.getIpAddress();
-                if (address != 0) {
-                    addRow(group, R.string.wifi_ip_address, Formatter.formatIpAddress(address));
-                }
             }
 
             if (mAccessPoint.networkId != INVALID_NETWORK_ID) {
@@ -211,6 +206,10 @@ public class WifiConfigController implements TextWatcher,
                     mIpSettingsSpinner.setSelection(STATIC_IP);
                 } else {
                     mIpSettingsSpinner.setSelection(DHCP);
+                    //Display IP addresses
+                    for(InetAddress a : config.linkProperties.getAddresses()) {
+                        addRow(group, R.string.wifi_ip_address, a.getHostAddress());
+                    }
                 }
 
                 if (config.proxySettings == ProxySettings.STATIC) {