b.smali

.class public final Lbolts/b;
.super Ljava/lang/Object;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lbolts/b$a;
    }
.end annotation


# static fields
.field public static final d:Lbolts/b;


# instance fields
.field public final a:Ljava/util/concurrent/ExecutorService;

.field public final b:Ljava/util/concurrent/ScheduledExecutorService;

.field public final c:Lbolts/b$a;


# direct methods
.method public static constructor <clinit>()V
    .registers 1

    new-instance v0, Lbolts/b;

    invoke-direct {v0}, Lbolts/b;-><init>()V

    sput-object v0, Lbolts/b;->d:Lbolts/b;

    return-void
.end method

.method public constructor <init>()V
    .registers 13

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

    const-string v0, "java.runtime.name"

    .line 2
    invoke-static {v0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    if-nez v0, :cond_e

    const/4 v0, 0x0

    goto :goto_1a

    .line 3
    :cond_e
    sget-object v2, Ljava/util/Locale;->US:Ljava/util/Locale;

    invoke-virtual {v0, v2}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;

    move-result-object v0

    const-string v2, "android"

    invoke-virtual {v0, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    :goto_1a
    const/4 v2, 0x0

    if-nez v0, :cond_42

    .line 4
    sget-object v0, Lcom/shopee/app/asm/fix/threadpool/config/a;->a:Lcom/shopee/app/asm/fix/threadpool/config/a;

    invoke-virtual {v0}, Lcom/shopee/app/asm/fix/threadpool/config/a;->b()Z

    move-result v0

    if-eqz v0, :cond_2c

    .line 5
    sget-object v0, Lcom/shopee/app/asm/fix/threadpool/pool/d;->a:Lcom/shopee/app/asm/fix/threadpool/pool/d;

    invoke-virtual {v0}, Lcom/shopee/app/asm/fix/threadpool/pool/d;->a()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    goto :goto_83

    .line 6
    :cond_2c
    invoke-static {}, Lcom/garena/android/appkit/logging/a;->C()Z

    move-result v0

    if-eqz v0, :cond_3d

    const-string v0, "bolts/BoltsExecutors"

    .line 7
    invoke-static {v2, v0}, Lcom/garena/android/appkit/logging/a;->t0(Ljava/util/concurrent/ThreadFactory;Ljava/lang/String;)Ljava/util/concurrent/ThreadFactory;

    move-result-object v0

    invoke-static {v0}, Ljava/util/concurrent/Executors;->newCachedThreadPool(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    goto :goto_83

    .line 8
    :cond_3d
    invoke-static {}, Ljava/util/concurrent/Executors;->newCachedThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    goto :goto_83

    .line 9
    :cond_42
    sget-object v0, Lcom/shopee/app/asm/fix/threadpool/config/a;->a:Lcom/shopee/app/asm/fix/threadpool/config/a;

    .line 10
    sget-object v2, Lcom/shopee/app/stability/g;->a:Lcom/shopee/app/stability/g;

    const/16 v2, 0x8

    const-string v3, "android_enable_reuse_bolt_cached_pool"

    const-string v4, "shopee_performance-android"

    const-string v5, "2920a5548c017a94407daca04f17a880f7a1283b39ad26562cb65fc8d91248ae"

    invoke-static {v3, v4, v5, v2}, Lcom/shopee/app/stability/g;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Z

    move-result v2

    const/4 v4, 0x1

    if-nez v2, :cond_63

    .line 11
    invoke-virtual {v0}, Lcom/shopee/app/asm/fix/threadpool/config/a;->g()Landroid/content/SharedPreferences;

    move-result-object v0

    if-eqz v0, :cond_60

    invoke-interface {v0, v3, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    goto :goto_61

    :cond_60
    const/4 v0, 0x0

    :goto_61
    if-eqz v0, :cond_64

    :cond_63
    const/4 v1, 0x1

    :cond_64
    if-eqz v1, :cond_6d

    .line 12
    sget-object v0, Lcom/shopee/app/asm/fix/threadpool/pool/d;->a:Lcom/shopee/app/asm/fix/threadpool/pool/d;

    invoke-virtual {v0}, Lcom/shopee/app/asm/fix/threadpool/pool/d;->a()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    goto :goto_83

    .line 13
    :cond_6d
    sget v5, Lbolts/a;->c:I

    sget v6, Lbolts/a;->d:I

    sget-object v9, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    new-instance v10, Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-direct {v10}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V

    const-wide/16 v7, 0x1

    const-string v11, "bolts/AndroidExecutors"

    invoke-static/range {v5 .. v11}, Lcom/garena/android/appkit/logging/a;->Q(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/lang/String;)Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v0

    .line 14
    invoke-virtual {v0, v4}, Ljava/util/concurrent/ThreadPoolExecutor;->allowCoreThreadTimeOut(Z)V

    .line 15
    :goto_83
    iput-object v0, p0, Lbolts/b;->a:Ljava/util/concurrent/ExecutorService;

    .line 16
    invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadScheduledExecutor()Ljava/util/concurrent/ScheduledExecutorService;

    move-result-object v0

    iput-object v0, p0, Lbolts/b;->b:Ljava/util/concurrent/ScheduledExecutorService;

    .line 17
    new-instance v0, Lbolts/b$a;

    invoke-direct {v0}, Lbolts/b$a;-><init>()V

    iput-object v0, p0, Lbolts/b;->c:Lbolts/b$a;

    return-void
.end method