diff --git a/core/java/android/view/VelocityTracker.java b/core/java/android/view/VelocityTracker.java index e1c4305e8747f..2b79bbfa72d40 100644 --- a/core/java/android/view/VelocityTracker.java +++ b/core/java/android/view/VelocityTracker.java @@ -19,7 +19,7 @@ package android.view; import android.annotation.IntDef; import android.compat.annotation.UnsupportedAppUsage; import android.os.Build; -import android.os.SystemProperties; +import android.sysprop.InputProperties; import android.util.ArrayMap; import android.util.Pools.SynchronizedPool; @@ -279,8 +279,7 @@ public final class VelocityTracker { // If user has not selected a specific strategy if (strategy == VELOCITY_TRACKER_STRATEGY_DEFAULT) { // Check if user specified strategy by overriding system property. - String strategyProperty = - SystemProperties.get("persist.input.velocitytracker.strategy"); + String strategyProperty = InputProperties.velocitytracker_strategy().orElse(null); if (strategyProperty == null || strategyProperty.isEmpty()) { mStrategy = strategy; } else { diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp index 4e4a5c35f0328..eb2c8a6b88343 100644 --- a/services/core/jni/Android.bp +++ b/services/core/jni/Android.bp @@ -114,6 +114,8 @@ cc_defaults { "libutils", "libui", "libvibratorservice", + "PlatformProperties", + "InputFlingerProperties", "libinput", "libinputflinger", "libinputflinger_base", diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index 94b1ad18fa9f6..790acbf2cd231 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -26,30 +26,14 @@ // Log debug messages about InputDispatcherPolicy #define DEBUG_INPUT_DISPATCHER_POLICY 0 +#include #include #include #include +#include +#include #include #include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -#include #include #include #include @@ -57,11 +41,25 @@ #include #include #include - +#include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include + +#include +#include +#include #include "android_hardware_display_DisplayViewport.h" #include "android_hardware_input_InputApplicationHandle.h" @@ -69,8 +67,6 @@ #include "android_util_Binder.h" #include "com_android_server_power_PowerManagerService.h" -#include - #define INDENT " " using android::base::ParseUint; @@ -2089,11 +2085,24 @@ static void nativeReloadDeviceAliases(JNIEnv* /* env */, InputReaderConfiguration::CHANGE_DEVICE_ALIAS); } -static jstring nativeDump(JNIEnv* env, jclass /* clazz */, jlong ptr) { - NativeInputManager* im = reinterpret_cast(ptr); +static std::string dumpInputProperties() { + std::string out = "Input properties:\n"; + const bool perWindowInputRotation = + sysprop::InputFlingerProperties::per_window_input_rotation().value_or(false); + out += StringPrintf(" per_window_input_rotation = %s\n", toString(perWindowInputRotation)); + const std::string strategy = + sysprop::InputProperties::velocitytracker_strategy().value_or("default"); + out += " persist.input.velocitytracker.strategy = " + strategy + "\n"; + out += "\n"; + return out; +} - std::string dump; +static jstring nativeDump(JNIEnv* env, jclass /* clazz */, jlong ptr) { + std::string dump = dumpInputProperties(); + + NativeInputManager* im = reinterpret_cast(ptr); im->dump(dump); + return env->NewStringUTF(dump.c_str()); }