From d172b896aeb77d4187e7f148c583efa5030a7607 Mon Sep 17 00:00:00 2001 From: Varun Shah Date: Wed, 12 May 2021 15:11:14 -0700 Subject: Don't allow non-system window overlays for bug report warnings. Bug: 175614079 Test: test PoC app Change-Id: Ie4543c95a6b2d7de47360737b82a6dadde704053 --- packages/Shell/src/com/android/shell/BugreportWarningActivity.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/Shell/src') diff --git a/packages/Shell/src/com/android/shell/BugreportWarningActivity.java b/packages/Shell/src/com/android/shell/BugreportWarningActivity.java index 2191d939e591..ecd1369817b4 100644 --- a/packages/Shell/src/com/android/shell/BugreportWarningActivity.java +++ b/packages/Shell/src/com/android/shell/BugreportWarningActivity.java @@ -29,6 +29,7 @@ import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; +import android.view.WindowManager; import android.widget.CheckBox; import com.android.internal.app.AlertActivity; @@ -47,6 +48,10 @@ public class BugreportWarningActivity extends AlertActivity public void onCreate(Bundle icicle) { super.onCreate(icicle); + // Don't allow overlay windows. + getWindow().addSystemFlags( + WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); + mSendIntent = getIntent().getParcelableExtra(Intent.EXTRA_INTENT); // We need to touch the extras to unpack them so they get migrated to -- cgit v1.2.3-59-g8ed1b