Merge "Fix a bug that ripple might get readded to WM and cause crash." into sc-dev
This commit is contained in:
@@ -103,7 +103,10 @@ class WiredChargingRippleController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun startRipple() {
|
fun startRipple() {
|
||||||
if (rippleView.rippleInProgress) {
|
if (rippleView.rippleInProgress || rippleView.parent != null) {
|
||||||
|
// Skip if ripple is still playing, or not playing but already added the parent
|
||||||
|
// (which might happen just before the animation starts or right after
|
||||||
|
// the animation ends.)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val mWM = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
val mWM = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||||
|
|||||||
Reference in New Issue
Block a user