package com.nexlab.openclaw.node.service;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.ImageFormat;
import android.hardware.camera2.*;
import android.media.Image;
import android.media.ImageReader;
import android.media.MediaRecorder;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Base64;
import android.util.Size;
import android.view.Surface;
import androidx.core.content.ContextCompat;
import dagger.hilt.android.qualifiers.ApplicationContext;
import java.io.ByteArrayOutputStream;
import java.io.File;
import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Service for camera operations: photo capture and video recording
 */
@javax.inject.Singleton
@kotlin.Metadata(mv = {1, 9, 0}, k = 1, xi = 48, d1 = {"\u0000\u0086\u0001\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001:\u00011B\u0019\b\u0007\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\u0006J0\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00190\u00182\b\b\u0002\u0010\u001a\u001a\u00020\u00192\b\b\u0002\u0010\u001b\u001a\u00020\u001cH\u0086@\u00f8\u0001\u0000\u00f8\u0001\u0001\u00a2\u0006\u0004\b\u001d\u0010\u001eJ\b\u0010\u001f\u001a\u00020 H\u0002J\b\u0010!\u001a\u00020 H\u0002J\f\u0010\"\u001a\b\u0012\u0004\u0012\u00020$0#J\u0006\u0010%\u001a\u00020\u0014J\b\u0010&\u001a\u00020 H\u0002J2\u0010\'\u001a\u00020\u00142\u0006\u0010(\u001a\u00020)2\b\b\u0002\u0010\u001a\u001a\u00020\u00192\u0018\b\u0002\u0010*\u001a\u0012\u0012\b\u0012\u00060,j\u0002`-\u0012\u0004\u0012\u00020 0+J\b\u0010.\u001a\u00020 H\u0002J\u0006\u0010/\u001a\u00020 J\b\u00100\u001a\u0004\u0018\u00010)R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0011\u001a\u0004\u0018\u00010\u0012X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0014X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0015\u001a\u0004\u0018\u00010\u0016X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u0082\u0002\u000b\n\u0002\b!\n\u0005\b\u00a1\u001e0\u0001\u00a8\u00062"}, d2 = {"Lcom/nexlab/openclaw/node/service/CameraService;", "", "context", "Landroid/content/Context;", "permissionManager", "Lcom/nexlab/openclaw/node/service/PermissionManager;", "(Landroid/content/Context;Lcom/nexlab/openclaw/node/service/PermissionManager;)V", "backgroundHandler", "Landroid/os/Handler;", "backgroundThread", "Landroid/os/HandlerThread;", "cameraDevice", "Landroid/hardware/camera2/CameraDevice;", "cameraManager", "Landroid/hardware/camera2/CameraManager;", "captureSession", "Landroid/hardware/camera2/CameraCaptureSession;", "imageReader", "Landroid/media/ImageReader;", "isRecording", "", "mediaRecorder", "Landroid/media/MediaRecorder;", "capturePhoto", "Lkotlin/Result;", "", "cameraId", "quality", "", "capturePhoto-0E7RQCE", "(Ljava/lang/String;ILkotlin/coroutines/Continuation;)Ljava/lang/Object;", "capturePhotoRequest", "", "createCaptureSession", "getCameras", "", "Lcom/nexlab/openclaw/node/service/CameraService$CameraInfo;", "hasCameraPermission", "startBackgroundThread", "startRecording", "outputFile", "Ljava/io/File;", "onError", "Lkotlin/Function1;", "Ljava/lang/Exception;", "Lkotlin/Exception;", "stopBackgroundThread", "stopCapture", "stopRecording", "CameraInfo", "app_debug"})
public final class CameraService {
    @org.jetbrains.annotations.NotNull
    private final android.content.Context context = null;
    @org.jetbrains.annotations.NotNull
    private final com.nexlab.openclaw.node.service.PermissionManager permissionManager = null;
    @org.jetbrains.annotations.Nullable
    private android.hardware.camera2.CameraDevice cameraDevice;
    @org.jetbrains.annotations.Nullable
    private android.hardware.camera2.CameraCaptureSession captureSession;
    @org.jetbrains.annotations.Nullable
    private android.media.ImageReader imageReader;
    @org.jetbrains.annotations.Nullable
    private android.media.MediaRecorder mediaRecorder;
    @org.jetbrains.annotations.Nullable
    private android.os.Handler backgroundHandler;
    @org.jetbrains.annotations.Nullable
    private android.os.HandlerThread backgroundThread;
    private boolean isRecording = false;
    @org.jetbrains.annotations.NotNull
    private final android.hardware.camera2.CameraManager cameraManager = null;
    
