)]}'
{
  "commit": "96f3d03bb61c57adec833d354171aed285f455c0",
  "tree": "d6c3f88ef1c863605661fbdc00b67a6432687c6b",
  "parents": [
    "3a93b970d79f5851ee7460de9c7ec4eee4020236"
  ],
  "author": {
    "name": "Lyn",
    "email": "lynhan@google.com",
    "time": "Tue Jul 09 22:19:42 2024 +0000"
  },
  "committer": {
    "name": "lyn",
    "email": "lynhan@google.com",
    "time": "Wed Jul 17 22:52:14 2024 +0000"
  },
  "message": "Fix HUN re-show after closing shade\n\nThe removeRunnable that we create for every entry\nadds the removed entry to mEntriesToRemoveWhenReorderingAllowed.\nWe remove from this list on entry update.\n\nProblem: if the HUN is seen in shade, and we close the shade\nBEFORE the removeRunnable runs OR after entry UPDATE,\nthe HUN is no longer in this list and we re-show the HUN.\n\nSolution: record the HUN as “seen” immediately when shown in shade,\ninstead of on removal/update.\n\nIn this change ---------------\n\nNotificationEntry.seenInShade\n- New field set true when HUN shows when shade is open\n\nHeadsUpmanager.OnReorderingBannedListener\n- Disables AvalancheController when shade is open\n\nHeadsUpManagerPhone.setEntry, if shade is open:\n- Set \"seenInShade\" true\n- Save for removal on shade close\n\nHeadsUpManagerPhone.updateEntry\n- Do NOT remove entry from mEntriesToRemoveWhenReorderingAllowed\n\n  When HUNs show in shade, we immediately call updateEntry for\n  them (from updatePostTime and scheduleAutoRemovalCallback) which\n  should not change the fact that they should be demoted from HUN\n  when shade closes\n\nHeadsUpManagerPhone.OnReorderingAllowedListener\n- Add this as one persistent listener instead of a temporary one for\n  each HUN\n\nNSSL.generateHeadsUpAnimation\n- Do NOT generate animation if notification seenInShade\u003d\u003dtrue\n\nAvalancheController.delete\n- Runs runnable for untracked but shown HUN so that HUN is removed\n  (without animation) once shade closes\n\nFull CUJ walkthrough --------------\n\nOpen shade\n- HeadsUpManagerPhone.OnReorderingBannedListener clears waiting HUNs\n  and disables AvalancheController\n\nHUN arrives; the disabled AvalancheController runs the following ASAP:\n- HeadsUpManagerPhone.setEntry\n  - adds entry to mEntriesToRemoveWhenReorderingAllowed\n  - sets \"seenInShade\" true\n- BaseHeadsUpManager.showNotification: runs the appear animation\n  - HeadsUpNotificationViewBinder.bindHeadsUpNotifications calls\n    NSSL.generateHeadsUpAnimation, which adds an item to\n    mHeadsUpChangeAnimations\n  - requestChildrenUpdate calls generateAllAnimationEvents, calls\n    generateHeadsUpAnimationEvents, with this new HeadsUpChangeAnimation\n- BaseHeadsUpManager.updateEntry (twice, from updatePostEntry and\n  scheduleAutoRemovalCallback)\n  - HUN now stays in mEntriesToRemoveWhenReorderingAllowed\n\nShade closes:\n- OnReorderingAllowedListener calls removeEntry and enables\nAvalancheController\n- AvalancheController runs removeEntry ASAP for the untracked HUN,\nwhich is untracked because it was never added to the queue while\nAvalancheController was disabled during shade open.\n- removeEntry results in HeadsUpNotificationViewBinder calling\nNSSL.generateHeadsUpAnimation, which DOES NOT generate the animation\nsince the HUN was seen and shade is closed; thus the HUN does not\nre-show.\n\nBug: 350797731\nTest: AvalancheControllerTest\nTest: NotificationStackScrollLayoutTest\nTest: HeadsUpManagerPhoneTest\nTest: Close shade/exit lockscreen before HUN timeout\n      \u003d\u003e HUNs do not re-show\n      Close shade/exit lockscreen after HUN timeout\n      \u003d\u003e HUNs do not re-show\n      Inline reply from shade/fullscreen quick settings,\n      then close shade\n      \u003d\u003e HUNs do not re-show\n      Send floating HUN with shade closed\n      \u003d\u003e No change to throttled behavior\n\nFlag: com.android.systemui.notification_avalanche_throttle_hun\nChange-Id: I0b1d36582025b61d7c917ca02e7deac18ce87f23\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "495ab61600f983d2a624fa52f7148ffa51f3f69f",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/AvalancheControllerTest.kt",
      "new_id": "8f9da3b2e1e35b961fbe1043e998018b5d2092f0",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/AvalancheControllerTest.kt"
    },
    {
      "type": "modify",
      "old_id": "d0ddbffecf9a9ca5328fdc7118d980193db2c39c",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/HeadsUpManagerPhoneTest.kt",
      "new_id": "5dadc4caf0f67222d29cba32b71a958a4b7df220",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/HeadsUpManagerPhoneTest.kt"
    },
    {
      "type": "modify",
      "old_id": "e48c28d3f3eed4b37b8d7fb3e152d555271f61e8",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java",
      "new_id": "cb133ecadab26e8f36c46217ee27a08f7f52cf91",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java"
    },
    {
      "type": "modify",
      "old_id": "5adf31b75fa76fb5a83e257f3240a2abab066e02",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProvider.kt",
      "new_id": "0c7ba15baa922bab09bf2af2d80f3105ee0c29ea",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProvider.kt"
    },
    {
      "type": "modify",
      "old_id": "2081adc076d13106095f92e4023e321bb4f54c37",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java",
      "new_id": "5127c91963f2819890549b48548621d0c7e6fbc0",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java"
    },
    {
      "type": "modify",
      "old_id": "a2e44dffb767ee8b3c02b126854ce9b771b17420",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java",
      "new_id": "8577d48b6679c703ed24ca96d083ebc0b9fffbff",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java"
    },
    {
      "type": "modify",
      "old_id": "40799583a7b9f71b7c564277164701f9c76e0e35",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt",
      "new_id": "645a3619a7e90ac16ee6d03366e3199ec322c53c",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt"
    },
    {
      "type": "modify",
      "old_id": "220e729625affef69922502ff2f3cf1b8ab07726",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/src/com/android/systemui/statusbar/policy/BaseHeadsUpManager.java",
      "new_id": "a0eb989a57bb94a712a1e89529e1428153a2a25e",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/src/com/android/systemui/statusbar/policy/BaseHeadsUpManager.java"
    },
    {
      "type": "modify",
      "old_id": "a925ccfe174bb3e6e72b722915e15ef7988e9032",
      "old_mode": 33188,
      "old_path": "packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java",
      "new_id": "c9710370c2c2fbbee51fd2d4db2115293b3b4efd",
      "new_mode": 33188,
      "new_path": "packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java"
    }
  ]
}
