summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steve Elliott <steell@google.com> 2023-05-02 09:25:35 -0400
committer Steve Elliott <steell@google.com> 2023-05-02 09:32:20 -0400
commit8c4326541ac25f042df916041557259fe4627a12 (patch)
tree34b282c552aa1bf0d6f8aa5ec11245c8f91a1cc2
parentcf97449a399681e9cfef028d0f16b8dbe19e47f1 (diff)
Don't mutate shared AppInfo instance in RtlContext
In RtlEnabledContext, we force-enable RtL support, since our notification templates are known to support Rtl, even if the app doesn't necessarily. We do this by updating a flag on the ApplicationInfo returned by Context#getApplicationInfo(). Because updating this flag is a mutation, other callers to Context#getApplicationInfo() after RtlEnabledContext#getApplicationInfo() has been called will see that RTL support is enabled, even if it's not true, and even if they are not using RtlEnabledContext. The solution is to copy the ApplicationInfo object returned from the wrapped Context inside of RtlEnabledContext, so that we can mutate the copy without affecting the shared ApplicationInfo. Test: atest SystemUITests Bug: 193213399 Change-Id: Ic2dd0479d60dc9c27cc448685ec83588037a69c7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
index 4522e41daf91..b4bfded58e4b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
@@ -966,7 +966,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder
@Override
public ApplicationInfo getApplicationInfo() {
- ApplicationInfo applicationInfo = super.getApplicationInfo();
+ ApplicationInfo applicationInfo = new ApplicationInfo(super.getApplicationInfo());
applicationInfo.flags |= ApplicationInfo.FLAG_SUPPORTS_RTL;
return applicationInfo;
}