Add reason to focus change event log

We want to start changing focus in ID for multiple
reasons and this change pulls out the focus change
logic from setInputWindows. In addition, it adds a
reason to the focus event logs for better tracking.

Test: adb logcat -b events and check focus change reasons
Test: atest FlickerTests, inputflinger_tests
Bug: 151179149

Change-Id: I12cb2f02dfbdd7376fe3699a32c4e8d4d03ba57d
diff --git a/services/inputflinger/dispatcher/Entry.h b/services/inputflinger/dispatcher/Entry.h
index 740d0f9..5fd772e 100644
--- a/services/inputflinger/dispatcher/Entry.h
+++ b/services/inputflinger/dispatcher/Entry.h
@@ -112,8 +112,10 @@
 struct FocusEntry : EventEntry {
     sp<IBinder> connectionToken;
     bool hasFocus;
+    std::string_view reason;
 
-    FocusEntry(int32_t id, nsecs_t eventTime, sp<IBinder> connectionToken, bool hasFocus);
+    FocusEntry(int32_t id, nsecs_t eventTime, sp<IBinder> connectionToken, bool hasFocus,
+               std::string_view reason);
     virtual void appendDescription(std::string& msg) const;
 
 protected: