Loading system/binder/android/bluetooth/IBluetooth.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.OobData; import android.content.AttributionSource; import android.os.ParcelUuid; import android.os.ParcelFileDescriptor; import android.os.ResultReceiver; Loading Loading @@ -59,7 +60,7 @@ interface IBluetooth int getDiscoverableTimeout(); boolean setDiscoverableTimeout(int timeout); boolean startDiscovery(String callingPackage, String callingFeatureId); boolean startDiscovery(in AttributionSource attributionSource); boolean cancelDiscovery(); boolean isDiscovering(); long getDiscoveryEndMillis(); Loading system/binder/android/bluetooth/IBluetoothGatt.aidl +4 −3 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.bluetooth.le.ScanFilter; import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanSettings; import android.bluetooth.le.ResultStorageDescriptor; import android.content.AttributionSource; import android.os.ParcelUuid; import android.os.WorkSource; Loading @@ -46,10 +47,10 @@ interface IBluetoothGatt { void registerScanner(in IScannerCallback callback, in WorkSource workSource); void unregisterScanner(in int scannerId); void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters, in List scanStorages, in String callingPackage, String callingFeatureId); in List scanStorages, in AttributionSource attributionSource); void startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters, in String callingPackage, String callingFeatureId); void stopScanForIntent(in PendingIntent intent, in String callingPackage); in AttributionSource attributionSource); void stopScanForIntent(in PendingIntent intent); void stopScan(in int scannerId); void flushPendingBatchResults(in int scannerId); Loading system/btif/include/btif_metrics_logging.h +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ void log_a2dp_audio_overrun_event(const RawAddress& address, int num_dropped_encoded_frames, int num_dropped_encoded_bytes); void log_a2dp_playback_event(const RawAddress& address, int playback_state, int audio_coding_mode); void log_read_rssi_result(const RawAddress& address, uint16_t handle, uint32_t cmd_status, int8_t rssi); Loading system/btif/src/btif_av.cc +24 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <base/bind.h> #include <base/strings/stringprintf.h> #include <frameworks/proto_logging/stats/enums/bluetooth/a2dp/enums.pb.h> #include <cstdint> #include <future> #include <memory> Loading @@ -38,7 +39,10 @@ #include "btif/include/btif_profile_queue.h" #include "btif/include/btif_rc.h" #include "btif/include/btif_util.h" #include "btif_metrics_logging.h" #include "common/metrics.h" #include "common/state_machine.h" #include "hardware/bt_av.h" #include "include/hardware/bt_rc.h" #include "main/shim/dumpsys.h" #include "osi/include/properties.h" Loading Loading @@ -2410,6 +2414,26 @@ static void btif_report_audio_state(const RawAddress& peer_address, base::Bind(btif_av_sink.Callbacks()->audio_state_cb, peer_address, state)); } using android::bluetooth::a2dp::AudioCodingModeEnum; using android::bluetooth::a2dp::PlaybackStateEnum; PlaybackStateEnum playback_state = PlaybackStateEnum::PLAYBACK_STATE_UNKNOWN; switch (state) { case BTAV_AUDIO_STATE_STARTED: playback_state = PlaybackStateEnum::PLAYBACK_STATE_PLAYING; break; case BTAV_AUDIO_STATE_STOPPED: playback_state = PlaybackStateEnum::PLAYBACK_STATE_NOT_PLAYING; break; default: break; } AudioCodingModeEnum audio_coding_mode = btif_av_is_a2dp_offload_running() ? AudioCodingModeEnum::AUDIO_CODING_MODE_HARDWARE : AudioCodingModeEnum::AUDIO_CODING_MODE_SOFTWARE; log_a2dp_playback_event(peer_address, playback_state, audio_coding_mode); } void btif_av_report_source_codec_state( Loading system/btif/src/btif_metrics_logging.cc +11 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,17 @@ void log_a2dp_audio_overrun_event(const RawAddress& address, } } void log_a2dp_playback_event(const RawAddress& address, int playback_state, int audio_coding_mode) { if (bluetooth::shim::is_any_gd_enabled()) { bluetooth::shim::LogMetricA2dpPlaybackEvent(address, playback_state, audio_coding_mode); } else { bluetooth::common::LogA2dpPlaybackEvent(address, playback_state, audio_coding_mode); } } void log_read_rssi_result(const RawAddress& address, uint16_t handle, uint32_t cmd_status, int8_t rssi) { if (bluetooth::shim::is_any_gd_enabled()) { Loading Loading
system/binder/android/bluetooth/IBluetooth.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.OobData; import android.content.AttributionSource; import android.os.ParcelUuid; import android.os.ParcelFileDescriptor; import android.os.ResultReceiver; Loading Loading @@ -59,7 +60,7 @@ interface IBluetooth int getDiscoverableTimeout(); boolean setDiscoverableTimeout(int timeout); boolean startDiscovery(String callingPackage, String callingFeatureId); boolean startDiscovery(in AttributionSource attributionSource); boolean cancelDiscovery(); boolean isDiscovering(); long getDiscoveryEndMillis(); Loading
system/binder/android/bluetooth/IBluetoothGatt.aidl +4 −3 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.bluetooth.le.ScanFilter; import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanSettings; import android.bluetooth.le.ResultStorageDescriptor; import android.content.AttributionSource; import android.os.ParcelUuid; import android.os.WorkSource; Loading @@ -46,10 +47,10 @@ interface IBluetoothGatt { void registerScanner(in IScannerCallback callback, in WorkSource workSource); void unregisterScanner(in int scannerId); void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters, in List scanStorages, in String callingPackage, String callingFeatureId); in List scanStorages, in AttributionSource attributionSource); void startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters, in String callingPackage, String callingFeatureId); void stopScanForIntent(in PendingIntent intent, in String callingPackage); in AttributionSource attributionSource); void stopScanForIntent(in PendingIntent intent); void stopScan(in int scannerId); void flushPendingBatchResults(in int scannerId); Loading
system/btif/include/btif_metrics_logging.h +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ void log_a2dp_audio_overrun_event(const RawAddress& address, int num_dropped_encoded_frames, int num_dropped_encoded_bytes); void log_a2dp_playback_event(const RawAddress& address, int playback_state, int audio_coding_mode); void log_read_rssi_result(const RawAddress& address, uint16_t handle, uint32_t cmd_status, int8_t rssi); Loading
system/btif/src/btif_av.cc +24 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <base/bind.h> #include <base/strings/stringprintf.h> #include <frameworks/proto_logging/stats/enums/bluetooth/a2dp/enums.pb.h> #include <cstdint> #include <future> #include <memory> Loading @@ -38,7 +39,10 @@ #include "btif/include/btif_profile_queue.h" #include "btif/include/btif_rc.h" #include "btif/include/btif_util.h" #include "btif_metrics_logging.h" #include "common/metrics.h" #include "common/state_machine.h" #include "hardware/bt_av.h" #include "include/hardware/bt_rc.h" #include "main/shim/dumpsys.h" #include "osi/include/properties.h" Loading Loading @@ -2410,6 +2414,26 @@ static void btif_report_audio_state(const RawAddress& peer_address, base::Bind(btif_av_sink.Callbacks()->audio_state_cb, peer_address, state)); } using android::bluetooth::a2dp::AudioCodingModeEnum; using android::bluetooth::a2dp::PlaybackStateEnum; PlaybackStateEnum playback_state = PlaybackStateEnum::PLAYBACK_STATE_UNKNOWN; switch (state) { case BTAV_AUDIO_STATE_STARTED: playback_state = PlaybackStateEnum::PLAYBACK_STATE_PLAYING; break; case BTAV_AUDIO_STATE_STOPPED: playback_state = PlaybackStateEnum::PLAYBACK_STATE_NOT_PLAYING; break; default: break; } AudioCodingModeEnum audio_coding_mode = btif_av_is_a2dp_offload_running() ? AudioCodingModeEnum::AUDIO_CODING_MODE_HARDWARE : AudioCodingModeEnum::AUDIO_CODING_MODE_SOFTWARE; log_a2dp_playback_event(peer_address, playback_state, audio_coding_mode); } void btif_av_report_source_codec_state( Loading
system/btif/src/btif_metrics_logging.cc +11 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,17 @@ void log_a2dp_audio_overrun_event(const RawAddress& address, } } void log_a2dp_playback_event(const RawAddress& address, int playback_state, int audio_coding_mode) { if (bluetooth::shim::is_any_gd_enabled()) { bluetooth::shim::LogMetricA2dpPlaybackEvent(address, playback_state, audio_coding_mode); } else { bluetooth::common::LogA2dpPlaybackEvent(address, playback_state, audio_coding_mode); } } void log_read_rssi_result(const RawAddress& address, uint16_t handle, uint32_t cmd_status, int8_t rssi) { if (bluetooth::shim::is_any_gd_enabled()) { Loading