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

Commit 5c846684 authored by ESWAR MAGATAPALLI (xWF)'s avatar ESWAR MAGATAPALLI (xWF) Committed by Android (Google) Code Review
Browse files

Revert "Add lock screen content description in coroutine"

This reverts commit 9a17ac85.

Reason for revert: Droidmonitor created revert due to b/414696157. Will be verifying through ABTD before submission.

Change-Id: I210a96452d4a7986a8f74cb13af402f102f28316
parent 9a17ac85
Loading
Loading
Loading
Loading
+35 −52
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.view.accessibility.AccessibilityNodeInfo
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.systemui.common.ui.view.TouchHandlingView
import com.android.systemui.keyguard.ui.viewmodel.KeyguardTouchHandlingViewModel
import com.android.systemui.lifecycle.WindowLifecycleState
@@ -32,7 +31,6 @@ import com.android.systemui.lifecycle.viewModel
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.res.R
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.flow.MutableStateFlow

object KeyguardTouchViewBinder {
    /**
@@ -58,21 +56,7 @@ object KeyguardTouchViewBinder {
            )

        view.repeatWhenAttached {
            val isLongPressHandlingEnabled = MutableStateFlow(false)

            repeatOnLifecycle(Lifecycle.State.STARTED) {
                launch("$TAG#viewModel.isLongPressHandlingEnabled") {
                    isLongPressHandlingEnabled.collect { isEnabled ->
                        view.contentDescription =
                            if (isEnabled) {
                                view.resources.getString(R.string.accessibility_desc_lock_screen)
                            } else {
                                null
                            }
                    }
                }
            }

                view.viewModel(
                    traceName = "KeyguardTouchViewBinderViewModel",
                    minWindowLifecycleState = WindowLifecycleState.ATTACHED,
@@ -81,8 +65,6 @@ object KeyguardTouchViewBinder {
                    view.setSnapshotBinding {
                        view.setLongPressHandlingEnabled(viewModel.isLongPressHandlingEnabled)
                        view.setDoublePressHandlingEnabled(viewModel.isDoubleTapHandlingEnabled)

                    isLongPressHandlingEnabled.value = viewModel.isLongPressHandlingEnabled
                    }

                    view.listener =
@@ -123,6 +105,7 @@ object KeyguardTouchViewBinder {
                }
            }
        }
    }

    private const val TAG = "KeyguardTouchViewBinder"
}