Backport overlay security fix
Replacing app opps fix with the flag that is used elsewhere. Bug: 37442941 Test: Verified that toast and system overlay still goes away on permission and a11y service capability screens. Merged-In: I7c8d8b4143a5dd1cb684c31c4503608c8d5be0e3 Change-Id: I858f3585b2e7d334cddcf38bd0ac6481e778b6b6
This commit is contained in:
@@ -27,6 +27,8 @@ import android.text.BidiFormatter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -37,6 +39,8 @@ import com.android.settings.R;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
|
||||
|
||||
/**
|
||||
* Utility class for creating the dialog that asks users for explicit permission to grant
|
||||
* all of the requested capabilities to an accessibility service before the service is enabled
|
||||
@@ -65,6 +69,10 @@ public class AccessibilityServiceWarning {
|
||||
return false;
|
||||
};
|
||||
|
||||
Window window = ad.getWindow();
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.privateFlags |= PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
|
||||
window.setAttributes(params);
|
||||
ad.create();
|
||||
ad.getButton(AlertDialog.BUTTON_POSITIVE).setOnTouchListener(filterTouchListener);
|
||||
ad.setCanceledOnTouchOutside(true);
|
||||
|
Reference in New Issue
Block a user