    @javax.inject.Inject
    public CameraService(@dagger.hilt.android.qualifiers.ApplicationContext
    @org.jetbrains.annotations.NotNull
    android.content.Context context, @org.jetbrains.annotations.NotNull
    com.nexlab.openclaw.node.service.PermissionManager permissionManager) {
        super();
    }
    
    /**
     * Check if camera permission is granted
     */
    public final boolean hasCameraPermission() {
        return false;
    }
    
    /**
     * Get list of available cameras
     */
    @org.jetbrains.annotations.NotNull
    public final java.util.List<com.nexlab.openclaw.node.service.CameraService.CameraInfo> getCameras() {
        return null;
    }
    
    private final void createCaptureSession() {
    }
    
    private final void capturePhotoRequest() {
    }
    
    /**
     * Start video recording
     */
    @kotlin.Suppress(names = {"MissingPermission"})
    public final boolean startRecording(@org.jetbrains.annotations.NotNull
    java.io.File outputFile, @org.jetbrains.annotations.NotNull
    java.lang.String cameraId, @org.jetbrains.annotations.NotNull
    kotlin.jvm.functions.Function1<? super java.lang.Exception, kotlin.Unit> onError) {
        return false;
    }
    
    /**
     * Stop video recording
     */
    @org.jetbrains.annotations.Nullable
    public final java.io.File stopRecording() {
        return null;
    }
    
    private final void startBackgroundThread() {
    }
    
    private final void stopBackgroundThread() {
    }
    
    public final void stopCapture() {
    }
    
    @kotlin.Metadata(mv = {1, 9, 0}, k = 1, xi = 48, d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\t\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\b\u0086\b\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0005J\t\u0010\t\u001a\u00020\u0003H\u00c6\u0003J\t\u0010\n\u001a\u00020\u0003H\u00c6\u0003J\u001d\u0010\u000b\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u0003H\u00c6\u0001J\u0013\u0010\f\u001a\u00020\r2\b\u0010\u000e\u001a\u0004\u0018\u00010\u0001H\u00d6\u0003J\t\u0010\u000f\u001a\u00020\u0010H\u00d6\u0001J\t\u0010\u0011\u001a\u00020\u0003H\u00d6\u0001R\u0011\u0010\u0004\u001a\u00020\u0003\u00a2\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u0011\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0007\u00a8\u0006\u0012"}, d2 = {"Lcom/nexlab/openclaw/node/service/CameraService$CameraInfo;", "", "id", "", "facing", "(Ljava/lang/String;Ljava/lang/String;)V", "getFacing", "()Ljava/lang/String;", "getId", "component1", "component2", "copy", "equals", "", "other", "hashCode", "", "toString", "app_debug"})
    public static final class CameraInfo {
        @org.jetbrains.annotations.NotNull
        private final java.lang.String id = null;
        @org.jetbrains.annotations.NotNull
        private final java.lang.String facing = null;
        
        public CameraInfo(@org.jetbrains.annotations.NotNull
        java.lang.String id, @org.jetbrains.annotations.NotNull
        java.lang.String facing) {
            super();
        }
        
        @org.jetbrains.annotations.NotNull
        public final java.lang.String getId() {
            return null;
        }
        
        @org.jetbrains.annotations.NotNull
        public final java.lang.String getFacing() {
            return null;
        }
        
        @org.jetbrains.annotations.NotNull
        public final java.lang.String component1() {
            return null;
        }
        
        @org.jetbrains.annotations.NotNull
        public final java.lang.String component2() {
            return null;
        }
        
        @org.jetbrains.annotations.NotNull
        public final com.nexlab.openclaw.node.service.CameraService.CameraInfo copy(@org.jetbrains.annotations.NotNull
        java.lang.String id, @org.jetbrains.annotations.NotNull
        java.lang.String facing) {
            return null;
        }
        
        @java.lang.Override
        public boolean equals(@org.jetbrains.annotations.Nullable
        java.lang.Object other) {
            return false;
        }
        
        @java.lang.Override
        public int hashCode() {
            return 0;
        }
        
        @java.lang.Override
        @org.jetbrains.annotations.NotNull
        public java.lang.String toString() {
            return null;
        }
    }
}