Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -6905,4 +6905,7 @@ <!-- Whether to show a percentage text next to the progressbar while preparing to update the device --> <bool name="config_showPercentageTextDuringRebootToUpdate">true</bool> <!-- Defines the minimum interval (in ms) between two input-based user-activity poke events. --> <integer name="config_minMillisBetweenInputUserActivityEvents">100</integer> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5320,4 +5320,6 @@ <!-- Shutdown thread config flags --> <java-symbol type="bool" name="config_showPercentageTextDuringRebootToUpdate" /> <java-symbol type="integer" name="config_minMillisBetweenInputUserActivityEvents" /> </resources> services/core/java/com/android/server/input/InputSettingsObserver.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.input; import static com.android.input.flags.Flags.rateLimitUserActivityPokeInDispatcher; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading Loading @@ -113,6 +115,8 @@ class InputSettingsObserver extends ContentObserver { for (Consumer<String> observer : mObservers.values()) { observer.accept("just booted"); } configureUserActivityPokeInterval(); } @Override Loading Loading @@ -228,4 +232,13 @@ class InputSettingsObserver extends ContentObserver { mService.setAccessibilityStickyKeysEnabled( InputSettings.isAccessibilityStickyKeysEnabled(mContext)); } private void configureUserActivityPokeInterval() { if (rateLimitUserActivityPokeInDispatcher()) { final int intervalMillis = mContext.getResources().getInteger( com.android.internal.R.integer.config_minMillisBetweenInputUserActivityEvents); Log.i(TAG, "Setting user activity interval (ms) of " + intervalMillis); mNative.setMinTimeBetweenUserActivityPokes(intervalMillis); } } } services/core/java/com/android/server/input/NativeInputManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ interface NativeInputManagerService { void setFocusedDisplay(int displayId); void setMinTimeBetweenUserActivityPokes(long millis); boolean transferTouchFocus(IBinder fromChannelToken, IBinder toChannelToken, boolean isDragDrop); Loading Loading @@ -343,6 +345,9 @@ interface NativeInputManagerService { @Override public native void setFocusedDisplay(int displayId); @Override public native void setMinTimeBetweenUserActivityPokes(long millis); @Override public native boolean transferTouchFocus(IBinder fromChannelToken, IBinder toChannelToken, boolean isDragDrop); Loading services/core/jni/com_android_server_input_InputManagerService.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ public: void displayRemoved(JNIEnv* env, int32_t displayId); void setFocusedApplication(JNIEnv* env, int32_t displayId, jobject applicationHandleObj); void setFocusedDisplay(int32_t displayId); void setMinTimeBetweenUserActivityPokes(int64_t intervalMillis); void setInputDispatchMode(bool enabled, bool frozen); void setSystemUiLightsOut(bool lightsOut); void setPointerDisplayId(int32_t displayId); Loading Loading @@ -1169,6 +1170,11 @@ void NativeInputManager::setFocusedDisplay(int32_t displayId) { mInputManager->getDispatcher().setFocusedDisplay(displayId); } void NativeInputManager::setMinTimeBetweenUserActivityPokes(int64_t intervalMillis) { mInputManager->getDispatcher().setMinTimeBetweenUserActivityPokes( std::chrono::milliseconds(intervalMillis)); } void NativeInputManager::setInputDispatchMode(bool enabled, bool frozen) { mInputManager->getDispatcher().setInputDispatchMode(enabled, frozen); } Loading Loading @@ -2122,6 +2128,13 @@ static void nativeSetFocusedDisplay(JNIEnv* env, jobject nativeImplObj, jint dis im->setFocusedDisplay(displayId); } static void nativeSetUserActivityPokeInterval(JNIEnv* env, jobject nativeImplObj, jlong intervalMillis) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); im->setMinTimeBetweenUserActivityPokes(intervalMillis); } static void nativeRequestPointerCapture(JNIEnv* env, jobject nativeImplObj, jobject tokenObj, jboolean enabled) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); Loading Loading @@ -2805,6 +2818,7 @@ static const JNINativeMethod gInputManagerMethods[] = { {"setFocusedApplication", "(ILandroid/view/InputApplicationHandle;)V", (void*)nativeSetFocusedApplication}, {"setFocusedDisplay", "(I)V", (void*)nativeSetFocusedDisplay}, {"setMinTimeBetweenUserActivityPokes", "(J)V", (void*)nativeSetUserActivityPokeInterval}, {"requestPointerCapture", "(Landroid/os/IBinder;Z)V", (void*)nativeRequestPointerCapture}, {"setInputDispatchMode", "(ZZ)V", (void*)nativeSetInputDispatchMode}, {"setSystemUiLightsOut", "(Z)V", (void*)nativeSetSystemUiLightsOut}, Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -6905,4 +6905,7 @@ <!-- Whether to show a percentage text next to the progressbar while preparing to update the device --> <bool name="config_showPercentageTextDuringRebootToUpdate">true</bool> <!-- Defines the minimum interval (in ms) between two input-based user-activity poke events. --> <integer name="config_minMillisBetweenInputUserActivityEvents">100</integer> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5320,4 +5320,6 @@ <!-- Shutdown thread config flags --> <java-symbol type="bool" name="config_showPercentageTextDuringRebootToUpdate" /> <java-symbol type="integer" name="config_minMillisBetweenInputUserActivityEvents" /> </resources>
services/core/java/com/android/server/input/InputSettingsObserver.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.input; import static com.android.input.flags.Flags.rateLimitUserActivityPokeInDispatcher; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading Loading @@ -113,6 +115,8 @@ class InputSettingsObserver extends ContentObserver { for (Consumer<String> observer : mObservers.values()) { observer.accept("just booted"); } configureUserActivityPokeInterval(); } @Override Loading Loading @@ -228,4 +232,13 @@ class InputSettingsObserver extends ContentObserver { mService.setAccessibilityStickyKeysEnabled( InputSettings.isAccessibilityStickyKeysEnabled(mContext)); } private void configureUserActivityPokeInterval() { if (rateLimitUserActivityPokeInDispatcher()) { final int intervalMillis = mContext.getResources().getInteger( com.android.internal.R.integer.config_minMillisBetweenInputUserActivityEvents); Log.i(TAG, "Setting user activity interval (ms) of " + intervalMillis); mNative.setMinTimeBetweenUserActivityPokes(intervalMillis); } } }
services/core/java/com/android/server/input/NativeInputManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ interface NativeInputManagerService { void setFocusedDisplay(int displayId); void setMinTimeBetweenUserActivityPokes(long millis); boolean transferTouchFocus(IBinder fromChannelToken, IBinder toChannelToken, boolean isDragDrop); Loading Loading @@ -343,6 +345,9 @@ interface NativeInputManagerService { @Override public native void setFocusedDisplay(int displayId); @Override public native void setMinTimeBetweenUserActivityPokes(long millis); @Override public native boolean transferTouchFocus(IBinder fromChannelToken, IBinder toChannelToken, boolean isDragDrop); Loading
services/core/jni/com_android_server_input_InputManagerService.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ public: void displayRemoved(JNIEnv* env, int32_t displayId); void setFocusedApplication(JNIEnv* env, int32_t displayId, jobject applicationHandleObj); void setFocusedDisplay(int32_t displayId); void setMinTimeBetweenUserActivityPokes(int64_t intervalMillis); void setInputDispatchMode(bool enabled, bool frozen); void setSystemUiLightsOut(bool lightsOut); void setPointerDisplayId(int32_t displayId); Loading Loading @@ -1169,6 +1170,11 @@ void NativeInputManager::setFocusedDisplay(int32_t displayId) { mInputManager->getDispatcher().setFocusedDisplay(displayId); } void NativeInputManager::setMinTimeBetweenUserActivityPokes(int64_t intervalMillis) { mInputManager->getDispatcher().setMinTimeBetweenUserActivityPokes( std::chrono::milliseconds(intervalMillis)); } void NativeInputManager::setInputDispatchMode(bool enabled, bool frozen) { mInputManager->getDispatcher().setInputDispatchMode(enabled, frozen); } Loading Loading @@ -2122,6 +2128,13 @@ static void nativeSetFocusedDisplay(JNIEnv* env, jobject nativeImplObj, jint dis im->setFocusedDisplay(displayId); } static void nativeSetUserActivityPokeInterval(JNIEnv* env, jobject nativeImplObj, jlong intervalMillis) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); im->setMinTimeBetweenUserActivityPokes(intervalMillis); } static void nativeRequestPointerCapture(JNIEnv* env, jobject nativeImplObj, jobject tokenObj, jboolean enabled) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); Loading Loading @@ -2805,6 +2818,7 @@ static const JNINativeMethod gInputManagerMethods[] = { {"setFocusedApplication", "(ILandroid/view/InputApplicationHandle;)V", (void*)nativeSetFocusedApplication}, {"setFocusedDisplay", "(I)V", (void*)nativeSetFocusedDisplay}, {"setMinTimeBetweenUserActivityPokes", "(J)V", (void*)nativeSetUserActivityPokeInterval}, {"requestPointerCapture", "(Landroid/os/IBinder;Z)V", (void*)nativeRequestPointerCapture}, {"setInputDispatchMode", "(ZZ)V", (void*)nativeSetInputDispatchMode}, {"setSystemUiLightsOut", "(Z)V", (void*)nativeSetSystemUiLightsOut}, Loading