Revert "WM: Switch to using APPLICATION_OVERLAY window type for ErrorDialogs"

This reverts commit 15382f1081.

Reason for revert: Don't change behavior of APPLICATION_OVERLAY

Bug: 128494358

Change-Id: Ic706c0d129fecc7b0d207ca7590e126b62b1f4a5
This commit is contained in:
Vishnu Nair
2019-03-20 16:32:44 +00:00
parent 95f66bbb55
commit 9ccb1d2f22
4 changed files with 8 additions and 11 deletions

View File

@@ -16,6 +16,8 @@
package com.android.server.am;
import com.android.internal.R;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Handler;
@@ -24,8 +26,6 @@ import android.view.KeyEvent;
import android.view.WindowManager;
import android.widget.Button;
import com.android.internal.R;
public class BaseErrorDialog extends AlertDialog {
private static final int ENABLE_BUTTONS = 0;
private static final int DISABLE_BUTTONS = 1;
@@ -36,7 +36,7 @@ public class BaseErrorDialog extends AlertDialog {
super(context, com.android.internal.R.style.Theme_DeviceDefault_Dialog_AppError);
context.assertRuntimeOverlayThemable();
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
WindowManager.LayoutParams attrs = getWindow().getAttributes();

View File

@@ -2521,7 +2521,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
private static final int[] WINDOW_TYPES_WHERE_HOME_DOESNT_WORK = {
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
WindowManager.LayoutParams.TYPE_SYSTEM_ERROR,
};

View File

@@ -831,16 +831,16 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
// like the ANR / app crashed dialogs
return canAddInternalSystemWindow ? 11 : 10;
case TYPE_APPLICATION_OVERLAY:
return canAddInternalSystemWindow ? 13 : 12;
return 12;
case TYPE_DREAM:
// used for Dreams (screensavers with TYPE_DREAM windows)
return 14;
return 13;
case TYPE_INPUT_METHOD:
// on-screen keyboards and other such input method user interfaces go here.
return 15;
return 14;
case TYPE_INPUT_METHOD_DIALOG:
// on-screen keyboards and other such input method user interfaces go here.
return 16;
return 15;
case TYPE_STATUS_BAR:
return 17;
case TYPE_STATUS_BAR_PANEL:

View File

@@ -59,7 +59,6 @@ import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLES
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_BOOT_PROGRESS;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
@@ -2067,8 +2066,7 @@ public class DisplayPolicy {
of.set(displayFrames.mRestricted);
df.set(displayFrames.mRestricted);
pf.set(displayFrames.mRestricted);
} else if (type == TYPE_TOAST || type == TYPE_SYSTEM_ALERT
|| type == TYPE_APPLICATION_OVERLAY) {
} else if (type == TYPE_TOAST || type == TYPE_SYSTEM_ALERT) {
// These dialogs are stable to interim decor changes.
cf.set(displayFrames.mStable);
of.set(displayFrames.mStable);