Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import androidx.annotation.VisibleForTesting; import androidx.collection.ArraySet; import com.android.settingslib.R; import com.android.settingslib.flags.Flags; import com.android.settingslib.utils.ThreadUtils; import java.util.Collection; Loading Loading @@ -236,12 +235,13 @@ public class BluetoothEventManager { LocalBluetoothLeBroadcast broadcast = mBtManager == null ? null : mBtManager.getProfileManager().getLeAudioBroadcastProfile(); // Dispatch handleOnProfileStateChanged to local broadcast profile if (Flags.promoteAudioSharingForSecondAutoConnectedLeaDevice() && broadcast != null && state == BluetoothAdapter.STATE_CONNECTED) { if (broadcast != null && state == BluetoothAdapter.STATE_CONNECTED) { Log.d(TAG, "dispatchProfileConnectionStateChanged to local broadcast profile"); var unused = ThreadUtils.postOnBackgroundThread( () -> broadcast.handleProfileConnected(device, bluetoothProfile, mBtManager)); var unused = ThreadUtils.postOnBackgroundThread( () -> broadcast.handleProfileConnected( device, bluetoothProfile, mBtManager)); } } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +0 −4 Original line number Diff line number Diff line Loading @@ -1268,10 +1268,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { @WorkerThread public void handleProfileConnected(@NonNull CachedBluetoothDevice cachedDevice, int bluetoothProfile, @Nullable LocalBluetoothManager btManager) { if (!Flags.promoteAudioSharingForSecondAutoConnectedLeaDevice()) { Log.d(TAG, "Skip handleProfileConnected, flag off"); return; } if (!SYSUI_PKG.equals(mContext.getPackageName())) { Log.d(TAG, "Skip handleProfileConnected, not a valid caller"); return; Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothEventManagerTest.java +0 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.UserHandle; import android.os.UserManager; import android.platform.test.annotations.EnableFlags; import android.platform.test.flag.junit.SetFlagsRule; import android.telephony.TelephonyManager; Loading Loading @@ -208,7 +207,6 @@ public class BluetoothEventManagerTest { * callback. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_registerCallback_shouldDispatchCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); Loading @@ -224,7 +222,6 @@ public class BluetoothEventManagerTest { * LocalBluetoothLeBroadcast}#handleProfileConnected when audio sharing flag is off. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_flagOff_noCallToBroadcastProfile() { setUpAudioSharing(/* enableFlag= */ false, /* enableFeature= */ true, /* enableProfile= */ true, /* workProfile= */ false); Loading @@ -242,7 +239,6 @@ public class BluetoothEventManagerTest { * sharing. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_notSupport_noCallToBroadcastProfile() { setUpAudioSharing(/* enableFlag= */ true, /* enableFeature= */ false, /* enableProfile= */ true, /* workProfile= */ false); Loading @@ -259,7 +255,6 @@ public class BluetoothEventManagerTest { * LocalBluetoothLeBroadcast}#handleProfileConnected when triggered for work profile. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_workProfile_noCallToBroadcastProfile() { setUpAudioSharing(/* enableFlag= */ true, /* enableFeature= */ true, /* enableProfile= */ true, /* workProfile= */ true); Loading @@ -277,7 +272,6 @@ public class BluetoothEventManagerTest { * audio sharing is enabled. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_assistConnected_handleStateChanged() { setUpAudioSharing(/* enableFlag= */ true, /* enableFeature= */ true, /* enableProfile= */ true, /* workProfile= */ false); Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import androidx.annotation.VisibleForTesting; import androidx.collection.ArraySet; import com.android.settingslib.R; import com.android.settingslib.flags.Flags; import com.android.settingslib.utils.ThreadUtils; import java.util.Collection; Loading Loading @@ -236,12 +235,13 @@ public class BluetoothEventManager { LocalBluetoothLeBroadcast broadcast = mBtManager == null ? null : mBtManager.getProfileManager().getLeAudioBroadcastProfile(); // Dispatch handleOnProfileStateChanged to local broadcast profile if (Flags.promoteAudioSharingForSecondAutoConnectedLeaDevice() && broadcast != null && state == BluetoothAdapter.STATE_CONNECTED) { if (broadcast != null && state == BluetoothAdapter.STATE_CONNECTED) { Log.d(TAG, "dispatchProfileConnectionStateChanged to local broadcast profile"); var unused = ThreadUtils.postOnBackgroundThread( () -> broadcast.handleProfileConnected(device, bluetoothProfile, mBtManager)); var unused = ThreadUtils.postOnBackgroundThread( () -> broadcast.handleProfileConnected( device, bluetoothProfile, mBtManager)); } } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +0 −4 Original line number Diff line number Diff line Loading @@ -1268,10 +1268,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { @WorkerThread public void handleProfileConnected(@NonNull CachedBluetoothDevice cachedDevice, int bluetoothProfile, @Nullable LocalBluetoothManager btManager) { if (!Flags.promoteAudioSharingForSecondAutoConnectedLeaDevice()) { Log.d(TAG, "Skip handleProfileConnected, flag off"); return; } if (!SYSUI_PKG.equals(mContext.getPackageName())) { Log.d(TAG, "Skip handleProfileConnected, not a valid caller"); return; Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothEventManagerTest.java +0 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.UserHandle; import android.os.UserManager; import android.platform.test.annotations.EnableFlags; import android.platform.test.flag.junit.SetFlagsRule; import android.telephony.TelephonyManager; Loading Loading @@ -208,7 +207,6 @@ public class BluetoothEventManagerTest { * callback. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_registerCallback_shouldDispatchCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); Loading @@ -224,7 +222,6 @@ public class BluetoothEventManagerTest { * LocalBluetoothLeBroadcast}#handleProfileConnected when audio sharing flag is off. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_flagOff_noCallToBroadcastProfile() { setUpAudioSharing(/* enableFlag= */ false, /* enableFeature= */ true, /* enableProfile= */ true, /* workProfile= */ false); Loading @@ -242,7 +239,6 @@ public class BluetoothEventManagerTest { * sharing. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_notSupport_noCallToBroadcastProfile() { setUpAudioSharing(/* enableFlag= */ true, /* enableFeature= */ false, /* enableProfile= */ true, /* workProfile= */ false); Loading @@ -259,7 +255,6 @@ public class BluetoothEventManagerTest { * LocalBluetoothLeBroadcast}#handleProfileConnected when triggered for work profile. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_workProfile_noCallToBroadcastProfile() { setUpAudioSharing(/* enableFlag= */ true, /* enableFeature= */ true, /* enableProfile= */ true, /* workProfile= */ true); Loading @@ -277,7 +272,6 @@ public class BluetoothEventManagerTest { * audio sharing is enabled. */ @Test @EnableFlags(Flags.FLAG_PROMOTE_AUDIO_SHARING_FOR_SECOND_AUTO_CONNECTED_LEA_DEVICE) public void dispatchProfileConnectionStateChanged_assistConnected_handleStateChanged() { setUpAudioSharing(/* enableFlag= */ true, /* enableFeature= */ true, /* enableProfile= */ true, /* workProfile= */ false); Loading