Clear noteOps after enabling Bluetooth adapter

The scanLEBluetooth test currently fails intermittently.  The purpose
of this test is to invoke Bluetooth scanning, then inspect which noteOps
were noted; or currently, just which op was noted first. In theory, a
Bluetooth scan should invoke the BLUETOOTH_SCAN op first.  In practice,
we sometimes see BLUETOOTH_SCAN and sometimes BLUETOOTH_CONNECT.

Why?

The first problem is that, before running a Bluetooth scan, this test
first "enables the Bluetooth adapter". And, when we do this (i.e., by
calling BluetoothAdapter::enable), the BLUETOOTH_CONNECT permission is
checked.

The second problem is that, due to logic in the test code, we only
enable Bluetooth (i.e., call `BluetoothAdapter::enable`) *if Bluetooth
isn't already enabled*.

The result is that:
- When this test runs, but the Bluetooth adapter is not already
  enabled, then BLUETOOTH_CONNECT will be the first noteOp.
- When this test runs, but the Bluetooth adapter was already enabled,
  then BLUETOOTH_SCAN will be the first noteOp.

The most obvious solution (done here) is to simply clear the list of
noteOps right after enabling the Bluetooth adapter, so that whatever
occurs afterward will be treated as "first".

Bug: 186364104
Test: atest AppOpsLoggingTest#scanLEBluetooth
Change-Id: I28688197fb72df55097d6c74c2be3967bba4a38a
1 file changed