Skip to content

Commit a04b366

Browse files
author
Jeff Chang
committed
Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is able to be tapped through, which can trick the user into starting a harmful activity. The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for the activity to prevent the tapjacking/overlay attack. Bug: 205595291 Test: atest CtsHarmfulAppWarningHostTestCases Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
1 parent 68221b0 commit a04b366

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/java/com/android/internal/app/HarmfulAppWarningActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.android.internal.app;
1818

19+
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
20+
1921
import android.content.Context;
2022
import android.content.DialogInterface;
2123
import android.content.Intent;
@@ -27,6 +29,7 @@
2729
import android.util.Log;
2830
import android.view.View;
2931
import android.widget.TextView;
32+
3033
import com.android.internal.R;
3134

3235
/**
@@ -48,6 +51,7 @@ public class HarmfulAppWarningActivity extends AlertActivity implements
4851
protected void onCreate(Bundle savedInstanceState) {
4952
super.onCreate(savedInstanceState);
5053

54+
getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
5155
final Intent intent = getIntent();
5256
mPackageName = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME);
5357
mTarget = intent.getParcelableExtra(Intent.EXTRA_INTENT);

0 commit comments

Comments
 (0)