)]}'
{
  "commit": "0b35f9df78040f7ea9467949eb4ae7fc1f589e5b",
  "tree": "96079d1d0cd60db7974003a8651bbfa287e0bb9c",
  "parents": [
    "9a945ac1fe64f4f4d3133b05a5fc24f811418b39"
  ],
  "author": {
    "name": "Christopher Tate",
    "email": "ctate@google.com",
    "time": "Fri Oct 07 14:38:18 2022 -0700"
  },
  "committer": {
    "name": "Christopher Tate",
    "email": "ctate@google.com",
    "time": "Tue Oct 18 14:30:58 2022 -0700"
  },
  "message": "Prioritize some broadcasts ahead of strict FIFO\n\nUser-interactive event flow and broadcast priority classes both suffer\nfrom priority inversion issues with strict FIFO dispatch policy:\nexisting queued deliveries might require significant time to complete\ndispatch, with the resulting delivery latency of the interactive or\nforeground-priority messages leading to poor user experience.  To\naddress this issue, we introduce urgency-base queueing policy, with\n\"urgent\" broadcasts placed ahead of ordinary ones in the recipients\u0027\npending queues.  A broadcast is currently considered urgent when:\n\n* the sender has marked it FLAG_RECEIVER_FOREGROUND, or\n* the sender has marked it as \"interactive\", or\n* the broadcast was issued by an alarm triggering\n\nAND\n\n* the broadcast is only going to a single receiver\n\nThat final restriction prevents certain kinds of interference with\nordered broadcast delivery and completion semantics.\n\n\"interactive\" is a new BroadcastOption applied when the broadcast\nissuance is in response to a direct user interaction, i.e. when\ntimeliness of delivery is directly perceived as a responsiveness issue\nby the user.  The canonical example of this is notification\ninteractions, though perhaps the concept might usefully be applied to\nscenarios such as high-priority push message delivery.  For now its use\nis restricted to system-internal callers.\n\nFinite capacity for dispatch parallelism can currently cause priority\ninversions even with the new queueing policy if all available running\nslots are occupied with background-priority deliveries.  Addressing\nthis will happen in a follow-on CL.\n\nBug: 251902289\nTest: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest\nTest: atest FrameworksMockingServicesTests:BroadcastQueueTest\nChange-Id: I47813c2c6ca43559f39d701f104fa62527c7bc21\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c2df8022af0ff85d9239e38a02d3ab575476f8c8",
      "old_mode": 33188,
      "old_path": "core/java/android/app/BroadcastOptions.java",
      "new_id": "ee6ab89b7773a479f7cabd16832e2c31915309d8",
      "new_mode": 33188,
      "new_path": "core/java/android/app/BroadcastOptions.java"
    },
    {
      "type": "modify",
      "old_id": "1a4da7db54e9356410fd589cc8d26cce1086f941",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/am/ActivityManagerService.java",
      "new_id": "3be91cf6ed7adf206f6bbf73f0a37275faf8fa51",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/am/ActivityManagerService.java"
    },
    {
      "type": "modify",
      "old_id": "97635b53a6d41830f7acef641b09df37e34950bc",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/am/BroadcastProcessQueue.java",
      "new_id": "9b74eaaa7b52c8260ca36f4f16957aefcfeb8bd1",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/am/BroadcastProcessQueue.java"
    },
    {
      "type": "modify",
      "old_id": "bcc76e949e5f278c16721e94d49949c9a9c34afd",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/am/BroadcastRecord.java",
      "new_id": "ff09272869cf68544c7b9e33f4a7cadcc2e4e312",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/am/BroadcastRecord.java"
    },
    {
      "type": "modify",
      "old_id": "bda60ff2172b3dc3b9c87a991515b23bcff44c8e",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/am/PendingIntentRecord.java",
      "new_id": "69fe4162acc5b08de83c4b4fc228e8ca2bd9244f",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/am/PendingIntentRecord.java"
    },
    {
      "type": "modify",
      "old_id": "86915da75467e0cf9c25dc8c6191e9c49f4961f1",
      "old_mode": 33188,
      "old_path": "services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java",
      "new_id": "5a69057d2aff2926874527753ff8034d91a016d6",
      "new_mode": 33188,
      "new_path": "services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java"
    }
  ]
}
