Merge "Improve Wi-Fi Settings UI in guest mode"
am: 31f64a1253
Change-Id: I15f05538344aa615a4f69eebf7fdec66efc3cf29
This commit is contained in:
@@ -168,6 +168,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
|
mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
|
||||||
|
setProgressBarVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -603,14 +604,19 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
public void onAccessPointsChanged() {
|
public void onAccessPointsChanged() {
|
||||||
// Safeguard from some delayed event handling
|
// Safeguard from some delayed event handling
|
||||||
if (getActivity() == null) return;
|
if (getActivity() == null) return;
|
||||||
|
final int wifiState = mWifiManager.getWifiState();
|
||||||
if (isUiRestricted()) {
|
if (isUiRestricted()) {
|
||||||
if (!isUiRestrictedByOnlyAdmin()) {
|
if (!isUiRestrictedByOnlyAdmin()) {
|
||||||
addMessagePreference(R.string.wifi_empty_list_user_restricted);
|
if (WifiManager.WIFI_STATE_DISABLED == wifiState) {
|
||||||
|
addMessagePreference(R.string.wifi_empty_list_wifi_off);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addMessagePreference(R.string.wifi_empty_list_user_restricted);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getPreferenceScreen().removeAll();
|
getPreferenceScreen().removeAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int wifiState = mWifiManager.getWifiState();
|
|
||||||
|
|
||||||
switch (wifiState) {
|
switch (wifiState) {
|
||||||
case WifiManager.WIFI_STATE_ENABLED:
|
case WifiManager.WIFI_STATE_ENABLED:
|
||||||
@@ -703,7 +709,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
private void setOffMessage() {
|
private void setOffMessage() {
|
||||||
if (isUiRestricted()) {
|
if (isUiRestricted()) {
|
||||||
if (!isUiRestrictedByOnlyAdmin()) {
|
if (!isUiRestrictedByOnlyAdmin()) {
|
||||||
addMessagePreference(R.string.wifi_empty_list_user_restricted);
|
addMessagePreference(R.string.wifi_empty_list_wifi_off);
|
||||||
}
|
}
|
||||||
getPreferenceScreen().removeAll();
|
getPreferenceScreen().removeAll();
|
||||||
return;
|
return;
|
||||||
@@ -759,7 +765,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
protected void setProgressBarVisible(boolean visible) {
|
protected void setProgressBarVisible(boolean visible) {
|
||||||
if (mProgressHeader != null) {
|
if (mProgressHeader != null) {
|
||||||
mProgressHeader.setVisibility(visible ? View.VISIBLE : View.GONE);
|
mProgressHeader.setVisibility(visible && !isUiRestricted() ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user