Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63b2fd9f authored by Luna Zhang's avatar Luna Zhang Committed by Android (Google) Code Review
Browse files

Merge "Rename BluetoothTileDialogViewModel to BluetoothDetailsContentViewModel" into main

parents 957ded41 410afb39
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -315,11 +315,11 @@ filegroup {
        "tests/src/**/systemui/temporarydisplay/TemporaryViewDisplayControllerTest.kt",
        "tests/src/**/systemui/statusbar/policy/WalletControllerImplTest.kt",
        "tests/src/**/keyguard/ClockEventControllerTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothStateInteractorTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothDetailsContentManagerTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothDetailsContentViewModelTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothStateInteractorTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothTileDialogDelegateTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothTileDialogRepositoryTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/BluetoothTileDialogViewModelTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/DeviceItemFactoryTest.kt",
        "tests/src/**/systemui/bluetooth/qsdialog/DeviceItemInteractorTest.kt",
        "tests/src/**/systemui/broadcast/UserBroadcastDispatcherTest.kt",
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.compose.ui.viewinterop.AndroidView
import com.android.systemui.res.R

@Composable
fun BluetoothDetailsContent(detailsContentViewModel: BluetoothTileDialogViewModel) {
fun BluetoothDetailsContent(detailsContentViewModel: BluetoothDetailsContentViewModel) {
    AndroidView(
        modifier = Modifier.fillMaxSize(),
        factory = { context ->
+3 −3
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ data class DeviceItemClick(val deviceItem: DeviceItem, val clickedView: View, va
class BluetoothDetailsContentManager
@AssistedInject
constructor(
    @Assisted private val initialUiProperties: BluetoothTileDialogViewModel.UiProperties,
    @Assisted private val initialUiProperties: BluetoothDetailsContentViewModel.UiProperties,
    @Assisted private val cachedContentHeight: Int,
    @Assisted private val bluetoothTileDialogCallback: BluetoothTileDialogCallback,
    @Assisted private val isInDialog: Boolean,
@@ -114,7 +114,7 @@ constructor(
    @AssistedFactory
    interface Factory {
        fun create(
            initialUiProperties: BluetoothTileDialogViewModel.UiProperties,
            initialUiProperties: BluetoothDetailsContentViewModel.UiProperties,
            cachedContentHeight: Int,
            dialogCallback: BluetoothTileDialogCallback,
            isInDialog: Boolean,
@@ -226,7 +226,7 @@ constructor(

    internal fun onBluetoothStateUpdated(
        isEnabled: Boolean,
        uiProperties: BluetoothTileDialogViewModel.UiProperties,
        uiProperties: BluetoothDetailsContentViewModel.UiProperties,
    ) {
        bluetoothToggle.apply {
            isChecked = isEnabled
+3 −6
Original line number Diff line number Diff line
@@ -61,12 +61,9 @@ import kotlinx.coroutines.withContext

/**
 * ViewModel for Bluetooth Dialog or Bluetooth Details View after clicking on the Bluetooth QS tile.
 *
 * TODO: b/378513956 Rename this class to BluetoothDetailsContentViewModel, since it's not only used
 *   by the dialog view.
 */
@SysUISingleton
class BluetoothTileDialogViewModel
class BluetoothDetailsContentViewModel
@Inject
constructor(
    private val deviceItemInteractor: DeviceItemInteractor,
@@ -312,7 +309,7 @@ constructor(
        return bluetoothDialogDelegateFactory.create(
            getUiProperties(),
            getCachedContentHeight(),
            this@BluetoothTileDialogViewModel,
            this@BluetoothDetailsContentViewModel,
            { cancelJob() },
        )
    }
@@ -321,7 +318,7 @@ constructor(
        return bluetoothDetailsContentManagerFactory.create(
            getUiProperties(),
            getCachedContentHeight(),
            this@BluetoothTileDialogViewModel,
            this@BluetoothDetailsContentViewModel,
            /* isInDialog= */ false,
            /* doneButtonCallback= */ fun() {},
        )
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import com.android.systemui.plugins.qs.TileDetailsViewModel

class BluetoothDetailsViewModel(
    private val onSettingsClick: () -> Unit,
    val detailsContentViewModel: BluetoothTileDialogViewModel,
    val detailsContentViewModel: BluetoothDetailsContentViewModel,
) : TileDetailsViewModel() {
    override fun clickOnSettingsButton() {
        onSettingsClick()
Loading