Skip to content

Commit 0eebd3b

Browse files
committed
Merge branch 'feat/pixel-copy-api-for-screenshots' of github.com:getsentry/sentry-java into feat/pixel-copy-api-for-screenshots
2 parents d1599d4 + 1711e35 commit 0eebd3b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/internal/util/ScreenshotUtils.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import android.view.PixelCopy;
1111
import android.view.View;
1212
import android.view.Window;
13-
1413
import androidx.annotation.Nullable;
1514
import io.sentry.ILogger;
1615
import io.sentry.SentryLevel;
@@ -20,7 +19,6 @@
2019
import java.util.concurrent.CountDownLatch;
2120
import java.util.concurrent.TimeUnit;
2221
import java.util.concurrent.atomic.AtomicBoolean;
23-
2422
import org.jetbrains.annotations.ApiStatus;
2523
import org.jetbrains.annotations.NotNull;
2624

@@ -77,14 +75,16 @@ public class ScreenshotUtils {
7775
final AtomicBoolean copyResultSuccess = new AtomicBoolean(false);
7876

7977
PixelCopy.request(
80-
window,
81-
bitmap, copyResult -> {
82-
copyResultSuccess.set(copyResult == PixelCopy.SUCCESS);
83-
latch.countDown();
84-
},
85-
handler);
86-
87-
success = latch.await(CAPTURE_TIMEOUT_MS, TimeUnit.MILLISECONDS) && copyResultSuccess.get();
78+
window,
79+
bitmap,
80+
copyResult -> {
81+
copyResultSuccess.set(copyResult == PixelCopy.SUCCESS);
82+
latch.countDown();
83+
},
84+
handler);
85+
86+
success =
87+
latch.await(CAPTURE_TIMEOUT_MS, TimeUnit.MILLISECONDS) && copyResultSuccess.get();
8888
} catch (InterruptedException e) {
8989
// ignored
9090
} finally {

0 commit comments

Comments
 (0)