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

Commit 154a77e3 authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

Update Activity Manager to prevent popups while driving.

Addresses b/25262029 by detecting if the device ui is of type car.
If in car mode the activity manager will suppress popups in the same way
it does for devices that have no form of user input.

Change-Id: I5c6314236c145fbb52656d9746513c63af8aef8d
parent 10ad84a1
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -18027,9 +18027,12 @@ public final class ActivityManagerService extends ActivityManagerNative
     * dialog / global actions also might want different behaviors.
     */
    private static final boolean shouldShowDialogs(Configuration config) {
        return !(config.keyboard == Configuration.KEYBOARD_NOKEYS
        final boolean inputMethodExists = !(config.keyboard == Configuration.KEYBOARD_NOKEYS
                                   && config.touchscreen == Configuration.TOUCHSCREEN_NOTOUCH
                                   && config.navigation == Configuration.NAVIGATION_NONAV);
        final boolean uiIsNotCarType = !((config.uiMode & Configuration.UI_MODE_TYPE_MASK)
                                    == Configuration.UI_MODE_TYPE_CAR);
        return inputMethodExists && uiIsNotCarType;
    }
    @Override