Merge "Custom Lockscreen shortcuts' long-press should call to FalsingManager" into tm-qpr-dev am: e58ae09446
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21615642 Change-Id: If33a8c2c53e0663ae32a38eb4c5962571d656a12 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -342,7 +342,13 @@ object KeyguardBottomAreaViewBinder {
|
|||||||
if (viewModel.isClickable) {
|
if (viewModel.isClickable) {
|
||||||
if (viewModel.useLongPress) {
|
if (viewModel.useLongPress) {
|
||||||
view.setOnTouchListener(
|
view.setOnTouchListener(
|
||||||
OnTouchListener(view, viewModel, messageDisplayer, vibratorHelper)
|
OnTouchListener(
|
||||||
|
view,
|
||||||
|
viewModel,
|
||||||
|
messageDisplayer,
|
||||||
|
vibratorHelper,
|
||||||
|
falsingManager,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
view.setOnClickListener(OnClickListener(viewModel, checkNotNull(falsingManager)))
|
view.setOnClickListener(OnClickListener(viewModel, checkNotNull(falsingManager)))
|
||||||
@@ -371,6 +377,7 @@ object KeyguardBottomAreaViewBinder {
|
|||||||
private val viewModel: KeyguardQuickAffordanceViewModel,
|
private val viewModel: KeyguardQuickAffordanceViewModel,
|
||||||
private val messageDisplayer: (Int) -> Unit,
|
private val messageDisplayer: (Int) -> Unit,
|
||||||
private val vibratorHelper: VibratorHelper?,
|
private val vibratorHelper: VibratorHelper?,
|
||||||
|
private val falsingManager: FalsingManager?,
|
||||||
) : View.OnTouchListener {
|
) : View.OnTouchListener {
|
||||||
|
|
||||||
private val longPressDurationMs = ViewConfiguration.getLongPressTimeout().toLong()
|
private val longPressDurationMs = ViewConfiguration.getLongPressTimeout().toLong()
|
||||||
@@ -395,7 +402,14 @@ object KeyguardBottomAreaViewBinder {
|
|||||||
.scaleY(PRESSED_SCALE)
|
.scaleY(PRESSED_SCALE)
|
||||||
.setDuration(longPressDurationMs)
|
.setDuration(longPressDurationMs)
|
||||||
.withEndAction {
|
.withEndAction {
|
||||||
dispatchClick(viewModel.configKey)
|
if (
|
||||||
|
falsingManager
|
||||||
|
?.isFalseLongTap(
|
||||||
|
FalsingManager.MODERATE_PENALTY
|
||||||
|
) == false
|
||||||
|
) {
|
||||||
|
dispatchClick(viewModel.configKey)
|
||||||
|
}
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -421,7 +435,8 @@ object KeyguardBottomAreaViewBinder {
|
|||||||
// the pointer performs a click.
|
// the pointer performs a click.
|
||||||
if (
|
if (
|
||||||
viewModel.configKey != null &&
|
viewModel.configKey != null &&
|
||||||
distanceMoved(event) <= ViewConfiguration.getTouchSlop()
|
distanceMoved(event) <= ViewConfiguration.getTouchSlop() &&
|
||||||
|
falsingManager?.isFalseTap(FalsingManager.NO_PENALTY) == false
|
||||||
) {
|
) {
|
||||||
dispatchClick(viewModel.configKey)
|
dispatchClick(viewModel.configKey)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user