Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39513a31 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Set device executor thread name

Set a specific thread name for the executor service
instead of using the default generated thread pool
name

Flag: com.android.internal.camera.flags.single_thread_executor
Bug: 359709863
Test: Manual using camera application
Change-Id: Ib212440997b1e9410c043382636a66515128d51f
parent 08deb491
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicBoolean;

/**
@@ -354,7 +355,14 @@ public class CameraDeviceImpl extends CameraDevice
        mCameraId = cameraId;
        if (Flags.singleThreadExecutor()) {
            mDeviceCallback = new ClientStateCallback(executor, callback);
            mDeviceExecutor = Executors.newSingleThreadExecutor();
            mDeviceExecutor = Executors.newSingleThreadExecutor(new ThreadFactory() {
                @Override
                public Thread newThread(Runnable r) {
                    Thread thread = Executors.defaultThreadFactory().newThread(r);
                    thread.setName("CameraDeviceExecutor");
                    return thread;
                }
            });
        } else {
            mDeviceCallback = callback;
            mDeviceExecutor = executor;