Tell policy about responsive connections
If a connection is unresponsive, we tell the policy about it. Now, with
this patch, we will also tell the policy that a connection becomes
responsive again. This will allow the policy to cancel the ANR dialog if
it's currently shown, and to stop recurring ANR dialogs if the user was
previously waiting for the app longer.
Bug: 171218828
Test: atest inputflinger_tests
Test: manual test via unresponsive apps
Change-Id: Ifc00601b2c4e44b721a30d5f9ebf786780d1ffd7
diff --git a/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp b/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
index c2d165e..9fea298 100644
--- a/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
+++ b/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
@@ -50,12 +50,18 @@
private:
void notifyConfigurationChanged(nsecs_t) override {}
- std::chrono::nanoseconds notifyAnr(const std::shared_ptr<InputApplicationHandle>&,
- const sp<IBinder>&, const std::string& name) override {
- ALOGE("The window is not responding : %s", name.c_str());
- return 0s;
+ void notifyNoFocusedWindowAnr(
+ const std::shared_ptr<InputApplicationHandle>& applicationHandle) override {
+ ALOGE("There is no focused window for %s", applicationHandle->getName().c_str());
}
+ void notifyConnectionUnresponsive(const sp<IBinder>& connectionToken,
+ const std::string& reason) override {
+ ALOGE("Connection is not responding: %s", reason.c_str());
+ }
+
+ void notifyConnectionResponsive(const sp<IBinder>& connectionToken) override {}
+
void notifyInputChannelBroken(const sp<IBinder>&) override {}
void notifyFocusChanged(const sp<IBinder>&, const sp<IBinder>&) override {}