Re-Add VPN-"Settings" button to QSFooter dialog
Button was removed during a redesign of the dialog in the case
of active device owner. However, when no DO is set, the button should
still be there.
Also, when VPN configuration is restricted, do not show the button, and
also do not show the link that is visible in the DO-version of the dialog.
Bug:34156553
Bug:29748723
Test: manual
Change-Id: I177afdc94dc396754fc7703e4316edaa7ce104cd
(cherry picked from commit a99a3f70e2)
This commit is contained in:
@@ -184,6 +184,9 @@ public class QSFooter implements OnClickListener, DialogInterface.OnClickListene
|
|||||||
profileVpn, hasProfileOwner, isBranded);
|
profileVpn, hasProfileOwner, isBranded);
|
||||||
if (deviceOwnerPackage == null) {
|
if (deviceOwnerPackage == null) {
|
||||||
mDialog.setMessage(msg);
|
mDialog.setMessage(msg);
|
||||||
|
if (mSecurityController.isVpnEnabled() && !mSecurityController.isVpnRestricted()) {
|
||||||
|
mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getSettingsButton(), this);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
View dialogView = LayoutInflater.from(mContext)
|
View dialogView = LayoutInflater.from(mContext)
|
||||||
.inflate(R.layout.quick_settings_footer_dialog, null, false);
|
.inflate(R.layout.quick_settings_footer_dialog, null, false);
|
||||||
@@ -201,10 +204,12 @@ public class QSFooter implements OnClickListener, DialogInterface.OnClickListene
|
|||||||
final SpannableStringBuilder message = new SpannableStringBuilder();
|
final SpannableStringBuilder message = new SpannableStringBuilder();
|
||||||
message.append(mContext.getString(R.string.monitoring_description_do_body_vpn,
|
message.append(mContext.getString(R.string.monitoring_description_do_body_vpn,
|
||||||
primaryVpn));
|
primaryVpn));
|
||||||
message.append(mContext.getString(
|
if (!mSecurityController.isVpnRestricted()) {
|
||||||
R.string.monitoring_description_vpn_settings_separator));
|
message.append(mContext.getString(
|
||||||
message.append(mContext.getString(R.string.monitoring_description_vpn_settings),
|
R.string.monitoring_description_vpn_settings_separator));
|
||||||
new VpnSpan(), 0);
|
message.append(mContext.getString(R.string.monitoring_description_vpn_settings),
|
||||||
|
new VpnSpan(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
TextView vpnWarning = (TextView) dialogView.findViewById(R.id.vpn_warning);
|
TextView vpnWarning = (TextView) dialogView.findViewById(R.id.vpn_warning);
|
||||||
vpnWarning.setText(message);
|
vpnWarning.setText(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user