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

Commit 0d0d236c authored by Caitlin Cassidy's avatar Caitlin Cassidy Committed by Automerger Merge Worker
Browse files

Merge changes I0d063c25,I27d2e4ae,Ieef1681c into tm-qpr-dev am: 91b6e7c0

parents ffdd2191 91b6e7c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,4 +27,4 @@ interface ChipInfoCommon {
    fun getTimeoutMs(): Long
}

const val DEFAULT_TIMEOUT_MILLIS = 4000L
const val DEFAULT_TIMEOUT_MILLIS = 10000L
+10 −20
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.os.PowerManager
import android.os.SystemClock
import android.util.Log
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.ViewGroup
import android.view.WindowManager
import android.view.accessibility.AccessibilityManager
@@ -38,7 +37,6 @@ import com.android.internal.widget.CachingIconView
import com.android.settingslib.Utils
import com.android.systemui.R
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.statusbar.gesture.TapGestureDetector
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.view.ViewUtil
@@ -61,7 +59,6 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
        @Main private val mainExecutor: DelayableExecutor,
        private val accessibilityManager: AccessibilityManager,
        private val configurationController: ConfigurationController,
        private val tapGestureDetector: TapGestureDetector,
        private val powerManager: PowerManager,
        @LayoutRes private val chipLayoutRes: Int,
) {
@@ -111,13 +108,16 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
        } else {
            // The chip is new, so set up all our callbacks and inflate the view
            configurationController.addCallback(displayScaleListener)
            tapGestureDetector.addOnGestureDetectedCallback(TAG, this::onScreenTapped)
            // Wake the screen so the user will see the chip
            // Wake the screen if necessary so the user will see the chip. (Per b/239426653, we want
            // the chip to show over the dream state, so we should only wake up if the screen is
            // completely off.)
            if (!powerManager.isScreenOn) {
                powerManager.wakeUp(
                        SystemClock.uptimeMillis(),
                        PowerManager.WAKE_REASON_APPLICATION,
                        "com.android.systemui:media_tap_to_transfer_activated"
                )
            }

            inflateAndUpdateChip(newChipInfo)
        }
@@ -172,7 +172,6 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
        if (chipView == null) { return }
        logger.logChipRemoval(removalReason)
        configurationController.removeCallback(displayScaleListener)
        tapGestureDetector.removeOnGestureDetectedCallback(TAG)
        windowManager.removeView(chipView)
        chipView = null
        chipInfo = null
@@ -257,15 +256,6 @@ abstract class MediaTttChipControllerCommon<T : ChipInfoCommon>(
            isAppIcon = false
        )
    }

    private fun onScreenTapped(e: MotionEvent) {
        val view = chipView ?: return
        // If the tap is within the chip bounds, we shouldn't hide the chip (in case users think the
        // chip is tappable).
        if (!viewUtil.touchIsWithinView(view, e.x, e.y)) {
            removeChip(MediaTttRemovalReason.REASON_SCREEN_TAP)
        }
    }
}

// Used in CTS tests UpdateMediaTapToTransferSenderDisplayTest and
+0 −3
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import com.android.systemui.media.taptotransfer.common.DEFAULT_TIMEOUT_MILLIS
import com.android.systemui.media.taptotransfer.common.MediaTttChipControllerCommon
import com.android.systemui.media.taptotransfer.common.MediaTttLogger
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.gesture.TapGestureDetector
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.animation.AnimationUtil.Companion.frames
import com.android.systemui.util.concurrency.DelayableExecutor
@@ -63,7 +62,6 @@ class MediaTttChipControllerReceiver @Inject constructor(
        mainExecutor: DelayableExecutor,
        accessibilityManager: AccessibilityManager,
        configurationController: ConfigurationController,
        tapGestureDetector: TapGestureDetector,
        powerManager: PowerManager,
        @Main private val mainHandler: Handler,
        private val uiEventLogger: MediaTttReceiverUiEventLogger,
@@ -75,7 +73,6 @@ class MediaTttChipControllerReceiver @Inject constructor(
        mainExecutor,
        accessibilityManager,
        configurationController,
        tapGestureDetector,
        powerManager,
        R.layout.media_ttt_chip_receiver,
) {
+1 −1
Original line number Diff line number Diff line
@@ -243,6 +243,6 @@ enum class ChipStateSender(
// Give the Transfer*Triggered states a longer timeout since those states represent an active
// process and we should keep the user informed about it as long as possible (but don't allow it to
// continue indefinitely).
private const val TRANSFER_TRIGGERED_TIMEOUT_MILLIS = 15000L
private const val TRANSFER_TRIGGERED_TIMEOUT_MILLIS = 30000L

private const val TAG = "ChipStateSender"
+0 −3
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import com.android.systemui.media.taptotransfer.common.MediaTttChipControllerCom
import com.android.systemui.media.taptotransfer.common.MediaTttLogger
import com.android.systemui.media.taptotransfer.common.MediaTttRemovalReason
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.gesture.TapGestureDetector
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.view.ViewUtil
@@ -58,7 +57,6 @@ class MediaTttChipControllerSender @Inject constructor(
        @Main mainExecutor: DelayableExecutor,
        accessibilityManager: AccessibilityManager,
        configurationController: ConfigurationController,
        tapGestureDetector: TapGestureDetector,
        powerManager: PowerManager,
        private val uiEventLogger: MediaTttSenderUiEventLogger
) : MediaTttChipControllerCommon<ChipSenderInfo>(
@@ -69,7 +67,6 @@ class MediaTttChipControllerSender @Inject constructor(
        mainExecutor,
        accessibilityManager,
        configurationController,
        tapGestureDetector,
        powerManager,
        R.layout.media_ttt_chip,
) {
Loading