From f275f865d49559a6bb3ef9cecf0ab1dd7a7a0bc3 Mon Sep 17 00:00:00 2001 From: Ibrahim Yilmaz Date: Thu, 13 Feb 2025 19:04:46 +0000 Subject: [ENR] Skip hide sensitive notification anim This CL skips hide sensitive notification animation when showing layout is the same. Current implementation reveals one of them first and transitions to the other. It causes sub-optimal experience in animations and notification content. Flag: com.android.systemui.skip_hide_sensitive_notif_animation Bug: 390624334 Test: Presubmit && Before/After video comes after Change-Id: I02552a9eceada6e5e9e0653dea326d4985aa4bbf --- packages/SystemUI/aconfig/systemui.aconfig | 10 ++++++++++ .../statusbar/notification/row/ExpandableNotificationRow.java | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig index 0ccb20ce3e3f..3e241bfe6447 100644 --- a/packages/SystemUI/aconfig/systemui.aconfig +++ b/packages/SystemUI/aconfig/systemui.aconfig @@ -2026,3 +2026,13 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "skip_hide_sensitive_notif_animation" + namespace: "systemui" + description: "Skip hide sensitive notification animation when the showing layout is not changed." + bug: "390624334" + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index d1d1ea9b5ff4..fd334447e13a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -3227,11 +3227,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } boolean oldShowingPublic = mShowingPublic; mShowingPublic = mSensitive && hideSensitive; - if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) { + boolean isShowingLayoutNotChanged = mShowingPublic == oldShowingPublic; + if (mShowingPublicInitialized && isShowingLayoutNotChanged) { return; } - if (!animated) { + final boolean shouldSkipHideSensitiveAnimation = + Flags.skipHideSensitiveNotifAnimation() && isShowingLayoutNotChanged; + if (!animated || shouldSkipHideSensitiveAnimation) { if (!NotificationContentAlphaOptimization.isEnabled() || mShowingPublic != oldShowingPublic) { // Don't reset the alpha or cancel the animation if the showing layout doesn't -- cgit v1.2.3-59-g8ed1b