summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/qs/QSFooter.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSFooter.java56
1 files changed, 15 insertions, 41 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java b/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java
index d8e3984..f59e864 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java
@@ -110,21 +110,15 @@ public class QSFooter implements OnClickListener, DialogInterface.OnClickListene
}
private void handleRefreshState() {
- if (mSecurityController.hasDeviceOwner()) {
+ boolean hasDeviceOwner = mSecurityController.hasDeviceOwner();
+ boolean hasVpn = mSecurityController.isVpnEnabled();
+
+ mIsVisible = (hasVpn || hasDeviceOwner);
+ mIsIconVisible = hasVpn;
+ if (hasDeviceOwner) {
mFooterTextId = R.string.device_owned_footer;
- mIsVisible = true;
- mIsIconVisible = false;
- } else if (mSecurityController.hasProfileOwner()) {
- mFooterTextId = R.string.profile_owned_footer;
- mIsVisible = true;
- mIsIconVisible = false;
- } else if (mSecurityController.isVpnEnabled()) {
- mFooterTextId = R.string.vpn_footer;
- mIsVisible = true;
- mIsIconVisible = true;
} else {
- mIsVisible = false;
- mIsIconVisible = false;
+ mFooterTextId = R.string.vpn_footer;
}
mMainHandler.post(mUpdateDisplayState);
}
@@ -162,37 +156,17 @@ public class QSFooter implements OnClickListener, DialogInterface.OnClickListene
private String getMessage(boolean hasDeviceOwner, boolean hasProfile, boolean hasVpn) {
if (hasDeviceOwner) {
- if (hasProfile) {
- if (hasVpn) {
- return mContext.getString(
- R.string.monitoring_description_vpn_device_and_profile_owned,
- mSecurityController.getDeviceOwnerName(),
- mSecurityController.getProfileOwnerName());
- } else {
- return mContext.getString(
- R.string.monitoring_description_device_and_profile_owned,
- mSecurityController.getDeviceOwnerName(),
- mSecurityController.getProfileOwnerName());
- }
- } else {
- if (hasVpn) {
- return mContext.getString(R.string.monitoring_description_vpn_device_owned,
- mSecurityController.getDeviceOwnerName());
- } else {
- return mContext.getString(R.string.monitoring_description_device_owned,
- mSecurityController.getDeviceOwnerName());
- }
- }
- } else if (hasProfile) {
if (hasVpn) {
- return mContext.getString(
- R.string.monitoring_description_vpn_profile_owned,
- mSecurityController.getProfileOwnerName());
+ return mContext.getString(R.string.monitoring_description_vpn_device_owned,
+ mSecurityController.getDeviceOwnerName());
} else {
- return mContext.getString(
- R.string.monitoring_description_profile_owned,
- mSecurityController.getProfileOwnerName());
+ return mContext.getString(R.string.monitoring_description_device_owned,
+ mSecurityController.getDeviceOwnerName());
}
+ } else if (hasProfile) {
+ return mContext.getString(
+ R.string.monitoring_description_vpn_profile_owned,
+ mSecurityController.getProfileOwnerName());
} else {
return mContext.getString(R.string.monitoring_description_vpn);
}