Protect UnlaunchableAppActivity against overlay attack

Bug: 181785557
Test: manual
Change-Id: If496bbb195b3f33cece6a93e683e9186d6175687
This commit is contained in:
Rubin Xu
2021-09-24 12:47:54 +01:00
parent 747806ddf8
commit 61a660519e

View File

@@ -91,7 +91,12 @@ public class UnlaunchableAppActivity extends Activity
} else {
builder.setPositiveButton(R.string.ok, null);
}
builder.show();
final AlertDialog dialog = builder.create();
dialog.create();
// Prevents screen overlay attack.
getWindow().setHideOverlayWindows(true);
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setFilterTouchesWhenObscured(true);
dialog.show();
}
private String getDialogTitle() {