package com.nexlab.openclaw.node.service;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.media.ImageReader;
import android.media.projection.MediaProjection;
import android.media.projection.MediaProjectionManager;
import android.os.Handler;
import android.os.Looper;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import java.io.ByteArrayOutputStream;

/**
 * Service for capturing screenshots using MediaProjection API
 */
@kotlin.Metadata(mv = {1, 9, 0}, k = 1, xi = 48, d1 = {"\u0000`\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0010\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\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u0000 (2\u00020\u0001:\u0001(B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004J*\u0010\u0016\u001a\u00020\t2\b\b\u0002\u0010\u0017\u001a\u00020\u00182\u0018\u0010\u0019\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\b0\u0007\u0012\u0004\u0012\u00020\t0\u0006J\b\u0010\u001a\u001a\u00020\tH\u0002J\u000e\u0010\u001b\u001a\u00020\t2\u0006\u0010\u001c\u001a\u00020\u0011J&\u0010\u001d\u001a\u00020\t2\u0006\u0010\u001e\u001a\u00020\u00182\b\u0010\u001f\u001a\u0004\u0018\u00010 2\f\u0010!\u001a\b\u0012\u0004\u0012\u00020\t0\"J\b\u0010#\u001a\u00020\tH\u0003J$\u0010$\u001a\u00020\t2\b\b\u0002\u0010%\u001a\u00020\u00182\u0012\u0010&\u001a\u000e\u0012\u0004\u0012\u00020\b\u0012\u0004\u0012\u00020\t0\u0006J\u0006\u0010\'\u001a\u00020\tR\"\u0010\u0005\u001a\u0016\u0012\n\u0012\b\u0012\u0004\u0012\u00020\b0\u0007\u0012\u0004\u0012\u00020\t\u0018\u00010\u0006X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\n\u001a\u0004\u0018\u00010\u000bX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\rX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0012\u001a\u0004\u0018\u00010\u0013X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006)"}, d2 = {"Lcom/nexlab/openclaw/node/service/ScreenshotService;", "", "context", "Landroid/content/Context;", "(Landroid/content/Context;)V", "callback", "Lkotlin/Function1;", "Lkotlin/Result;", "", "", "imageReader", "Landroid/media/ImageReader;", "isCapturing", "", "mainHandler", "Landroid/os/Handler;", "mediaProjection", "Landroid/media/projection/MediaProjection;", "virtualDisplay", "Landroid/hardware/display/VirtualDisplay;", "windowManager", "Landroid/view/WindowManager;", "captureScreenshot", "quality", "", "onResult", "cleanup", "initialize", "projection", "onActivityResult", "resultCode", "data", "Landroid/content/Intent;", "onReady", "Lkotlin/Function0;", "setupVirtualDisplay", "startStream", "fps", "onFrame", "stop", "Companion", "app_debug"})
public final class ScreenshotService {
    @org.jetbrains.annotations.NotNull
    private final android.content.Context context = null;
    @org.jetbrains.annotations.Nullable
    private android.media.projection.MediaProjection mediaProjection;
    @org.jetbrains.annotations.Nullable
    private android.hardware.display.VirtualDisplay virtualDisplay;
    @org.jetbrains.annotations.Nullable
    private android.media.ImageReader imageReader;
    private boolean isCapturing = false;
    @org.jetbrains.annotations.NotNull
    private final android.view.WindowManager windowManager = null;
    @org.jetbrains.annotations.NotNull
    private final android.os.Handler mainHandler = null;
    @org.jetbrains.annotations.Nullable
    private kotlin.jvm.functions.Function1<? super kotlin.Result<java.lang.String>, kotlin.Unit> callback;
    public static final int REQUEST_CODE = 1001;
    @org.jetbrains.annotations.NotNull
    public static final com.nexlab.openclaw.node.service.ScreenshotService.Companion Companion = null;
    
    public ScreenshotService(@org.jetbrains.annotations.NotNull
    android.content.Context context) {
        super();
    }
    
    /**
     * Initialize the screenshot service with a media projection
     */
    public final void initialize(@org.jetbrains.annotations.NotNull
    android.media.projection.MediaProjection projection) {
    }
    
    /**
     * Handle the activity result from requesting screen capture permission
     */
    public final void onActivityResult(int resultCode, @org.jetbrains.annotations.Nullable
    android.content.Intent data, @org.jetbrains.annotations.NotNull
    kotlin.jvm.functions.Function0<kotlin.Unit> onReady) {
    }
    
    @android.annotation.SuppressLint(value = {"WrongConstant"})
    private final void setupVirtualDisplay() {
    }
    
    /**
     * Capture a single screenshot
     */
    public final void captureScreenshot(int quality, @org.jetbrains.annotations.NotNull
    kotlin.jvm.functions.Function1<? super kotlin.Result<java.lang.String>, kotlin.Unit> onResult) {
    }
    
    /**
     * Start continuous screenshot streaming
     */
    public final void startStream(int fps, @org.jetbrains.annotations.NotNull
    kotlin.jvm.functions.Function1<? super java.lang.String, kotlin.Unit> onFrame) {
    }
    
    /**
     * Stop screenshot capture
     */
    public final void stop() {
    }
    
    private final void cleanup() {
    }
    
    @kotlin.Metadata(mv = {1, 9, 0}, k = 1, xi = 48, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002\u00a2\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0005"}, d2 = {"Lcom/nexlab/openclaw/node/service/ScreenshotService$Companion;", "", "()V", "REQUEST_CODE", "", "app_debug"})
    public static final class Companion {
        
        private Companion() {
            super();
        }
    }
}