From 04c66a0a3cc157aa48a013dde47f0c9485c008ee Mon Sep 17 00:00:00 2001 From: Alex Johnston Date: Wed, 8 Dec 2021 11:08:44 +0000 Subject: [PATCH] Add non system overlay flag to RequestManageCredentials Bug: 205150380 Test: Manual testing with Settings and TestDPC Change-Id: I7c23442e143a6d74935945e6f5e4ce5ce0ef77f0 --- .../android/settings/security/RequestManageCredentials.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/settings/security/RequestManageCredentials.java b/src/com/android/settings/security/RequestManageCredentials.java index 1a8da671a2c..6a1d40aef7a 100644 --- a/src/com/android/settings/security/RequestManageCredentials.java +++ b/src/com/android/settings/security/RequestManageCredentials.java @@ -16,6 +16,8 @@ package com.android.settings.security; +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import android.annotation.Nullable; import android.app.Activity; import android.app.admin.DevicePolicyEventLogger; @@ -120,6 +122,7 @@ public class RequestManageCredentials extends Activity { .setStrings(mCredentialManagerPackage) .write(); setContentView(R.layout.request_manage_credentials); + getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); mIsLandscapeMode = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; @@ -211,7 +214,9 @@ public class RequestManageCredentials extends Activity { private void loadButtons() { mButtonPanel = findViewById(R.id.button_panel); Button dontAllowButton = findViewById(R.id.dont_allow_button); + dontAllowButton.setFilterTouchesWhenObscured(true); Button allowButton = findViewById(R.id.allow_button); + allowButton.setFilterTouchesWhenObscured(true); dontAllowButton.setOnClickListener(b -> { DevicePolicyEventLogger