Merge "Prevent HTML Injection on the Device Admin request screen" into sc-dev am: ede5041dd6

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14167793

Change-Id: If762c9bc68cd47c6a4858385fe932812e721043c
This commit is contained in:
TreeHugger Robot
2021-04-14 12:47:20 +00:00
committed by Automerger Merge Worker

View File

@@ -108,7 +108,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
DevicePolicyManager mDPM;
AppOpsManager mAppOps;
DeviceAdminInfo mDeviceAdmin;
CharSequence mAddMsgText;
String mAddMsgText;
String mProfileOwnerName;
ImageView mAdminIcon;
@@ -280,7 +280,11 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
}
}
mAddMsgText = getIntent().getCharSequenceExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION);
final CharSequence addMsgCharSequence = getIntent().getCharSequenceExtra(
DevicePolicyManager.EXTRA_ADD_EXPLANATION);
if (addMsgCharSequence != null) {
mAddMsgText = addMsgCharSequence.toString();
}
if (mAddingProfileOwner) {
// If we're trying to add a profile owner and user setup hasn't completed yet, no
@@ -634,7 +638,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
} catch (Resources.NotFoundException e) {
mAdminDescription.setVisibility(View.GONE);
}
if (mAddMsgText != null) {
if (!TextUtils.isEmpty(mAddMsgText)) {
mAddMsg.setText(mAddMsgText);
mAddMsg.setVisibility(View.VISIBLE);
} else {