[Audiosharing] Add audio sharing loggings (P1)

Bug: 331515891
Test: atest
Change-Id: I7396f99538f36b47086e0c4f45ef775535f2f321
This commit is contained in:
Yiyi Shen
2024-05-29 14:15:30 +08:00
parent bce1511a75
commit d1ea3b4d96
17 changed files with 145 additions and 6 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.connecteddevice.audiosharing;
import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothCsipSetCoordinator;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
@@ -156,6 +157,10 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat
if (mVolumeControl != null) {
mVolumeControl.setDeviceVolume(
cachedDevice.getDevice(), progress, /* isGroupOp= */ true);
mMetricsFeatureProvider.action(
mContext,
SettingsEnums.ACTION_AUDIO_SHARING_CHANGE_MEDIA_DEVICE_VOLUME,
/* isPrimary= */ false);
}
}
@@ -170,6 +175,10 @@ public class AudioSharingDeviceVolumeControlUpdater extends BluetoothDeviceUpdat
- audioManager.getStreamMinVolume(AudioManager.STREAM_MUSIC);
int volume = Math.round((float) progress * streamVolumeRange / seekbarRange);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0);
mMetricsFeatureProvider.action(
mContext,
SettingsEnums.ACTION_AUDIO_SHARING_CHANGE_MEDIA_DEVICE_VOLUME,
/* isPrimary= */ true);
} catch (RuntimeException e) {
Log.e(TAG, "Fail to setAudioManagerStreamVolumeForFallbackDevice, error = " + e);
}