diff --git a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java index fdf2a54f..97375daa 100644 --- a/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java +++ b/stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewHighlightOverlays.java @@ -140,7 +140,11 @@ public void draw(Canvas canvas) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { canvas.clipRect(newRect, Region.Op.REPLACE); } else { - canvas.clipOutRect(newRect); + // https://github.com/facebook/stetho/issues/648 + // Android P deprecated calls to clipRect with Ops other than INTERSECT and DIFFERENCE + canvas.save(); + canvas.clipRect(newRect); + canvas.restore(); } super.draw(canvas); }