Rename InputConfig field SENSITIVE_FOR_TRACING to SENSITIVE_FOR_PRIVACY

Making this field more generic to cater for wider use cases. In
addition to input tracing this field will also be used to hide privacy
sensitive input interactions from mirrored displays.

Test: presubmit
Bug: 325252005
Change-Id: I12c34ed5bfc320976033d2bd040b447654d906c0
diff --git a/libs/gui/include/gui/WindowInfo.h b/libs/gui/include/gui/WindowInfo.h
index e4f1890..b73e497 100644
--- a/libs/gui/include/gui/WindowInfo.h
+++ b/libs/gui/include/gui/WindowInfo.h
@@ -178,8 +178,8 @@
                 static_cast<uint32_t>(os::InputConfig::CLONE),
         GLOBAL_STYLUS_BLOCKS_TOUCH =
                 static_cast<uint32_t>(os::InputConfig::GLOBAL_STYLUS_BLOCKS_TOUCH),
-        SENSITIVE_FOR_TRACING =
-                static_cast<uint32_t>(os::InputConfig::SENSITIVE_FOR_TRACING),
+        SENSITIVE_FOR_PRIVACY =
+                static_cast<uint32_t>(os::InputConfig::SENSITIVE_FOR_PRIVACY),
         // clang-format on
     };
 
diff --git a/libs/input/android/os/InputConfig.aidl b/libs/input/android/os/InputConfig.aidl
index 6b97cbb..da62e03 100644
--- a/libs/input/android/os/InputConfig.aidl
+++ b/libs/input/android/os/InputConfig.aidl
@@ -159,10 +159,12 @@
     GLOBAL_STYLUS_BLOCKS_TOUCH   = 1 << 17,
 
     /**
-     * InputConfig used to indicate that this window is sensitive for tracing.
+     * InputConfig used to indicate that this window is privacy sensitive. This may be used to
+     * redact input interactions from tracing or screen mirroring.
+     *
      * This must be set on windows that use {@link WindowManager.LayoutParams#FLAG_SECURE},
      * but it may also be set without setting FLAG_SECURE. The tracing configuration will
      * determine how these sensitive events are eventually traced.
      */
-     SENSITIVE_FOR_TRACING       = 1 << 18,
+     SENSITIVE_FOR_PRIVACY       = 1 << 18,
 }
diff --git a/services/inputflinger/dispatcher/trace/InputTracer.cpp b/services/inputflinger/dispatcher/trace/InputTracer.cpp
index 4931a5f..a1a87af 100644
--- a/services/inputflinger/dispatcher/trace/InputTracer.cpp
+++ b/services/inputflinger/dispatcher/trace/InputTracer.cpp
@@ -88,7 +88,7 @@
     }
     const auto& info = *target.windowHandle->getInfo();
     const bool isSensitiveTarget =
-            info.inputConfig.test(gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING);
+            info.inputConfig.test(gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY);
     return {target.windowHandle->getInfo()->ownerUid, isSensitiveTarget};
 }
 
diff --git a/services/inputflinger/tests/FakeWindows.h b/services/inputflinger/tests/FakeWindows.h
index 26c2b4b..6cd76b2 100644
--- a/services/inputflinger/tests/FakeWindows.h
+++ b/services/inputflinger/tests/FakeWindows.h
@@ -164,7 +164,7 @@
             using namespace ftl::flag_operators;
             mInfo.layoutParamsFlags &= ~gui::WindowInfo::Flag::SECURE;
         }
-        mInfo.setInputConfig(InputConfig::SENSITIVE_FOR_TRACING, secure);
+        mInfo.setInputConfig(InputConfig::SENSITIVE_FOR_PRIVACY, secure);
     }
 
     inline void setInterceptsStylus(bool interceptsStylus) {
diff --git a/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp b/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
index a2b5329..2ff0fac 100644
--- a/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
+++ b/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
@@ -1061,8 +1061,8 @@
     }
 
     if (snapshot.isSecure ||
-        parentSnapshot.inputInfo.inputConfig.test(InputConfig::SENSITIVE_FOR_TRACING)) {
-        snapshot.inputInfo.inputConfig |= InputConfig::SENSITIVE_FOR_TRACING;
+        parentSnapshot.inputInfo.inputConfig.test(InputConfig::SENSITIVE_FOR_PRIVACY)) {
+        snapshot.inputInfo.inputConfig |= InputConfig::SENSITIVE_FOR_PRIVACY;
     }
 
     updateVisibility(snapshot, snapshot.isVisible);
diff --git a/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp b/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp
index 7c6cff0..82adadc 100644
--- a/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp
+++ b/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp
@@ -1204,34 +1204,34 @@
     UPDATE_AND_VERIFY(mSnapshotBuilder, STARTING_ZORDER);
 
     EXPECT_TRUE(getSnapshot(11)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_TRUE(getSnapshot(111)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_FALSE(getSnapshot(1)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_FALSE(getSnapshot(12)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_FALSE(getSnapshot(2)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
 }
 
 TEST_F(LayerSnapshotTest, setSensitiveForTracingFromInputWindowHandle) {
     setInputInfo(11, [](auto& inputInfo) {
-        inputInfo.inputConfig |= gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING;
+        inputInfo.inputConfig |= gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY;
     });
 
     UPDATE_AND_VERIFY(mSnapshotBuilder, STARTING_ZORDER);
 
     EXPECT_TRUE(getSnapshot(11)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_TRUE(getSnapshot(111)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_FALSE(getSnapshot(1)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_FALSE(getSnapshot(12)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
     EXPECT_FALSE(getSnapshot(2)->inputInfo.inputConfig.test(
-            gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING));
+            gui::WindowInfo::InputConfig::SENSITIVE_FOR_PRIVACY));
 }
 
 // b/314350323