)]}'
{
  "commit": "f0809c5ecb98d29cd33d48aec296571170e271ca",
  "tree": "f85aee425548194b739359f5cc073e6993261927",
  "parents": [
    "4ac21d61ba80aacea3407af5cbfd23676e1a07a3"
  ],
  "author": {
    "name": "Jay Thomas Sullivan",
    "email": "jaysullivan@google.com",
    "time": "Fri Apr 30 19:49:31 2021 -0400"
  },
  "committer": {
    "name": "Jay Thomas Sullivan",
    "email": "jaysullivan@google.com",
    "time": "Fri Apr 30 20:25:25 2021 -0400"
  },
  "message": "Clear noteOps after enabling Bluetooth adapter\n\nThe scanLEBluetooth test currently fails intermittently.  The purpose\nof this test is to invoke Bluetooth scanning, then inspect which noteOps\nwere noted; or currently, just which op was noted first. In theory, a\nBluetooth scan should invoke the BLUETOOTH_SCAN op first.  In practice,\nwe sometimes see BLUETOOTH_SCAN and sometimes BLUETOOTH_CONNECT.\n\nWhy?\n\nThe first problem is that, before running a Bluetooth scan, this test\nfirst \"enables the Bluetooth adapter\". And, when we do this (i.e., by\ncalling BluetoothAdapter::enable), the BLUETOOTH_CONNECT permission is\nchecked.\n\nThe second problem is that, due to logic in the test code, we only\nenable Bluetooth (i.e., call `BluetoothAdapter::enable`) *if Bluetooth\nisn\u0027t already enabled*.\n\nThe result is that:\n- When this test runs, but the Bluetooth adapter is not already\n  enabled, then BLUETOOTH_CONNECT will be the first noteOp.\n- When this test runs, but the Bluetooth adapter was already enabled,\n  then BLUETOOTH_SCAN will be the first noteOp.\n\nThe most obvious solution (done here) is to simply clear the list of\nnoteOps right after enabling the Bluetooth adapter, so that whatever\noccurs afterward will be treated as \"first\".\n\nBug: 186364104\nTest: atest AppOpsLoggingTest#scanLEBluetooth\nChange-Id: I28688197fb72df55097d6c74c2be3967bba4a38a\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "55f69292f774b56b06eac6705acf1664d53b75e6",
      "old_mode": 33188,
      "old_path": "tests/tests/appop/src/android/app/appops/cts/AppOpsLoggingTest.kt",
      "new_id": "8a54dd0b3af79d3ac2c4f6087032eac5d35b0592",
      "new_mode": 33188,
      "new_path": "tests/tests/appop/src/android/app/appops/cts/AppOpsLoggingTest.kt"
    }
  ]
}
