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

Commit b1eae3a0 authored by Nikolas Havrikov's avatar Nikolas Havrikov Committed by Automerger Merge Worker
Browse files

Merge "Ensure mShowDialogs gets updated as part of global config update" into...

Merge "Ensure mShowDialogs gets updated as part of global config update" into rvc-dev am: 0cf1ad84 am: fb0af321 am: 11334e71 am: 18f1c524

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11911999

Change-Id: I4391e46830831858cd39489204f8c4d815b9aa86
parents 91629aea 18f1c524
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -433,13 +433,21 @@ public class ActivityTaskManager {
        }
    }

    /** Returns whether the current UI mode supports error dialogs (ANR, crash, etc). */
    public static boolean currentUiModeSupportsErrorDialogs(@NonNull Context context) {
        final Configuration config = context.getResources().getConfiguration();
    /**
     * @return whether the UI mode of the given config supports error dialogs (ANR, crash, etc).
     * @hide
     */
    public static boolean currentUiModeSupportsErrorDialogs(@NonNull Configuration config) {
        int modeType = config.uiMode & Configuration.UI_MODE_TYPE_MASK;
        return (modeType != Configuration.UI_MODE_TYPE_CAR
                && !(modeType == Configuration.UI_MODE_TYPE_WATCH && Build.IS_USER)
                && modeType != Configuration.UI_MODE_TYPE_TELEVISION
                && modeType != Configuration.UI_MODE_TYPE_VR_HEADSET);
    }

    /** @return whether the current UI mode supports error dialogs (ANR, crash, etc). */
    public static boolean currentUiModeSupportsErrorDialogs(@NonNull Context context) {
        final Configuration config = context.getResources().getConfiguration();
        return currentUiModeSupportsErrorDialogs(config);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -5398,7 +5398,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        final boolean hideDialogsSet = Settings.Global.getInt(mContext.getContentResolver(),
                HIDE_ERROR_DIALOGS, 0) != 0;
        mShowDialogs = inputMethodExists
                && ActivityTaskManager.currentUiModeSupportsErrorDialogs(mContext)
                && ActivityTaskManager.currentUiModeSupportsErrorDialogs(config)
                && !hideDialogsSet;
    }