2020-11-12 02:11:44 +00:00
|
|
|
.class public final Landroidx/work/impl/utils/RawQueries;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "RawQueries.java"
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2020-11-16 22:05:17 +00:00
|
|
|
.method private constructor <init>()V
|
2020-11-12 02:11:44 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.method private static bindings(Ljava/lang/StringBuilder;I)V
|
2020-11-12 02:11:44 +00:00
|
|
|
.locals 3
|
|
|
|
.param p0 # Ljava/lang/StringBuilder;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
if-gtz p1, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string v0, "?"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v1, p1, :cond_1
|
|
|
|
|
|
|
|
const-string v2, ","
|
|
|
|
|
|
|
|
invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static workQueryToRawQuery(Landroidx/work/WorkQuery;)Landroidx/sqlite/db/SupportSQLiteQuery;
|
|
|
|
.locals 7
|
|
|
|
.param p0 # Landroidx/work/WorkQuery;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v2, "SELECT * FROM workspec"
|
|
|
|
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/work/WorkQuery;->getStates()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
const-string v4, " AND"
|
|
|
|
|
|
|
|
const-string v5, " WHERE"
|
|
|
|
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
|
|
|
|
new-instance v3, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->size()I
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
invoke-direct {v3, v6}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
if-eqz v6, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
check-cast v6, Landroidx/work/WorkInfo$State;
|
|
|
|
|
|
|
|
invoke-static {v6}, Landroidx/work/impl/model/WorkTypeConverters;->stateToInt(Landroidx/work/WorkInfo$State;)I
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
invoke-virtual {v3, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v2, " state IN ("
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Landroidx/work/impl/utils/RawQueries;->bindings(Ljava/lang/StringBuilder;I)V
|
|
|
|
|
|
|
|
const-string v2, ")"
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v3}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
move-object v5, v4
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-virtual {p0}, Landroidx/work/WorkQuery;->getTags()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
const-string v6, "))"
|
|
|
|
|
|
|
|
if-nez v3, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v3, " id IN (SELECT work_spec_id FROM worktag WHERE tag IN ("
|
|
|
|
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->size()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v1, v3}, Landroidx/work/impl/utils/RawQueries;->bindings(Ljava/lang/StringBuilder;I)V
|
|
|
|
|
|
|
|
invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v2}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
move-object v4, v5
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-virtual {p0}, Landroidx/work/WorkQuery;->getUniqueWorkNames()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
invoke-interface {p0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
|
|
|
|
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v2, " id IN (SELECT work_spec_id FROM workname WHERE name IN ("
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Landroidx/work/impl/utils/RawQueries;->bindings(Ljava/lang/StringBuilder;I)V
|
|
|
|
|
|
|
|
invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p0, ";"
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
new-instance p0, Landroidx/sqlite/db/SimpleSQLiteQuery;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->toArray()[Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p0, v1, v0}, Landroidx/sqlite/db/SimpleSQLiteQuery;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|