Rate limit user activity pokes in InputDispatcher

This rate limiting used to exist in PowerManager's JNI entry point.
Moving it to InputDispatcher helps us avoid building and sending the
request to the PowerManager JNI layer if the request is not going to be
sent to the Java layer.

We are also enabling configuration of this rate. Previously, a default
rate of 100ms per use-activity type was used. We have added an XML
config to allow overriding this value device-wide, for all user-activity
types. This helps devices adjust the rate as per their use cases.

Bug: 320499729
Test: atest InputDispatcherUserActivityPokeTests
Change-Id: I66fce1082e857b4d74b69e2d87d1a5fe1d9eb57c
diff --git a/libs/input/input_flags.aconfig b/libs/input/input_flags.aconfig
index 576d9d5..0c850fe 100644
--- a/libs/input/input_flags.aconfig
+++ b/libs/input/input_flags.aconfig
@@ -97,3 +97,10 @@
   description: "Change the acceleration curves for mouse pointer movements to match the touchpad ones"
   bug: "315313622"
 }
+
+flag {
+  name: "rate_limit_user_activity_poke_in_dispatcher"
+  namespace: "input"
+  description: "Move user-activity poke rate-limiting from PowerManagerService to InputDispatcher."
+  bug: "320499729"
+}