a.smali

.class public Lcom/plug/services/a;
.super Ljava/lang/Object;
.source "BaseProPluginClient.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/plug/services/a$a;
    }
.end annotation


# instance fields
.field private a:Landroid/content/ServiceConnection;

.field private b:Ljava/lang/Object;

.field private c:Lcom/plug/services/IPluginService;

.field private d:Ljava/lang/Class;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/Class",
            "<*>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Ljava/lang/Class;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Class",
            "<*>;)V"
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

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

    .line 15
    iput-object v1, p0, Lcom/plug/services/a;->a:Landroid/content/ServiceConnection;

    .line 16
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, Lcom/plug/services/a;->b:Ljava/lang/Object;

    .line 17
    iput-object v1, p0, Lcom/plug/services/a;->c:Lcom/plug/services/IPluginService;

    .line 18
    iput-object v1, p0, Lcom/plug/services/a;->d:Ljava/lang/Class;

    .line 26
    iput-object p1, p0, Lcom/plug/services/a;->d:Ljava/lang/Class;

    .line 27
    return-void
.end method


# virtual methods
.method public a(I)Lcom/plug/services/IProPluginInfo;
    .registers 4

    .prologue
    .line 52
    iget-object v1, p0, Lcom/plug/services/a;->b:Ljava/lang/Object;

    monitor-enter v1

    .line 53
    :try_start_3
    invoke-virtual {p0}, Lcom/plug/services/a;->a()Z
    :try_end_6
    .catchall {:try_start_3 .. :try_end_6} :catchall_18

    move-result v0

    if-eqz v0, :cond_15

    .line 55
    :try_start_9
    iget-object v0, p0, Lcom/plug/services/a;->c:Lcom/plug/services/IPluginService;

    invoke-interface {v0, p1}, Lcom/plug/services/IPluginService;->a(I)Lcom/plug/services/IProPluginInfo;
    :try_end_e
    .catch Landroid/os/RemoteException; {:try_start_9 .. :try_end_e} :catch_11
    .catchall {:try_start_9 .. :try_end_e} :catchall_18

    move-result-object v0

    :try_start_f
    monitor-exit v1

    .line 60
    :goto_10
    return-object v0

    .line 56
    :catch_11
    move-exception v0

    .line 57
    invoke-virtual {v0}, Landroid/os/RemoteException;->printStackTrace()V

    .line 60
    :cond_15
    const/4 v0, 0x0

    monitor-exit v1

    goto :goto_10

    .line 61
    :catchall_18
    move-exception v0

    monitor-exit v1
    :try_end_1a
    .catchall {:try_start_f .. :try_end_1a} :catchall_18

    throw v0
.end method

.method public a(Landroid/content/Context;Lcom/plug/services/a$a;)V
    .registers 6

    .prologue
    .line 30
    invoke-virtual {p0}, Lcom/plug/services/a;->a()Z

    move-result v0

    if-eqz v0, :cond_a

    .line 31
    invoke-virtual {p2}, Lcom/plug/services/a$a;->a()V

    .line 49
    :goto_9
    return-void

    .line 34
    :cond_a
    new-instance v0, Lcom/plug/services/b;

    invoke-direct {v0, p0, p2}, Lcom/plug/services/b;-><init>(Lcom/plug/services/a;Lcom/plug/services/a$a;)V

    iput-object v0, p0, Lcom/plug/services/a;->a:Landroid/content/ServiceConnection;

    .line 47
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/plug/services/a;->d:Ljava/lang/Class;

    invoke-direct {v0, p1, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 48
    iget-object v1, p0, Lcom/plug/services/a;->a:Landroid/content/ServiceConnection;

    const/4 v2, 0x1

    invoke-virtual {p1, v0, v1, v2}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

    goto :goto_9
.end method

.method protected a(Lcom/plug/services/IPluginService;)V
    .registers 4

    .prologue
    .line 71
    iget-object v1, p0, Lcom/plug/services/a;->b:Ljava/lang/Object;

    monitor-enter v1

    .line 72
    :try_start_3
    iput-object p1, p0, Lcom/plug/services/a;->c:Lcom/plug/services/IPluginService;

    .line 73
    monitor-exit v1

    .line 74
    return-void

    .line 73
    :catchall_7
    move-exception v0

    monitor-exit v1
    :try_end_9
    .catchall {:try_start_3 .. :try_end_9} :catchall_7

    throw v0
.end method

.method protected a()Z
    .registers 3

    .prologue
    .line 65
    iget-object v1, p0, Lcom/plug/services/a;->b:Ljava/lang/Object;

    monitor-enter v1

    .line 66
    :try_start_3
    iget-object v0, p0, Lcom/plug/services/a;->c:Lcom/plug/services/IPluginService;

    if-eqz v0, :cond_a

    const/4 v0, 0x1

    :goto_8
    monitor-exit v1

    return v0

    :cond_a
    const/4 v0, 0x0

    goto :goto_8

    .line 67
    :catchall_c
    move-exception v0

    monitor-exit v1
    :try_end_e
    .catchall {:try_start_3 .. :try_end_e} :catchall_c

    throw v0
.end method