Loading src/com/android/settings/connecteddevice/audiosharing/AudioSharingNamePreferenceController.java +12 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.connecteddevice.audiosharing; import static com.android.settings.connecteddevice.audiosharing.AudioSharingUtils.isBroadcasting; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothLeBroadcast; import android.bluetooth.BluetoothLeBroadcastMetadata; import android.content.Context; Loading @@ -32,11 +33,13 @@ import androidx.preference.PreferenceScreen; import com.android.settings.bluetooth.Utils; import com.android.settings.core.BasePreferenceController; import com.android.settings.overlay.FeatureFactory; import com.android.settings.widget.ValidatedEditTextPreference; import com.android.settingslib.bluetooth.BluetoothUtils; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import com.android.settingslib.utils.ThreadUtils; import java.util.concurrent.Executor; Loading Loading @@ -116,6 +119,8 @@ public class AudioSharingNamePreferenceController extends BasePreferenceControll @Nullable private AudioSharingNamePreference mPreference; private final Executor mExecutor; private final AudioSharingNameTextValidator mAudioSharingNameTextValidator; private final MetricsFeatureProvider mMetricsFeatureProvider; private AtomicBoolean mCallbacksRegistered = new AtomicBoolean(false); public AudioSharingNamePreferenceController(Context context, String preferenceKey) { Loading @@ -126,6 +131,7 @@ public class AudioSharingNamePreferenceController extends BasePreferenceControll (mProfileManager != null) ? mProfileManager.getLeAudioBroadcastProfile() : null; mAudioSharingNameTextValidator = new AudioSharingNameTextValidator(); mExecutor = Executors.newSingleThreadExecutor(); mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider(); } @Override Loading Loading @@ -214,14 +220,19 @@ public class AudioSharingNamePreferenceController extends BasePreferenceControll ThreadUtils.postOnBackgroundThread( () -> { if (mBroadcast != null) { boolean isBroadcasting = isBroadcasting(mBtManager); mBroadcast.setBroadcastName((String) newValue); // We currently don't have a UI field for program info so we keep it // consistent with broadcast name. mBroadcast.setProgramInfo((String) newValue); if (isBroadcasting(mBtManager)) { if (isBroadcasting) { mBroadcast.updateBroadcast(); } updateBroadcastName(); mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_AUDIO_STREAM_NAME_UPDATED, isBroadcasting ? 1 : 0); } }); return true; Loading src/com/android/settings/connecteddevice/audiosharing/AudioSharingPasswordPreferenceController.java +50 −26 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.connecteddevice.audiosharing; import static com.android.settings.connecteddevice.audiosharing.AudioSharingUtils.isBroadcasting; import android.app.settings.SettingsEnums; import android.content.Context; import android.content.SharedPreferences; import android.util.Log; Loading @@ -29,9 +30,11 @@ import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.bluetooth.Utils; import com.android.settings.core.BasePreferenceController; import com.android.settings.overlay.FeatureFactory; import com.android.settings.widget.ValidatedEditTextPreference; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import com.android.settingslib.utils.ThreadUtils; import java.nio.charset.StandardCharsets; Loading @@ -48,6 +51,7 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont @Nullable private final LocalBluetoothLeBroadcast mBroadcast; @Nullable private AudioSharingPasswordPreference mPreference; private final AudioSharingPasswordValidator mAudioSharingPasswordValidator; private final MetricsFeatureProvider mMetricsFeatureProvider; public AudioSharingPasswordPreferenceController(Context context, String preferenceKey) { super(context, preferenceKey); Loading @@ -57,6 +61,7 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont ? mBtManager.getProfileManager().getLeAudioBroadcastProfile() : null; mAudioSharingPasswordValidator = new AudioSharingPasswordValidator(); mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider(); } @Override Loading Loading @@ -94,18 +99,38 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont } mPreference.setEditable(!isBroadcasting(mBtManager)); var password = mBroadcast.getBroadcastCode(); mPreference.setChecked(password == null || password.length == 0); mPreference.setChecked(isPublicBroadcast(password)); } @Override public void onPreferenceDataChanged(@NonNull String password, boolean isPublicBroadcast) { var unused = ThreadUtils.postOnBackgroundThread( () -> { if (mBroadcast == null || isBroadcasting(mBtManager)) { Log.w(TAG, "onPreferenceDataChanged() changing password when broadcasting or null!"); Log.w( TAG, "onPreferenceDataChanged() changing password when" + " broadcasting or null!"); return; } boolean isCurrentPublicBroadcast = isPublicBroadcast(mBroadcast.getBroadcastCode()); String currentDefaultPassword = getDefaultPassword(mContext); if (password.equals(currentDefaultPassword) && isCurrentPublicBroadcast == isPublicBroadcast) { Log.d(TAG, "onPreferenceDataChanged() nothing changed"); return; } persistDefaultPassword(mContext, password); mBroadcast.setBroadcastCode(isPublicBroadcast ? new byte[0] : password.getBytes()); mBroadcast.setBroadcastCode( isPublicBroadcast ? new byte[0] : password.getBytes()); updatePreference(); mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_AUDIO_STREAM_PASSWORD_UPDATED, isPublicBroadcast ? 1 : 0); }); } private void updatePreference() { Loading @@ -116,7 +141,7 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont ThreadUtils.postOnBackgroundThread( () -> { byte[] password = mBroadcast.getBroadcastCode(); boolean noPassword = (password == null || password.length == 0); boolean noPassword = isPublicBroadcast(password); String passwordToDisplay = noPassword ? getDefaultPassword(mContext) Loading @@ -140,16 +165,12 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont } private static void persistDefaultPassword(Context context, String defaultPassword) { var unused = ThreadUtils.postOnBackgroundThread( () -> { if (getDefaultPassword(context).equals(defaultPassword)) { return; } SharedPreferences sharedPref = context.getSharedPreferences( SHARED_PREF_NAME, Context.MODE_PRIVATE); context.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); if (sharedPref == null) { Log.w(TAG, "persistDefaultPassword(): sharedPref is empty!"); return; Loading @@ -158,7 +179,6 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(SHARED_PREF_KEY, defaultPassword); editor.apply(); }); } private static String getDefaultPassword(Context context) { Loading @@ -175,4 +195,8 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont } return value; } private static boolean isPublicBroadcast(@Nullable byte[] password) { return password == null || password.length == 0; } } src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamDetailsFragment.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.connecteddevice.audiosharing.audiostreams; import android.app.settings.SettingsEnums; import android.content.Context; import android.os.Bundle; Loading Loading @@ -45,8 +46,7 @@ public class AudioStreamDetailsFragment extends DashboardFragment { @Override public int getMetricsCategory() { // TODO(chelseahao): update metrics id return 0; return SettingsEnums.AUDIO_STREAM_DETAIL; } @Override Loading src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamMediaService.java +19 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.Service; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothLeBroadcastReceiveState; Loading @@ -40,12 +41,14 @@ import androidx.annotation.Nullable; import com.android.settings.R; import com.android.settings.bluetooth.Utils; import com.android.settings.connecteddevice.audiosharing.AudioSharingUtils; import com.android.settings.overlay.FeatureFactory; import com.android.settingslib.bluetooth.BluetoothCallback; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcastAssistant; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.VolumeControlProfile; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import java.util.ArrayList; import java.util.concurrent.ExecutorService; Loading Loading @@ -177,6 +180,8 @@ public class AudioStreamMediaService extends Service { LEAVE_BROADCAST_TEXT, com.android.settings.R.drawable.ic_clear); private final MetricsFeatureProvider mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider(); private final ExecutorService mExecutor = Executors.newSingleThreadExecutor(); private int mBroadcastId; @Nullable private ArrayList<BluetoothDevice> mDevices; Loading Loading @@ -322,6 +327,11 @@ public class AudioStreamMediaService extends Service { + 0); if (mVolumeControl != null) { mVolumeControl.setDeviceVolume(mDevices.get(0), 0, true); mMetricsFeatureProvider.action( getApplicationContext(), SettingsEnums .ACTION_AUDIO_STREAM_NOTIFICATION_MUTE_BUTTON_CLICK, 1); } } Loading @@ -341,6 +351,10 @@ public class AudioStreamMediaService extends Service { mVolumeControl.setDeviceVolume( mDevices.get(0), mLatestPositiveVolume, true); } mMetricsFeatureProvider.action( getApplicationContext(), SettingsEnums.ACTION_AUDIO_STREAM_NOTIFICATION_MUTE_BUTTON_CLICK, 0); } @Override Loading @@ -348,6 +362,10 @@ public class AudioStreamMediaService extends Service { Log.d(TAG, "onCustomAction: " + action); if (action.equals(LEAVE_BROADCAST_ACTION) && mAudioStreamsHelper != null) { mAudioStreamsHelper.removeSource(mBroadcastId); mMetricsFeatureProvider.action( getApplicationContext(), SettingsEnums .ACTION_AUDIO_STREAM_NOTIFICATION_LEAVE_BUTTON_CLICK); } } }); Loading Loading @@ -379,7 +397,7 @@ public class AudioStreamMediaService extends Service { mLocalSession != null ? mLocalSession.getSessionToken() : null); if (deviceName != null && !deviceName.isEmpty()) { mediaStyle.setRemotePlaybackInfo( deviceName, com.android.internal.R.drawable.ic_bt_headset_hfp, null); deviceName, com.android.settingslib.R.drawable.ic_bt_le_audio, null); } Notification.Builder notificationBuilder = new Notification.Builder(this, CHANNEL_ID) Loading src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamsQrCodeFragment.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.connecteddevice.audiosharing.audiostreams; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothLeBroadcastMetadata; import android.graphics.Bitmap; import android.os.Bundle; Loading Loading @@ -45,8 +46,7 @@ public class AudioStreamsQrCodeFragment extends InstrumentedFragment { @Override public int getMetricsCategory() { // TODO(chelseahao): update metrics id return 0; return SettingsEnums.AUDIO_STREAM_QR_CODE; } @Override Loading Loading
src/com/android/settings/connecteddevice/audiosharing/AudioSharingNamePreferenceController.java +12 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.connecteddevice.audiosharing; import static com.android.settings.connecteddevice.audiosharing.AudioSharingUtils.isBroadcasting; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothLeBroadcast; import android.bluetooth.BluetoothLeBroadcastMetadata; import android.content.Context; Loading @@ -32,11 +33,13 @@ import androidx.preference.PreferenceScreen; import com.android.settings.bluetooth.Utils; import com.android.settings.core.BasePreferenceController; import com.android.settings.overlay.FeatureFactory; import com.android.settings.widget.ValidatedEditTextPreference; import com.android.settingslib.bluetooth.BluetoothUtils; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import com.android.settingslib.utils.ThreadUtils; import java.util.concurrent.Executor; Loading Loading @@ -116,6 +119,8 @@ public class AudioSharingNamePreferenceController extends BasePreferenceControll @Nullable private AudioSharingNamePreference mPreference; private final Executor mExecutor; private final AudioSharingNameTextValidator mAudioSharingNameTextValidator; private final MetricsFeatureProvider mMetricsFeatureProvider; private AtomicBoolean mCallbacksRegistered = new AtomicBoolean(false); public AudioSharingNamePreferenceController(Context context, String preferenceKey) { Loading @@ -126,6 +131,7 @@ public class AudioSharingNamePreferenceController extends BasePreferenceControll (mProfileManager != null) ? mProfileManager.getLeAudioBroadcastProfile() : null; mAudioSharingNameTextValidator = new AudioSharingNameTextValidator(); mExecutor = Executors.newSingleThreadExecutor(); mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider(); } @Override Loading Loading @@ -214,14 +220,19 @@ public class AudioSharingNamePreferenceController extends BasePreferenceControll ThreadUtils.postOnBackgroundThread( () -> { if (mBroadcast != null) { boolean isBroadcasting = isBroadcasting(mBtManager); mBroadcast.setBroadcastName((String) newValue); // We currently don't have a UI field for program info so we keep it // consistent with broadcast name. mBroadcast.setProgramInfo((String) newValue); if (isBroadcasting(mBtManager)) { if (isBroadcasting) { mBroadcast.updateBroadcast(); } updateBroadcastName(); mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_AUDIO_STREAM_NAME_UPDATED, isBroadcasting ? 1 : 0); } }); return true; Loading
src/com/android/settings/connecteddevice/audiosharing/AudioSharingPasswordPreferenceController.java +50 −26 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.connecteddevice.audiosharing; import static com.android.settings.connecteddevice.audiosharing.AudioSharingUtils.isBroadcasting; import android.app.settings.SettingsEnums; import android.content.Context; import android.content.SharedPreferences; import android.util.Log; Loading @@ -29,9 +30,11 @@ import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.bluetooth.Utils; import com.android.settings.core.BasePreferenceController; import com.android.settings.overlay.FeatureFactory; import com.android.settings.widget.ValidatedEditTextPreference; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import com.android.settingslib.utils.ThreadUtils; import java.nio.charset.StandardCharsets; Loading @@ -48,6 +51,7 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont @Nullable private final LocalBluetoothLeBroadcast mBroadcast; @Nullable private AudioSharingPasswordPreference mPreference; private final AudioSharingPasswordValidator mAudioSharingPasswordValidator; private final MetricsFeatureProvider mMetricsFeatureProvider; public AudioSharingPasswordPreferenceController(Context context, String preferenceKey) { super(context, preferenceKey); Loading @@ -57,6 +61,7 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont ? mBtManager.getProfileManager().getLeAudioBroadcastProfile() : null; mAudioSharingPasswordValidator = new AudioSharingPasswordValidator(); mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider(); } @Override Loading Loading @@ -94,18 +99,38 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont } mPreference.setEditable(!isBroadcasting(mBtManager)); var password = mBroadcast.getBroadcastCode(); mPreference.setChecked(password == null || password.length == 0); mPreference.setChecked(isPublicBroadcast(password)); } @Override public void onPreferenceDataChanged(@NonNull String password, boolean isPublicBroadcast) { var unused = ThreadUtils.postOnBackgroundThread( () -> { if (mBroadcast == null || isBroadcasting(mBtManager)) { Log.w(TAG, "onPreferenceDataChanged() changing password when broadcasting or null!"); Log.w( TAG, "onPreferenceDataChanged() changing password when" + " broadcasting or null!"); return; } boolean isCurrentPublicBroadcast = isPublicBroadcast(mBroadcast.getBroadcastCode()); String currentDefaultPassword = getDefaultPassword(mContext); if (password.equals(currentDefaultPassword) && isCurrentPublicBroadcast == isPublicBroadcast) { Log.d(TAG, "onPreferenceDataChanged() nothing changed"); return; } persistDefaultPassword(mContext, password); mBroadcast.setBroadcastCode(isPublicBroadcast ? new byte[0] : password.getBytes()); mBroadcast.setBroadcastCode( isPublicBroadcast ? new byte[0] : password.getBytes()); updatePreference(); mMetricsFeatureProvider.action( mContext, SettingsEnums.ACTION_AUDIO_STREAM_PASSWORD_UPDATED, isPublicBroadcast ? 1 : 0); }); } private void updatePreference() { Loading @@ -116,7 +141,7 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont ThreadUtils.postOnBackgroundThread( () -> { byte[] password = mBroadcast.getBroadcastCode(); boolean noPassword = (password == null || password.length == 0); boolean noPassword = isPublicBroadcast(password); String passwordToDisplay = noPassword ? getDefaultPassword(mContext) Loading @@ -140,16 +165,12 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont } private static void persistDefaultPassword(Context context, String defaultPassword) { var unused = ThreadUtils.postOnBackgroundThread( () -> { if (getDefaultPassword(context).equals(defaultPassword)) { return; } SharedPreferences sharedPref = context.getSharedPreferences( SHARED_PREF_NAME, Context.MODE_PRIVATE); context.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); if (sharedPref == null) { Log.w(TAG, "persistDefaultPassword(): sharedPref is empty!"); return; Loading @@ -158,7 +179,6 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(SHARED_PREF_KEY, defaultPassword); editor.apply(); }); } private static String getDefaultPassword(Context context) { Loading @@ -175,4 +195,8 @@ public class AudioSharingPasswordPreferenceController extends BasePreferenceCont } return value; } private static boolean isPublicBroadcast(@Nullable byte[] password) { return password == null || password.length == 0; } }
src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamDetailsFragment.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.connecteddevice.audiosharing.audiostreams; import android.app.settings.SettingsEnums; import android.content.Context; import android.os.Bundle; Loading Loading @@ -45,8 +46,7 @@ public class AudioStreamDetailsFragment extends DashboardFragment { @Override public int getMetricsCategory() { // TODO(chelseahao): update metrics id return 0; return SettingsEnums.AUDIO_STREAM_DETAIL; } @Override Loading
src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamMediaService.java +19 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.Service; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothLeBroadcastReceiveState; Loading @@ -40,12 +41,14 @@ import androidx.annotation.Nullable; import com.android.settings.R; import com.android.settings.bluetooth.Utils; import com.android.settings.connecteddevice.audiosharing.AudioSharingUtils; import com.android.settings.overlay.FeatureFactory; import com.android.settingslib.bluetooth.BluetoothCallback; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager; import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcastAssistant; import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.VolumeControlProfile; import com.android.settingslib.core.instrumentation.MetricsFeatureProvider; import java.util.ArrayList; import java.util.concurrent.ExecutorService; Loading Loading @@ -177,6 +180,8 @@ public class AudioStreamMediaService extends Service { LEAVE_BROADCAST_TEXT, com.android.settings.R.drawable.ic_clear); private final MetricsFeatureProvider mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider(); private final ExecutorService mExecutor = Executors.newSingleThreadExecutor(); private int mBroadcastId; @Nullable private ArrayList<BluetoothDevice> mDevices; Loading Loading @@ -322,6 +327,11 @@ public class AudioStreamMediaService extends Service { + 0); if (mVolumeControl != null) { mVolumeControl.setDeviceVolume(mDevices.get(0), 0, true); mMetricsFeatureProvider.action( getApplicationContext(), SettingsEnums .ACTION_AUDIO_STREAM_NOTIFICATION_MUTE_BUTTON_CLICK, 1); } } Loading @@ -341,6 +351,10 @@ public class AudioStreamMediaService extends Service { mVolumeControl.setDeviceVolume( mDevices.get(0), mLatestPositiveVolume, true); } mMetricsFeatureProvider.action( getApplicationContext(), SettingsEnums.ACTION_AUDIO_STREAM_NOTIFICATION_MUTE_BUTTON_CLICK, 0); } @Override Loading @@ -348,6 +362,10 @@ public class AudioStreamMediaService extends Service { Log.d(TAG, "onCustomAction: " + action); if (action.equals(LEAVE_BROADCAST_ACTION) && mAudioStreamsHelper != null) { mAudioStreamsHelper.removeSource(mBroadcastId); mMetricsFeatureProvider.action( getApplicationContext(), SettingsEnums .ACTION_AUDIO_STREAM_NOTIFICATION_LEAVE_BUTTON_CLICK); } } }); Loading Loading @@ -379,7 +397,7 @@ public class AudioStreamMediaService extends Service { mLocalSession != null ? mLocalSession.getSessionToken() : null); if (deviceName != null && !deviceName.isEmpty()) { mediaStyle.setRemotePlaybackInfo( deviceName, com.android.internal.R.drawable.ic_bt_headset_hfp, null); deviceName, com.android.settingslib.R.drawable.ic_bt_le_audio, null); } Notification.Builder notificationBuilder = new Notification.Builder(this, CHANNEL_ID) Loading
src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamsQrCodeFragment.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.connecteddevice.audiosharing.audiostreams; import android.app.settings.SettingsEnums; import android.bluetooth.BluetoothLeBroadcastMetadata; import android.graphics.Bitmap; import android.os.Bundle; Loading Loading @@ -45,8 +46,7 @@ public class AudioStreamsQrCodeFragment extends InstrumentedFragment { @Override public int getMetricsCategory() { // TODO(chelseahao): update metrics id return 0; return SettingsEnums.AUDIO_STREAM_QR_CODE; } @Override Loading