HeadSetObserver$init$1.smali

.class public final Lcom/singbox/util/headset/HeadSetObserver$init$1;
.super Landroid/content/BroadcastReceiver;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/singbox/util/headset/a;->a(Landroid/content/Context;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = null
.end annotation


# direct methods
.method constructor <init>()V
    .registers 1

    .line 26
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public final onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .registers 6

    if-eqz p1, :cond_6c

    if-eqz p2, :cond_6c

    .line 29
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_6c

    const-string v1, "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED"

    .line 30
    invoke-static {v1, v0}, Lkotlin/f/b/o;->a(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v1

    const/4 v2, 0x0

    if-eqz v1, :cond_3c

    const-string v0, "android.bluetooth.profile.extra.STATE"

    .line 31
    invoke-virtual {p2, v0, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result p2

    const/4 v0, 0x2

    if-ne p2, v0, :cond_28

    .line 33
    sget-object p1, Lcom/singbox/util/headset/a;->a:Lcom/singbox/util/headset/a;

    invoke-static {}, Lcom/singbox/util/headset/a;->b()Landroidx/lifecycle/MutableLiveData;

    move-result-object p1

    sget-object p2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    invoke-virtual {p1, p2}, Landroidx/lifecycle/MutableLiveData;->setValue(Ljava/lang/Object;)V

    return-void

    :cond_28
    if-nez p2, :cond_3b

    .line 35
    sget-object p2, Lcom/singbox/util/headset/a;->a:Lcom/singbox/util/headset/a;

    invoke-static {}, Lcom/singbox/util/headset/a;->b()Landroidx/lifecycle/MutableLiveData;

    move-result-object p2

    invoke-static {p1}, Lcom/singbox/util/headset/b;->b(Landroid/content/Context;)Z

    move-result p1

    invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object p1

    invoke-virtual {p2, p1}, Landroidx/lifecycle/MutableLiveData;->setValue(Ljava/lang/Object;)V

    :cond_3b
    return-void

    :cond_3c
    const-string v1, "android.intent.action.HEADSET_PLUG"

    .line 37
    invoke-static {v1, v0}, Lkotlin/f/b/o;->a(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_6c

    const-string v0, "state"

    .line 38
    invoke-virtual {p2, v0, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result p2

    if-nez p2, :cond_5e

    .line 40
    sget-object p2, Lcom/singbox/util/headset/a;->a:Lcom/singbox/util/headset/a;

    invoke-static {}, Lcom/singbox/util/headset/a;->b()Landroidx/lifecycle/MutableLiveData;

    move-result-object p2

    invoke-static {p1}, Lcom/singbox/util/headset/b;->c(Landroid/content/Context;)Z

    move-result p1

    invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object p1

    invoke-virtual {p2, p1}, Landroidx/lifecycle/MutableLiveData;->setValue(Ljava/lang/Object;)V

    return-void

    :cond_5e
    const/4 p1, 0x1

    if-ne p2, p1, :cond_6c

    .line 42
    sget-object p1, Lcom/singbox/util/headset/a;->a:Lcom/singbox/util/headset/a;

    invoke-static {}, Lcom/singbox/util/headset/a;->b()Landroidx/lifecycle/MutableLiveData;

    move-result-object p1

    sget-object p2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    invoke-virtual {p1, p2}, Landroidx/lifecycle/MutableLiveData;->setValue(Ljava/lang/Object;)V

    :cond_6c
    return-void
.end method