summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorRobin Lee <rgl@google.com>2015-04-29 17:15:49 +0100
committerRobin Lee <rgl@google.com>2015-04-30 17:38:29 +0000
commitef25597acfb15b1f4f501fbdcbafd1b6fa8cc9c6 (patch)
tree72814c1fcce4248cbaf9cc43fdc835ab0f1e1ace /packages/SystemUI/src
parentf764d219f0faf82219600761c8d0562623b8f054 (diff)
downloadframeworks_base-ef25597acfb15b1f4f501fbdcbafd1b6fa8cc9c6.zip
frameworks_base-ef25597acfb15b1f4f501fbdcbafd1b6fa8cc9c6.tar.gz
frameworks_base-ef25597acfb15b1f4f501fbdcbafd1b6fa8cc9c6.tar.bz2
SystemUI strings: prospective VPN strings for apps
Bug: 20516964 Change-Id: Ifaeb388896145fd71ff9aa9fab6e2b04af807631 (cherry picked from commit 63539bd5fac53d90adff35df340562a1926d610e)
Diffstat (limited to 'packages/SystemUI/src')
-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);
}