Skip to content

Commit

Permalink
Un-lambda Callable in TextLayoutBuilder so we can still compile with …
Browse files Browse the repository at this point in the history
…Java 7

Summary: TSIA

Reviewed By: fabiocarballo

Differential Revision: D44405144

fbshipit-source-id: 09de7e63de9f829a601cf8b163a84775acfaeaeb
  • Loading branch information
mkarpio authored and facebook-github-bot committed Mar 27, 2023
1 parent 7062a7f commit ae80c1a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import androidx.core.text.TextDirectionHeuristicsCompat;
import java.lang.annotation.Retention;
import java.util.Arrays;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -1094,7 +1095,13 @@ public Layout build() {
if (mEnableIsBoringLayoutCheckTimeout) {
final ExecutorService executorService = Executors.newSingleThreadExecutor();
final Future<BoringLayout.Metrics> isBoringFuture =
executorService.submit(() -> isBoringLayout());
executorService.submit(
new Callable<BoringLayout.Metrics>() {
@Override
public @Nullable BoringLayout.Metrics call() throws Exception {
return isBoringLayout();
}
});
try {
metrics = isBoringFuture.get(IS_BORING_CALL_TIMEOUT, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
Expand Down

0 comments on commit ae80c1a

Please sign in to comment.