Merge "Disallow overlays for ResolverActivity" into qt-dev

This commit is contained in:
TreeHugger Robot
2021-10-06 21:36:18 +00:00
committed by Android (Google) Code Review

View File

@@ -17,6 +17,7 @@
package com.android.internal.app;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import android.annotation.Nullable;
import android.annotation.StringRes;
@@ -68,7 +69,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
@@ -778,9 +781,22 @@ public class ResolverActivity extends Activity {
bindProfileView();
}
@Override
protected void onStart() {
super.onStart();
this.getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
}
@Override
protected void onStop() {
super.onStop();
final Window window = this.getWindow();
final WindowManager.LayoutParams attrs = window.getAttributes();
attrs.privateFlags &= ~SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
window.setAttributes(attrs);
if (mRegistered) {
mPackageMonitor.unregister();
mRegistered = false;