Adding SecureTouchListener to DeviceAdminAdd

Dropping any touches to the activate admin button if any other
window is partly or wholly obscuring the device admin add window

Test: Cts Verifier -> Device Administration -> Device Admin Tapjacking
Test

Bug: 35056974
Change-Id: I048ecc1944c13fea624eede7861d39df2beeb393
This commit is contained in:
Suprabh Shukla
2017-05-02 18:06:16 -07:00
parent d51b94b042
commit c1f10cb9c6
2 changed files with 9 additions and 0 deletions

View File

@@ -65,6 +65,8 @@ import com.android.settings.R;
import com.android.settings.users.UserDialogs;
import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import com.android.settingslib.SecureTouchListener;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
@@ -350,6 +352,8 @@ public class DeviceAdminAdd extends Activity {
final View restrictedAction = findViewById(R.id.restricted_action);
restrictedAction.setFilterTouchesWhenObscured(true);
restrictedAction.setOnTouchListener(
new SecureTouchListener(getString(R.string.window_obscured_warning)));
restrictedAction.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (mAdding) {