.class public Lcom/moji/camera/PhotoManager;
.super Ljava/lang/Object;
.source "PhotoManager.java"


# static fields
.field private static volatile a:Lcom/moji/camera/PhotoManager;


# instance fields
.field private b:Lcom/moji/camera/model/GalleryOptions;

.field private c:Lcom/moji/camera/model/CropOptions;


# direct methods
.method private constructor <init>()V
    .locals 0

    .line 20
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static a()Lcom/moji/camera/PhotoManager;
    .locals 2

    .line 23
    sget-object v0, Lcom/moji/camera/PhotoManager;->a:Lcom/moji/camera/PhotoManager;

    if-nez v0, :cond_1

    .line 24
    const-class v0, Lcom/moji/camera/PhotoManager;

    monitor-enter v0

    .line 25
    :try_start_0
    sget-object v1, Lcom/moji/camera/PhotoManager;->a:Lcom/moji/camera/PhotoManager;

    if-nez v1, :cond_0

    .line 26
    new-instance v1, Lcom/moji/camera/PhotoManager;

    invoke-direct {v1}, Lcom/moji/camera/PhotoManager;-><init>()V

    sput-object v1, Lcom/moji/camera/PhotoManager;->a:Lcom/moji/camera/PhotoManager;

    .line 28
    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    .line 30
    :cond_1
    :goto_0
    sget-object v0, Lcom/moji/camera/PhotoManager;->a:Lcom/moji/camera/PhotoManager;

    return-object v0
.end method


# virtual methods
.method public a(Landroid/app/Activity;Lcom/moji/camera/permission/PermissionManager;)Lcom/moji/camera/PhotoCamera;
    .locals 3

    .line 39
    iget-object v0, p0, Lcom/moji/camera/PhotoManager;->b:Lcom/moji/camera/model/GalleryOptions;

    if-nez v0, :cond_0

    .line 40
    new-instance v0, Lcom/moji/camera/model/GalleryOptions$Builder;

    invoke-direct {v0}, Lcom/moji/camera/model/GalleryOptions$Builder;-><init>()V

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/moji/camera/model/GalleryOptions$Builder;->a(Z)Lcom/moji/camera/model/GalleryOptions$Builder;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/moji/camera/model/GalleryOptions$Builder;->b(Z)Lcom/moji/camera/model/GalleryOptions$Builder;

    move-result-object v0

    invoke-virtual {v0}, Lcom/moji/camera/model/GalleryOptions$Builder;->a()Lcom/moji/camera/model/GalleryOptions;

    move-result-object v0

    iput-object v0, p0, Lcom/moji/camera/PhotoManager;->b:Lcom/moji/camera/model/GalleryOptions;

    .line 42
    :cond_0
    iget-object v0, p0, Lcom/moji/camera/PhotoManager;->c:Lcom/moji/camera/model/CropOptions;

    if-nez v0, :cond_1

    .line 43
    new-instance v0, Lcom/moji/camera/model/CropOptions$Builder;

    invoke-direct {v0}, Lcom/moji/camera/model/CropOptions$Builder;-><init>()V

    invoke-virtual {v0}, Lcom/moji/camera/model/CropOptions$Builder;->a()Lcom/moji/camera/model/CropOptions;

    move-result-object v0

    iput-object v0, p0, Lcom/moji/camera/PhotoManager;->c:Lcom/moji/camera/model/CropOptions;

    .line 45
    :cond_1
    new-instance v0, Lcom/moji/camera/permission/PhotoPermissionInvocationHandler;

    invoke-direct {v0, p1, p2}, Lcom/moji/camera/permission/PhotoPermissionInvocationHandler;-><init>(Landroid/app/Activity;Lcom/moji/camera/permission/PermissionManager;)V

    new-instance p2, Lcom/moji/camera/PhotoCameraImpl;

    iget-object v1, p0, Lcom/moji/camera/PhotoManager;->b:Lcom/moji/camera/model/GalleryOptions;

    iget-object v2, p0, Lcom/moji/camera/PhotoManager;->c:Lcom/moji/camera/model/CropOptions;

    invoke-direct {p2, p1, v1, v2}, Lcom/moji/camera/PhotoCameraImpl;-><init>(Landroid/app/Activity;Lcom/moji/camera/model/GalleryOptions;Lcom/moji/camera/model/CropOptions;)V

    invoke-virtual {v0, p2}, Lcom/moji/camera/permission/PhotoPermissionInvocationHandler;->a(Lcom/moji/camera/PhotoCamera;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/camera/PhotoCamera;

    return-object p1
.end method

.method public a(Lcom/moji/camera/model/GalleryOptions;Lcom/moji/camera/model/CropOptions;)V
    .locals 0
    .param p1    # Lcom/moji/camera/model/GalleryOptions;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param
    .param p2    # Lcom/moji/camera/model/CropOptions;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

    .line 34
    iput-object p1, p0, Lcom/moji/camera/PhotoManager;->b:Lcom/moji/camera/model/GalleryOptions;

    .line 35
    iput-object p2, p0, Lcom/moji/camera/PhotoManager;->c:Lcom/moji/camera/model/CropOptions;

    return-void
.end method
