From 0b0c9dc84488b757ef04c77a448ab733f5e83027 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Tue, 15 Jun 2021 16:14:46 -0700 Subject: [PATCH] Camera: Pass an executor during the extension characteristics service bind call Camera extensions characteristics will bind to the camera extensions proxy service without passing a dedicated executor for the connection callbacks. In this case, the callbacks will be called in the main thread which can be problematic for clients using the same thread. Bug: 191192317 Test: Camera CTS Change-Id: Ic952edd766d26016b6203c84d067a6b1061ed090 --- .../hardware/camera2/CameraExtensionCharacteristics.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java b/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java index 41272437c4077..cb0179de6118c 100644 --- a/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java @@ -255,9 +255,9 @@ public final class CameraExtensionCharacteristics { } } }; - ctx.bindService(intent, mConnection, Context.BIND_AUTO_CREATE | - Context.BIND_IMPORTANT | Context.BIND_ABOVE_CLIENT | - Context.BIND_NOT_VISIBLE); + ctx.bindService(intent, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT | + Context.BIND_ABOVE_CLIENT | Context.BIND_NOT_VISIBLE, + android.os.AsyncTask.THREAD_POOL_EXECUTOR, mConnection); try { mInitFuture.get(PROXY_SERVICE_DELAY_MS, TimeUnit.MILLISECONDS);