Loading res/layout/wifi_dialog.xml +18 −0 Original line number Diff line number Diff line Loading @@ -502,6 +502,24 @@ android:inputType="textNoSuggestions" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/wifi_section"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/wifi_item" > <CheckBox android:id="@+id/shared" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/wifi_item_content" android:textSize="14sp" android:text="@string/wifi_shared" android:checked="true" /> </LinearLayout> </LinearLayout> </LinearLayout> </LinearLayout> </ScrollView> res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1635,6 +1635,8 @@ <string name="wifi_ap_choose_5G">5 GHz Band</string> <!-- Label for the spinner to show ip settings [CHAR LIMIT=25] --> <string name="wifi_ip_settings">IP settings</string> <!-- Label for the check box to share a network with other users on the same device --> <string name="wifi_shared">Share with other device users</string> <!-- Hint for unchanged fields --> <string name="wifi_unchanged">(unchanged)</string> <!-- Hint for unspecified fields --> Loading src/com/android/settings/wifi/WifiConfigController.java +16 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.net.wifi.WifiEnterpriseConfig.Eap; import android.net.wifi.WifiEnterpriseConfig.Phase2; import android.net.wifi.WifiInfo; import android.os.Handler; import android.os.UserManager; import android.security.Credentials; import android.security.KeyStore; import android.text.Editable; Loading Loading @@ -138,6 +139,8 @@ public class WifiConfigController implements TextWatcher, private TextView mProxyExclusionListView; private TextView mProxyPacView; private CheckBox mSharedCheckBox; private IpAssignment mIpAssignment = IpAssignment.UNASSIGNED; private ProxySettings mProxySettings = ProxySettings.UNASSIGNED; private ProxyInfo mHttpProxy = null; Loading Loading @@ -179,6 +182,7 @@ public class WifiConfigController implements TextWatcher, mIpSettingsSpinner.setOnItemSelectedListener(this); mProxySettingsSpinner = (Spinner) mView.findViewById(R.id.proxy_settings); mProxySettingsSpinner.setOnItemSelectedListener(this); mSharedCheckBox = (CheckBox) mView.findViewById(R.id.shared); if (mAccessPoint == null) { // new network mConfigUi.setTitle(R.string.wifi_add_network); Loading Loading @@ -218,6 +222,10 @@ public class WifiConfigController implements TextWatcher, mIpSettingsSpinner.setSelection(DHCP); } mSharedCheckBox.setEnabled(config.shared); if (!config.shared) { showAdvancedFields = true; } if (config.getProxySettings() == ProxySettings.STATIC) { mProxySettingsSpinner.setSelection(PROXY_STATIC); Loading Loading @@ -308,6 +316,12 @@ public class WifiConfigController implements TextWatcher, } } final UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); if (!userManager.isSplitSystemUser()) { mSharedCheckBox.setVisibility(View.GONE); } mConfigUi.setCancelButton(res.getString(R.string.wifi_cancel)); if (mConfigUi.getSubmitButton() != null) { enableSubmitIfAppropriate(); Loading Loading @@ -393,6 +407,8 @@ public class WifiConfigController implements TextWatcher, config.networkId = mAccessPoint.getConfig().networkId; } config.shared = mSharedCheckBox.isChecked(); switch (mAccessPointSecurity) { case AccessPoint.SECURITY_NONE: config.allowedKeyManagement.set(KeyMgmt.NONE); Loading Loading
res/layout/wifi_dialog.xml +18 −0 Original line number Diff line number Diff line Loading @@ -502,6 +502,24 @@ android:inputType="textNoSuggestions" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/wifi_section"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/wifi_item" > <CheckBox android:id="@+id/shared" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/wifi_item_content" android:textSize="14sp" android:text="@string/wifi_shared" android:checked="true" /> </LinearLayout> </LinearLayout> </LinearLayout> </LinearLayout> </ScrollView>
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1635,6 +1635,8 @@ <string name="wifi_ap_choose_5G">5 GHz Band</string> <!-- Label for the spinner to show ip settings [CHAR LIMIT=25] --> <string name="wifi_ip_settings">IP settings</string> <!-- Label for the check box to share a network with other users on the same device --> <string name="wifi_shared">Share with other device users</string> <!-- Hint for unchanged fields --> <string name="wifi_unchanged">(unchanged)</string> <!-- Hint for unspecified fields --> Loading
src/com/android/settings/wifi/WifiConfigController.java +16 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.net.wifi.WifiEnterpriseConfig.Eap; import android.net.wifi.WifiEnterpriseConfig.Phase2; import android.net.wifi.WifiInfo; import android.os.Handler; import android.os.UserManager; import android.security.Credentials; import android.security.KeyStore; import android.text.Editable; Loading Loading @@ -138,6 +139,8 @@ public class WifiConfigController implements TextWatcher, private TextView mProxyExclusionListView; private TextView mProxyPacView; private CheckBox mSharedCheckBox; private IpAssignment mIpAssignment = IpAssignment.UNASSIGNED; private ProxySettings mProxySettings = ProxySettings.UNASSIGNED; private ProxyInfo mHttpProxy = null; Loading Loading @@ -179,6 +182,7 @@ public class WifiConfigController implements TextWatcher, mIpSettingsSpinner.setOnItemSelectedListener(this); mProxySettingsSpinner = (Spinner) mView.findViewById(R.id.proxy_settings); mProxySettingsSpinner.setOnItemSelectedListener(this); mSharedCheckBox = (CheckBox) mView.findViewById(R.id.shared); if (mAccessPoint == null) { // new network mConfigUi.setTitle(R.string.wifi_add_network); Loading Loading @@ -218,6 +222,10 @@ public class WifiConfigController implements TextWatcher, mIpSettingsSpinner.setSelection(DHCP); } mSharedCheckBox.setEnabled(config.shared); if (!config.shared) { showAdvancedFields = true; } if (config.getProxySettings() == ProxySettings.STATIC) { mProxySettingsSpinner.setSelection(PROXY_STATIC); Loading Loading @@ -308,6 +316,12 @@ public class WifiConfigController implements TextWatcher, } } final UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); if (!userManager.isSplitSystemUser()) { mSharedCheckBox.setVisibility(View.GONE); } mConfigUi.setCancelButton(res.getString(R.string.wifi_cancel)); if (mConfigUi.getSubmitButton() != null) { enableSubmitIfAppropriate(); Loading Loading @@ -393,6 +407,8 @@ public class WifiConfigController implements TextWatcher, config.networkId = mAccessPoint.getConfig().networkId; } config.shared = mSharedCheckBox.isChecked(); switch (mAccessPointSecurity) { case AccessPoint.SECURITY_NONE: config.allowedKeyManagement.set(KeyMgmt.NONE); Loading