apkfuckery/com.discord/smali/com/bugsnag/android/Breadcrumbs.smali
2019-02-04 21:05:16 +01:00

192 lines
5 KiB
Smali

.class Lcom/bugsnag/android/Breadcrumbs;
.super Ljava/lang/Object;
.source "Breadcrumbs.java"
# interfaces
.implements Lcom/bugsnag/android/JsonStream$Streamable;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;
}
.end annotation
# static fields
.field private static final DEFAULT_MAX_SIZE:I = 0x14
# instance fields
.field private maxSize:I
.field private final store:Ljava/util/Queue;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Queue",
"<",
"Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;",
">;"
}
.end annotation
.end field
# direct methods
.method constructor <init>()V
.locals 1
.prologue
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/util/concurrent/ConcurrentLinkedQueue;
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentLinkedQueue;-><init>()V
iput-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
const/16 v0, 0x14
iput v0, p0, Lcom/bugsnag/android/Breadcrumbs;->maxSize:I
return-void
.end method
# virtual methods
.method add(Ljava/lang/String;)V
.locals 2
.param p1, "message" # Ljava/lang/String;
.annotation build Landroid/support/annotation/NonNull;
.end annotation
.end param
.prologue
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->size()I
move-result v0
iget v1, p0, Lcom/bugsnag/android/Breadcrumbs;->maxSize:I
if-lt v0, v1, :cond_0
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->poll()Ljava/lang/Object;
:cond_0
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
new-instance v1, Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;
invoke-direct {v1, p1}, Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;-><init>(Ljava/lang/String;)V
invoke-interface {v0, v1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
return-void
.end method
.method clear()V
.locals 1
.prologue
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->clear()V
return-void
.end method
.method setSize(I)V
.locals 1
.param p1, "size" # I
.prologue
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->size()I
move-result v0
if-le p1, v0, :cond_1
iput p1, p0, Lcom/bugsnag/android/Breadcrumbs;->maxSize:I
:cond_0
return-void
:cond_1
:goto_0
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->size()I
move-result v0
if-le v0, p1, :cond_0
iget-object v0, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->poll()Ljava/lang/Object;
goto :goto_0
.end method
.method public toStream(Lcom/bugsnag/android/JsonStream;)V
.locals 3
.param p1, "writer" # Lcom/bugsnag/android/JsonStream;
.annotation build Landroid/support/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->beginArray()Lcom/bugsnag/android/JsonWriter;
iget-object v1, p0, Lcom/bugsnag/android/Breadcrumbs;->store:Ljava/util/Queue;
invoke-interface {v1}, Ljava/util/Queue;->iterator()Ljava/util/Iterator;
move-result-object v1
:goto_0
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_0
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;
.local v0, "breadcrumb":Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->beginArray()Lcom/bugsnag/android/JsonWriter;
iget-object v2, v0, Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;->timestamp:Ljava/lang/String;
invoke-virtual {p1, v2}, Lcom/bugsnag/android/JsonStream;->value(Ljava/lang/String;)Lcom/bugsnag/android/JsonWriter;
iget-object v2, v0, Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;->message:Ljava/lang/String;
invoke-virtual {p1, v2}, Lcom/bugsnag/android/JsonStream;->value(Ljava/lang/String;)Lcom/bugsnag/android/JsonWriter;
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->endArray()Lcom/bugsnag/android/JsonWriter;
goto :goto_0
.end local v0 # "breadcrumb":Lcom/bugsnag/android/Breadcrumbs$Breadcrumb;
:cond_0
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->endArray()Lcom/bugsnag/android/JsonWriter;
return-void
.end method