SF: Add trace section flags and InputWindowInfo to sf trace

Trace section flags allow users to specify sections of the trace to be collected. By default, all
sections are collected. Options are:
  TRACE_CRITICAL - adds data critical for debugging
  TRACE_INPUT - adds InputWindowInfo
  TRACE_EXTRA - adds non essential data (metadata, derived data)
  TRACE_ALL - includes all sections (default)

To set the trace flags from shell:
$ adb shell su root service call SurfaceFlinger 1033 i32 <trace_flags>

Bug: 123992966
Test: record and view sf trace
Change-Id: Icfd4d2bde08a4b3d04e37eca72ff505c7ea518f7
diff --git a/services/surfaceflinger/layerproto/layers.proto b/services/surfaceflinger/layerproto/layers.proto
index fd4695e..b097505 100644
--- a/services/surfaceflinger/layerproto/layers.proto
+++ b/services/surfaceflinger/layerproto/layers.proto
@@ -96,6 +96,8 @@
   FloatRectProto source_bounds = 44;
   FloatRectProto bounds = 45;
   FloatRectProto screen_bounds = 46;
+
+  InputWindowInfoProto input_window_info = 47;
 }
 
 message PositionProto {
@@ -155,3 +157,24 @@
   // frame number the barrier is waiting on.
   uint64 frame_number = 2;
 }
+
+message InputWindowInfoProto {
+    uint32 layout_params_flags = 1;
+    uint32 layout_params_type = 2;
+    RectProto frame = 3;
+    RegionProto touchable_region = 4;
+
+    uint32 surface_inset = 5;
+    bool visible = 6;
+    bool can_receive_keys = 7;
+    bool has_focus = 8;
+    bool has_wallpaper = 9;
+
+    float global_scale_factor = 10;
+    float window_x_scale = 11;
+    float window_y_scale = 12;
+
+    uint32 crop_layer_id = 13;
+    bool replace_touchable_region_with_crop = 14;
+    RectProto touchable_region_crop = 15;
+}