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

Commit d2c9e8e3 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Use sysprop APIs for InputFlinger: per_window_input_rotation

Add a sysprop file for InputFlinger, and add a sysprop entry for the
per_window_input_rotation flag.

Bug: 179274888
Test: build
Change-Id: Id11f72f7774e2b04a9817ac5807808ccbd33fb28
parent 13296af7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ cc_defaults {
        "libui",
        "lib-platform-compat-native-api",
        "server_configurable_flags",
        "InputFlingerProperties",
    ],
    static_libs: [
        "libattestation",
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ cc_defaults {
        "libutils",
        "lib-platform-compat-native-api",
        "server_configurable_flags",
        "InputFlingerProperties",
    ],
    static_libs: [
        "libattestation",
+3 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ static constexpr bool DEBUG_TOUCH_OCCLUSION = true;
// Log debug messages about hover events.
#define DEBUG_HOVER 0

#include <InputFlingerProperties.sysprop.h>
#include <android-base/chrono_utils.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
@@ -93,7 +94,8 @@ namespace android::inputdispatcher {
// coordinates and SurfaceFlinger includes the display rotation in the input window transforms.
static bool isPerWindowInputRotationEnabled() {
    static const bool PER_WINDOW_INPUT_ROTATION =
            base::GetBoolProperty("persist.debug.per_window_input_rotation", false);
            sysprop::InputFlingerProperties::per_window_input_rotation().value_or(false);

    return PER_WINDOW_INPUT_ROTATION;
}

+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ cc_defaults {
        "libstatslog",
        "libui",
        "libutils",
        "InputFlingerProperties",
    ],
    static_libs: [
        "libc++fs",
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#ifndef _UI_INPUTREADER_TOUCH_CURSOR_INPUT_MAPPER_COMMON_H
#define _UI_INPUTREADER_TOUCH_CURSOR_INPUT_MAPPER_COMMON_H

#include <android-base/properties.h>
#include <InputFlingerProperties.sysprop.h>
#include <input/DisplayViewport.h>
#include <stdint.h>

@@ -34,7 +34,7 @@ namespace android {
// un-rotated coordinate space.
static bool isPerWindowInputRotationEnabled() {
    static const bool PER_WINDOW_INPUT_ROTATION =
            base::GetBoolProperty("persist.debug.per_window_input_rotation", false);
            sysprop::InputFlingerProperties::per_window_input_rotation().value_or(false);
    return PER_WINDOW_INPUT_ROTATION;
}

Loading