granularity level: instruction
.class public Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;
.super Ljava/lang/Object;
.source "DefaultHeartBeatController.java"
.implements Lcom/google/firebase/heartbeatinfo/HeartBeatController;
.implements Lcom/google/firebase/heartbeatinfo/HeartBeatInfo;
.field private static final THREAD_FACTORY:Ljava/util/concurrent/ThreadFactory;
.field private final applicationContext:Landroid/content/Context;
.field private final backgroundExecutor:Ljava/util/concurrent/Executor;
.field private final consumers:Ljava/util/Set;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Set<",
"Lcom/google/firebase/heartbeatinfo/HeartBeatConsumer;",
">;"
}
.end annotation
.end field
.field private final storageProvider:Lcom/google/firebase/inject/Provider;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/firebase/inject/Provider<",
"Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;",
">;"
}
.end annotation
.end field
.field private final userAgentProvider:Lcom/google/firebase/inject/Provider;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/firebase/inject/Provider<",
"Lcom/google/firebase/platforminfo/UserAgentPublisher;",
">;"
}
.end annotation
.end field
.method static constructor <clinit>()V
.locals 1
new-instance v0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda0;
invoke-direct {v0}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda0;-><init>()V
sput-object v0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->THREAD_FACTORY:Ljava/util/concurrent/ThreadFactory;
return-void
.end method
.method private constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/util/Set;Lcom/google/firebase/inject/Provider;)V
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/lang/String;",
"Ljava/util/Set<",
"Lcom/google/firebase/heartbeatinfo/HeartBeatConsumer;",
">;",
"Lcom/google/firebase/inject/Provider<",
"Lcom/google/firebase/platforminfo/UserAgentPublisher;",
">;)V"
}
.end annotation
new-instance v1, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda4;
invoke-direct {v1, p1, p2}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda4;-><init>(Landroid/content/Context;Ljava/lang/String;)V
new-instance p2, Ljava/util/concurrent/ThreadPoolExecutor;
sget-object v7, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
new-instance v8, Ljava/util/concurrent/LinkedBlockingQueue;
invoke-direct {v8}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V
sget-object v9, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->THREAD_FACTORY:Ljava/util/concurrent/ThreadFactory;
const/4 v3, 0x0
const/4 v4, 0x1
const-wide/16 v5, 0x1e
move-object v2, p2
invoke-direct/range {v2 .. v9}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
move-object v0, p0
move-object v2, p3
move-object v3, p2
move-object v4, p4
move-object v5, p1
invoke-direct/range {v0 .. v5}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;-><init>(Lcom/google/firebase/inject/Provider;Ljava/util/Set;Ljava/util/concurrent/Executor;Lcom/google/firebase/inject/Provider;Landroid/content/Context;)V
return-void
.end method
.method constructor <init>(Lcom/google/firebase/inject/Provider;Ljava/util/Set;Ljava/util/concurrent/Executor;Lcom/google/firebase/inject/Provider;Landroid/content/Context;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/firebase/inject/Provider<",
"Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;",
">;",
"Ljava/util/Set<",
"Lcom/google/firebase/heartbeatinfo/HeartBeatConsumer;",
">;",
"Ljava/util/concurrent/Executor;",
"Lcom/google/firebase/inject/Provider<",
"Lcom/google/firebase/platforminfo/UserAgentPublisher;",
">;",
"Landroid/content/Context;",
")V"
}
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->storageProvider:Lcom/google/firebase/inject/Provider;
iput-object p2, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->consumers:Ljava/util/Set;
iput-object p3, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->backgroundExecutor:Ljava/util/concurrent/Executor;
iput-object p4, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->userAgentProvider:Lcom/google/firebase/inject/Provider;
iput-object p5, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->applicationContext:Landroid/content/Context;
return-void
.end method
.method public static component()Lcom/google/firebase/components/Component;
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/google/firebase/components/Component<",
"Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;",
">;"
}
.end annotation
const-class v0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;
const/4 v1, 0x2
new-array v1, v1, [Ljava/lang/Class;
const/4 v2, 0x0
const-class v3, Lcom/google/firebase/heartbeatinfo/HeartBeatController;
aput-object v3, v1, v2
const/4 v2, 0x1
const-class v3, Lcom/google/firebase/heartbeatinfo/HeartBeatInfo;
aput-object v3, v1, v2
invoke-static {v0, v1}, Lcom/google/firebase/components/Component;->builder(Ljava/lang/Class;[Ljava/lang/Class;)Lcom/google/firebase/components/Component$Builder;
move-result-object v0
const-class v1, Landroid/content/Context;
invoke-static {v1}, Lcom/google/firebase/components/Dependency;->required(Ljava/lang/Class;)Lcom/google/firebase/components/Dependency;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/google/firebase/components/Component$Builder;->add(Lcom/google/firebase/components/Dependency;)Lcom/google/firebase/components/Component$Builder;
move-result-object v0
const-class v1, Lcom/google/firebase/FirebaseApp;
invoke-static {v1}, Lcom/google/firebase/components/Dependency;->required(Ljava/lang/Class;)Lcom/google/firebase/components/Dependency;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/google/firebase/components/Component$Builder;->add(Lcom/google/firebase/components/Dependency;)Lcom/google/firebase/components/Component$Builder;
move-result-object v0
const-class v1, Lcom/google/firebase/heartbeatinfo/HeartBeatConsumer;
invoke-static {v1}, Lcom/google/firebase/components/Dependency;->setOf(Ljava/lang/Class;)Lcom/google/firebase/components/Dependency;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/google/firebase/components/Component$Builder;->add(Lcom/google/firebase/components/Dependency;)Lcom/google/firebase/components/Component$Builder;
move-result-object v0
const-class v1, Lcom/google/firebase/platforminfo/UserAgentPublisher;
invoke-static {v1}, Lcom/google/firebase/components/Dependency;->requiredProvider(Ljava/lang/Class;)Lcom/google/firebase/components/Dependency;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/google/firebase/components/Component$Builder;->add(Lcom/google/firebase/components/Dependency;)Lcom/google/firebase/components/Component$Builder;
move-result-object v0
new-instance v1, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda3;
invoke-direct {v1}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda3;-><init>()V
invoke-virtual {v0, v1}, Lcom/google/firebase/components/Component$Builder;->factory(Lcom/google/firebase/components/ComponentFactory;)Lcom/google/firebase/components/Component$Builder;
move-result-object v0
invoke-virtual {v0}, Lcom/google/firebase/components/Component$Builder;->build()Lcom/google/firebase/components/Component;
move-result-object v0
return-object v0
.end method
.method static synthetic lambda$component$4(Lcom/google/firebase/components/ComponentContainer;)Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;
.locals 5
new-instance v0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;
const-class v1, Landroid/content/Context;
invoke-interface {p0, v1}, Lcom/google/firebase/components/ComponentContainer;->get(Ljava/lang/Class;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/content/Context;
const-class v2, Lcom/google/firebase/FirebaseApp;
invoke-interface {p0, v2}, Lcom/google/firebase/components/ComponentContainer;->get(Ljava/lang/Class;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/google/firebase/FirebaseApp;
invoke-virtual {v2}, Lcom/google/firebase/FirebaseApp;->getPersistenceKey()Ljava/lang/String;
move-result-object v2
const-class v3, Lcom/google/firebase/heartbeatinfo/HeartBeatConsumer;
invoke-interface {p0, v3}, Lcom/google/firebase/components/ComponentContainer;->setOf(Ljava/lang/Class;)Ljava/util/Set;
move-result-object v3
const-class v4, Lcom/google/firebase/platforminfo/UserAgentPublisher;
invoke-interface {p0, v4}, Lcom/google/firebase/components/ComponentContainer;->getProvider(Ljava/lang/Class;)Lcom/google/firebase/inject/Provider;
move-result-object p0
invoke-direct {v0, v1, v2, v3, p0}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/util/Set;Lcom/google/firebase/inject/Provider;)V
return-object v0
.end method
.method static synthetic lambda$new$3(Landroid/content/Context;Ljava/lang/String;)Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;
.locals 1
new-instance v0, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;
invoke-direct {v0, p0, p1}, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;-><init>(Landroid/content/Context;Ljava/lang/String;)V
return-object v0
.end method
.method static synthetic lambda$static$0(Ljava/lang/Runnable;)Ljava/lang/Thread;
.locals 2
new-instance v0, Ljava/lang/Thread;
const-string v1, "heartbeat-information-executor"
invoke-direct {v0, p0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;Ljava/lang/String;)V
return-object v0
.end method
.method public declared-synchronized getHeartBeatCode(Ljava/lang/String;)Lcom/google/firebase/heartbeatinfo/HeartBeatInfo$HeartBeat;
.locals 2
monitor-enter p0
:try_start_0
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v0
iget-object p1, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->storageProvider:Lcom/google/firebase/inject/Provider;
invoke-interface {p1}, Lcom/google/firebase/inject/Provider;->get()Ljava/lang/Object;
move-result-object p1
check-cast p1, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;
invoke-virtual {p1, v0, v1}, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;->shouldSendGlobalHeartBeat(J)Z
move-result v0
if-eqz v0, :cond_0
invoke-virtual {p1}, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;->postHeartBeatCleanUp()V
sget-object p1, Lcom/google/firebase/heartbeatinfo/HeartBeatInfo$HeartBeat;->GLOBAL:Lcom/google/firebase/heartbeatinfo/HeartBeatInfo$HeartBeat;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object p1
:try_start_1
:cond_0
sget-object p1, Lcom/google/firebase/heartbeatinfo/HeartBeatInfo$HeartBeat;->NONE:Lcom/google/firebase/heartbeatinfo/HeartBeatInfo$HeartBeat;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
monitor-exit p0
return-object p1
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public getHeartBeatsHeader()Lcom/google/android/gms/tasks/Task;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/google/android/gms/tasks/Task<",
"Ljava/lang/String;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->applicationContext:Landroid/content/Context;
invoke-static {v0}, Landroidx/core/os/UserManagerCompat;->isUserUnlocked(Landroid/content/Context;)Z
move-result v0
xor-int/lit8 v0, v0, 0x1
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->backgroundExecutor:Ljava/util/concurrent/Executor;
new-instance v1, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda1;
invoke-direct {v1, p0}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda1;-><init>(Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;)V
invoke-static {v0, v1}, Lcom/google/android/gms/tasks/Tasks;->call(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Callable;)Lcom/google/android/gms/tasks/Task;
move-result-object v0
return-object v0
.end method
.method synthetic lambda$getHeartBeatsHeader$2$com-google-firebase-heartbeatinfo-DefaultHeartBeatController()Ljava/lang/String;
.locals 7
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->storageProvider:Lcom/google/firebase/inject/Provider;
invoke-interface {v0}, Lcom/google/firebase/inject/Provider;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;
invoke-virtual {v0}, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;->getAllHeartBeats()Ljava/util/List;
move-result-object v1
invoke-virtual {v0}, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;->deleteAllHeartBeats()V
new-instance v0, Lorg/json/JSONArray;
invoke-direct {v0}, Lorg/json/JSONArray;-><init>()V
const/4 v2, 0x0
:goto_0
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v3
if-ge v2, v3, :cond_0
invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/google/firebase/heartbeatinfo/HeartBeatResult;
new-instance v4, Lorg/json/JSONObject;
invoke-direct {v4}, Lorg/json/JSONObject;-><init>()V
const-string v5, "agent"
invoke-virtual {v3}, Lcom/google/firebase/heartbeatinfo/HeartBeatResult;->getUserAgent()Ljava/lang/String;
move-result-object v6
invoke-virtual {v4, v5, v6}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
const-string v5, "dates"
new-instance v6, Lorg/json/JSONArray;
invoke-virtual {v3}, Lcom/google/firebase/heartbeatinfo/HeartBeatResult;->getUsedDates()Ljava/util/List;
move-result-object v3
invoke-direct {v6, v3}, Lorg/json/JSONArray;-><init>(Ljava/util/Collection;)V
invoke-virtual {v4, v5, v6}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
invoke-virtual {v0, v4}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_0
new-instance v1, Lorg/json/JSONObject;
invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V
const-string v2, "heartbeats"
invoke-virtual {v1, v2, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
const-string v0, "version"
const-string v2, "2"
invoke-virtual {v1, v0, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
new-instance v2, Landroid/util/Base64OutputStream;
const/16 v3, 0xb
invoke-direct {v2, v0, v3}, Landroid/util/Base64OutputStream;-><init>(Ljava/io/OutputStream;I)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_4
new-instance v3, Ljava/util/zip/GZIPOutputStream;
invoke-direct {v3, v2}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V
invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object v1
const-string v4, "UTF-8"
invoke-virtual {v1, v4}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
move-result-object v1
invoke-virtual {v3, v1}, Ljava/util/zip/GZIPOutputStream;->write([B)V
invoke-virtual {v3}, Ljava/util/zip/GZIPOutputStream;->close()V
:try_start_4
invoke-virtual {v2}, Landroid/util/Base64OutputStream;->close()V
const-string v1, "UTF-8"
invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->toString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
monitor-exit p0
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_4
return-object v0
:catchall_4
move-exception v0
monitor-exit p0
throw v0
.end method
.method synthetic lambda$registerHeartBeat$1$com-google-firebase-heartbeatinfo-DefaultHeartBeatController()Ljava/lang/Void;
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
monitor-enter p0
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->storageProvider:Lcom/google/firebase/inject/Provider;
invoke-interface {v0}, Lcom/google/firebase/inject/Provider;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
iget-object v3, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->userAgentProvider:Lcom/google/firebase/inject/Provider;
invoke-interface {v3}, Lcom/google/firebase/inject/Provider;->get()Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/google/firebase/platforminfo/UserAgentPublisher;
invoke-interface {v3}, Lcom/google/firebase/platforminfo/UserAgentPublisher;->getUserAgent()Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v1, v2, v3}, Lcom/google/firebase/heartbeatinfo/HeartBeatInfoStorage;->storeHeartBeat(JLjava/lang/String;)V
monitor-exit p0
const/4 v0, 0x0
return-object v0
:catchall_0
move-exception v0
monitor-exit p0
:throw0
throw v0
.end method
.method public registerHeartBeat()Lcom/google/android/gms/tasks/Task;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/google/android/gms/tasks/Task<",
"Ljava/lang/Void;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->consumers:Ljava/util/Set;
invoke-interface {v0}, Ljava/util/Set;->size()I
move-result v0
const/4 v1, 0x0
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->applicationContext:Landroid/content/Context;
invoke-static {v0}, Landroidx/core/os/UserManagerCompat;->isUserUnlocked(Landroid/content/Context;)Z
move-result v0
xor-int/lit8 v0, v0, 0x1
iget-object v0, p0, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;->backgroundExecutor:Ljava/util/concurrent/Executor;
new-instance v1, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda2;
invoke-direct {v1, p0}, Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController$$ExternalSyntheticLambda2;-><init>(Lcom/google/firebase/heartbeatinfo/DefaultHeartBeatController;)V
invoke-static {v0, v1}, Lcom/google/android/gms/tasks/Tasks;->call(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Callable;)Lcom/google/android/gms/tasks/Task;
move-result-object v0
return-object v0
.end method