granularity level: instruction

		.class final Lcom/google/firebase/messaging/SharedPreferencesQueue;
.super Ljava/lang/Object;
.source "SharedPreferencesQueue.java"


.field private bulkOperation:Z
.field final internalQueue:Ljava/util/ArrayDeque;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayDeque<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.field private final itemSeparator:Ljava/lang/String;
.field private final queueName:Ljava/lang/String;
.field private final sharedPreferences:Landroid/content/SharedPreferences;
.field private final syncExecutor:Ljava/util/concurrent/Executor;


.method public static synthetic $r8$lambda$_dijO1NT18aM7vHHk9LEtlzE6xQ(Lcom/google/firebase/messaging/SharedPreferencesQueue;)V
	.locals 0

	invoke-direct {p0}, Lcom/google/firebase/messaging/SharedPreferencesQueue;->syncState()V
	return-void
.end method

.method private constructor <init>(Landroid/content/SharedPreferences;Ljava/lang/String;Ljava/lang/String;Ljava/util/concurrent/Executor;)V
	.locals 1

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	new-instance v0, Ljava/util/ArrayDeque;
	invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
	iput-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	const/4 v0, 0x0
	iput-boolean v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->bulkOperation:Z
	iput-object p1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->sharedPreferences:Landroid/content/SharedPreferences;
	iput-object p2, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->queueName:Ljava/lang/String;
	iput-object p3, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->itemSeparator:Ljava/lang/String;
	iput-object p4, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->syncExecutor:Ljava/util/concurrent/Executor;
	return-void
.end method

.method private checkAndSyncState(Ljava/lang/String;)Ljava/lang/String;
	.locals 1

	const/4 v0, 0x0
	return-object v0
.end method

.method private checkAndSyncState(Z)Z
	.locals 1

	if-eqz p1, :cond_0
	iget-boolean v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->bulkOperation:Z
	if-nez v0, :cond_0
	invoke-direct {p0}, Lcom/google/firebase/messaging/SharedPreferencesQueue;->syncStateAsync()V
	:cond_0
	return p1
.end method

.method static createInstance(Landroid/content/SharedPreferences;Ljava/lang/String;Ljava/lang/String;Ljava/util/concurrent/Executor;)Lcom/google/firebase/messaging/SharedPreferencesQueue;
	.locals 1

	new-instance v0, Lcom/google/firebase/messaging/SharedPreferencesQueue;
	invoke-direct {v0, p0, p1, p2, p3}, Lcom/google/firebase/messaging/SharedPreferencesQueue;-><init>(Landroid/content/SharedPreferences;Ljava/lang/String;Ljava/lang/String;Ljava/util/concurrent/Executor;)V
	invoke-direct {v0}, Lcom/google/firebase/messaging/SharedPreferencesQueue;->initQueue()V
	return-object v0
.end method

.method private initQueue()V
	.locals 6

	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	monitor-enter v0
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	invoke-virtual {v1}, Ljava/util/ArrayDeque;->clear()V
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->sharedPreferences:Landroid/content/SharedPreferences;
	iget-object v2, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->queueName:Ljava/lang/String;
	const-string v3, ""
	invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
	move-result-object v1
	invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	move-result v2
	:goto_1
	monitor-exit v0
	return-void
	:catchall_0
	move-exception v1
	monitor-exit v0
	:throw0
	throw v1
.end method

.method private syncState()V
	.locals 4

	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	monitor-enter v0
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->sharedPreferences:Landroid/content/SharedPreferences;
	invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
	move-result-object v1
	iget-object v2, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->queueName:Ljava/lang/String;
	invoke-virtual {p0}, Lcom/google/firebase/messaging/SharedPreferencesQueue;->serialize()Ljava/lang/String;
	move-result-object v3
	invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
	move-result-object v1
	invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z
	monitor-exit v0
	return-void
	:catchall_0
	move-exception v1
	monitor-exit v0
	:throw0
	throw v1
.end method

.method private syncStateAsync()V
	.locals 2

	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->syncExecutor:Ljava/util/concurrent/Executor;
	new-instance v1, Lcom/google/firebase/messaging/SharedPreferencesQueue$$ExternalSyntheticLambda0;
	invoke-direct {v1, p0}, Lcom/google/firebase/messaging/SharedPreferencesQueue$$ExternalSyntheticLambda0;-><init>(Lcom/google/firebase/messaging/SharedPreferencesQueue;)V
	invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
	return-void
.end method

.method public add(Ljava/lang/String;)Z
	.locals 2

	invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	move-result v0
	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->itemSeparator:Ljava/lang/String;
	invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
	move-result v0
	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	monitor-enter v0
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	invoke-virtual {v1, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
	move-result p1
	invoke-direct {p0, p1}, Lcom/google/firebase/messaging/SharedPreferencesQueue;->checkAndSyncState(Z)Z
	move-result p1
	monitor-exit v0
	return p1
	:catchall_0
	move-exception p1
	monitor-exit v0
	:throw0
	throw p1
.end method

.method public beginTransaction()V
	.locals 1

	return-void
.end method

.method  beginTransactionSync()V
	.locals 2

	return-void
.end method

.method public clear()V
	.locals 2

	return-void
.end method

.method public commitTransaction()V
	.locals 1

	return-void
.end method

.method  commitTransactionSync()V
	.locals 2

	return-void
.end method

.method public peek()Ljava/lang/String;
	.locals 2

	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	monitor-enter v0
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	invoke-virtual {v1}, Ljava/util/ArrayDeque;->peek()Ljava/lang/Object;
	move-result-object v1
	check-cast v1, Ljava/lang/String;
	monitor-exit v0
	return-object v1
	:catchall_0
	move-exception v1
	monitor-exit v0
	:throw0
	throw v1
.end method

.method public remove()Ljava/lang/String;
	.locals 2

	const/4 v0, 0x0
	return-object v0
.end method

.method public remove(Ljava/lang/Object;)Z
	.locals 2

	iget-object v0, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	monitor-enter v0
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	invoke-virtual {v1, p1}, Ljava/util/ArrayDeque;->remove(Ljava/lang/Object;)Z
	move-result p1
	invoke-direct {p0, p1}, Lcom/google/firebase/messaging/SharedPreferencesQueue;->checkAndSyncState(Z)Z
	move-result p1
	monitor-exit v0
	return p1
	:catchall_0
	move-exception p1
	monitor-exit v0
	:throw0
	throw p1
.end method

.method public serialize()Ljava/lang/String;
	.locals 3

	new-instance v0, Ljava/lang/StringBuilder;
	invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
	iget-object v1, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->internalQueue:Ljava/util/ArrayDeque;
	invoke-virtual {v1}, Ljava/util/ArrayDeque;->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 v2
	check-cast v2, Ljava/lang/String;
	invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	iget-object v2, p0, Lcom/google/firebase/messaging/SharedPreferencesQueue;->itemSeparator:Ljava/lang/String;
	invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	goto :goto_0
	:cond_0
	invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v0
	return-object v0
.end method

.method public serializeSync()Ljava/lang/String;
	.locals 2

	const/4 v0, 0x0
	return-object v0
.end method

.method public size()I
	.locals 2

	const/4 v0, 0x0
	return v0
.end method

.method public toList()Ljava/util/List;
	.locals 3
	.annotation system Ldalvik/annotation/Signature;
	value = {
	"()",
	"Ljava/util/List<",
	"Ljava/lang/String;",
	">;"
	}
	.end annotation

	const/4 v0, 0x0
	return-object v0
.end method