From 63539bd5fac53d90adff35df340562a1926d610e Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Wed, 29 Apr 2015 17:15:49 +0100 Subject: [PATCH] SystemUI strings: prospective VPN strings for apps Bug: 20516964 Change-Id: Ifaeb388896145fd71ff9aa9fab6e2b04af807631 --- packages/SystemUI/res/values/strings.xml | 29 +++++++---- .../src/com/android/systemui/qs/QSFooter.java | 56 ++++++---------------- 2 files changed, 34 insertions(+), 51 deletions(-) diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index f12fd0c8406a..09c0d3c5ab12 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -911,23 +911,32 @@ Your device is managed by %1$s.\n\nYour administrator can monitor and manage settings, corporate access, apps, data associated with your device, and your device\'s location information. For more information, contact your administrator. - - Your work profile is managed by %1$s.\n\nYour administrator is capable of monitoring your network activity including emails, apps and secure websites.\n\nFor more information, contact your administrator. - - - Your device is managed by:\n%1$s.\nYour work profile is managed by:\n%2$s.\n\nYour administrator can monitor your device and network activity, including emails, apps and secure websites.\n\nFor more information, contact your administrator. - - You gave an app permission to set up a VPN connection.\n\nThis app can monitor your device and network activity, including emails, apps and secure websites. + You gave an app permission to set up a VPN connection.\n\nThis app can monitor your device and network activity, including emails, apps and websites. Your device is managed by %1$s.\n\nYour administrator can monitor and manage settings, corporate access, apps, data associated with your device, and your device\'s location information.\n\nYou\'re connected to a VPN, which can monitor your network activity, including emails, apps, and websites.\n\nFor more information, contact your administrator. - Your work profile is managed by %1$s.\n\nYour administrator is capable of monitoring your network activity including emails, apps, and secure websites.\n\nFor more information, contact your administrator.\n\nYou\'re also connected to a VPN, which can monitor your network activity. + Your work profile is managed by %1$s.\n\nYour administrator is capable of monitoring your network activity including emails, apps, and websites.\n\nFor more information, contact your administrator.\n\nYou\'re also connected to a VPN, which can monitor your network activity. + + + VPN + + + You\'re connected to %1$s, which can monitor your network activity including emails, apps and websites. + + + You\'re connected to %1$s, which can monitor your personal network activity, including emails, apps and websites. + + + Your work profile is managed by %1$s. It is connected to %2$s, which can monitor your work network activity, including emails, apps and websites.\n\nFor more information, contact your administrator. + + + Your work profile is managed by %1$s. It is connected to %2$s, which can monitor your work network activity, including emails, apps and websites.\n\nYou\'re also connected to %3$s, which can monitor your personal network activity. - - Your device is managed by %1$s.\nYour work profile is managed by:\n%2$s.\n\nYour administrator is capable of monitoring your network activity including emails, apps, and secure websites.\n\nFor more information, contact your administrator.\n\nYou\'re also connected to a VPN, which can monitor your personal network activity + + Your device is managed by %1$s.\n\nYour administrator can monitor and manage settings, corporate access, apps, data associated with your device, and your device\'s location information.\n\nYou\'re connected to %2$s, which can monitor your network activity, including emails, apps, and websites.\n\nFor more information, contact your administrator. Device will stay locked until you manually unlock diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java b/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java index d8e3984a2bbb..f59e8646d11a 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); } -- 2.11.0