Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4121c15 authored by Arc Wang's avatar Arc Wang
Browse files

Hide non-system overlay window on ActivityPicker

To improve security.

Bug: 181962311
Test: manual
      Show an AlertDialog and observe if it will hide after below command.
      adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker
Change-Id: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
Merged-In: I800f0f39a469a95eb36eeaaeb2aa60a39fd916d3
parent d0888970
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@


package com.android.settings;
package com.android.settings;


import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.app.Activity;
import android.app.Activity;
import android.content.Context;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface;
@@ -72,6 +74,8 @@ public class ActivityPicker extends AlertActivity implements
    protected void onCreate(Bundle savedInstanceState) {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.onCreate(savedInstanceState);


        getWindow().addPrivateFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
        
        final Intent intent = getIntent();
        final Intent intent = getIntent();
        
        
        // Read base intent from extras, otherwise assume default
        // Read base intent from extras, otherwise assume default