discord-jadx/app/src/main/java/androidx/work/impl/model/WorkSpecDao_Impl.java

1984 lines
115 KiB
Java

package androidx.work.impl.model;
import android.database.Cursor;
import androidx.collection.ArrayMap;
import androidx.lifecycle.LiveData;
import androidx.room.EntityInsertionAdapter;
import androidx.room.RoomDatabase;
import androidx.room.RoomSQLiteQuery;
import androidx.room.SharedSQLiteStatement;
import androidx.room.util.CursorUtil;
import androidx.room.util.DBUtil;
import androidx.room.util.StringUtil;
import androidx.sqlite.db.SupportSQLiteStatement;
import androidx.work.Constraints;
import androidx.work.Data;
import androidx.work.WorkInfo;
import androidx.work.impl.model.WorkSpec;
import com.discord.models.domain.ModelAuditLogEntry;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
public final class WorkSpecDao_Impl implements WorkSpecDao {
private final RoomDatabase __db;
private final EntityInsertionAdapter<WorkSpec> __insertionAdapterOfWorkSpec;
private final SharedSQLiteStatement __preparedStmtOfDelete;
private final SharedSQLiteStatement __preparedStmtOfIncrementWorkSpecRunAttemptCount;
private final SharedSQLiteStatement __preparedStmtOfMarkWorkSpecScheduled;
private final SharedSQLiteStatement __preparedStmtOfPruneFinishedWorkWithZeroDependentsIgnoringKeepForAtLeast;
private final SharedSQLiteStatement __preparedStmtOfResetScheduledState;
private final SharedSQLiteStatement __preparedStmtOfResetWorkSpecRunAttemptCount;
private final SharedSQLiteStatement __preparedStmtOfSetOutput;
private final SharedSQLiteStatement __preparedStmtOfSetPeriodStartTime;
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$1 reason: invalid class name */
public class AnonymousClass1 extends EntityInsertionAdapter<WorkSpec> {
public AnonymousClass1(RoomDatabase roomDatabase) {
super(roomDatabase);
}
public void bind(SupportSQLiteStatement supportSQLiteStatement, WorkSpec workSpec) {
String str = workSpec.f29id;
if (str == null) {
supportSQLiteStatement.bindNull(1);
} else {
supportSQLiteStatement.bindString(1, str);
}
supportSQLiteStatement.bindLong(2, (long) WorkTypeConverters.stateToInt(workSpec.state));
String str2 = workSpec.workerClassName;
if (str2 == null) {
supportSQLiteStatement.bindNull(3);
} else {
supportSQLiteStatement.bindString(3, str2);
}
String str3 = workSpec.inputMergerClassName;
if (str3 == null) {
supportSQLiteStatement.bindNull(4);
} else {
supportSQLiteStatement.bindString(4, str3);
}
byte[] byteArrayInternal = Data.toByteArrayInternal(workSpec.input);
if (byteArrayInternal == null) {
supportSQLiteStatement.bindNull(5);
} else {
supportSQLiteStatement.bindBlob(5, byteArrayInternal);
}
byte[] byteArrayInternal2 = Data.toByteArrayInternal(workSpec.output);
if (byteArrayInternal2 == null) {
supportSQLiteStatement.bindNull(6);
} else {
supportSQLiteStatement.bindBlob(6, byteArrayInternal2);
}
supportSQLiteStatement.bindLong(7, workSpec.initialDelay);
supportSQLiteStatement.bindLong(8, workSpec.intervalDuration);
supportSQLiteStatement.bindLong(9, workSpec.flexDuration);
supportSQLiteStatement.bindLong(10, (long) workSpec.runAttemptCount);
supportSQLiteStatement.bindLong(11, (long) WorkTypeConverters.backoffPolicyToInt(workSpec.backoffPolicy));
supportSQLiteStatement.bindLong(12, workSpec.backoffDelayDuration);
supportSQLiteStatement.bindLong(13, workSpec.periodStartTime);
supportSQLiteStatement.bindLong(14, workSpec.minimumRetentionDuration);
supportSQLiteStatement.bindLong(15, workSpec.scheduleRequestedAt);
supportSQLiteStatement.bindLong(16, workSpec.runInForeground ? 1 : 0);
Constraints constraints = workSpec.constraints;
if (constraints != null) {
supportSQLiteStatement.bindLong(17, (long) WorkTypeConverters.networkTypeToInt(constraints.getRequiredNetworkType()));
supportSQLiteStatement.bindLong(18, constraints.requiresCharging() ? 1 : 0);
supportSQLiteStatement.bindLong(19, constraints.requiresDeviceIdle() ? 1 : 0);
supportSQLiteStatement.bindLong(20, constraints.requiresBatteryNotLow() ? 1 : 0);
supportSQLiteStatement.bindLong(21, constraints.requiresStorageNotLow() ? 1 : 0);
supportSQLiteStatement.bindLong(22, constraints.getTriggerContentUpdateDelay());
supportSQLiteStatement.bindLong(23, constraints.getTriggerMaxContentDelay());
byte[] contentUriTriggersToByteArray = WorkTypeConverters.contentUriTriggersToByteArray(constraints.getContentUriTriggers());
if (contentUriTriggersToByteArray == null) {
supportSQLiteStatement.bindNull(24);
} else {
supportSQLiteStatement.bindBlob(24, contentUriTriggersToByteArray);
}
} else {
supportSQLiteStatement.bindNull(17);
supportSQLiteStatement.bindNull(18);
supportSQLiteStatement.bindNull(19);
supportSQLiteStatement.bindNull(20);
supportSQLiteStatement.bindNull(21);
supportSQLiteStatement.bindNull(22);
supportSQLiteStatement.bindNull(23);
supportSQLiteStatement.bindNull(24);
}
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "INSERT OR IGNORE INTO `WorkSpec` (`id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`period_start_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$10 reason: invalid class name */
public class AnonymousClass10 implements Callable<List<WorkSpec.WorkInfoPojo>> {
public final /* synthetic */ RoomSQLiteQuery val$_statement;
public AnonymousClass10(RoomSQLiteQuery roomSQLiteQuery) {
this.val$_statement = roomSQLiteQuery;
}
/* JADX INFO: finally extract failed */
@Override // java.util.concurrent.Callable
public List<WorkSpec.WorkInfoPojo> call() throws Exception {
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).beginTransaction();
try {
Cursor query = DBUtil.query(WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this), this.val$_statement, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap arrayMap = new ArrayMap();
ArrayMap arrayMap2 = new ArrayMap();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList());
}
}
}
query.moveToPosition(-1);
WorkSpecDao_Impl.access$100(WorkSpecDao_Impl.this, arrayMap);
WorkSpecDao_Impl.access$200(WorkSpecDao_Impl.this, arrayMap2);
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
ArrayList arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
ArrayList arrayList3 = !query.isNull(columnIndexOrThrow) ? arrayMap2.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList3 == null) {
arrayList3 = new ArrayList();
}
WorkSpec.WorkInfoPojo workInfoPojo = new WorkSpec.WorkInfoPojo();
workInfoPojo.f31id = query.getString(columnIndexOrThrow);
workInfoPojo.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo.tags = arrayList2;
workInfoPojo.progress = arrayList3;
arrayList.add(workInfoPojo);
}
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).setTransactionSuccessful();
query.close();
return arrayList;
} catch (Throwable th) {
query.close();
throw th;
}
} finally {
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).endTransaction();
}
}
@Override // java.lang.Object
public void finalize() {
this.val$_statement.release();
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$11 reason: invalid class name */
public class AnonymousClass11 implements Callable<List<WorkSpec.WorkInfoPojo>> {
public final /* synthetic */ RoomSQLiteQuery val$_statement;
public AnonymousClass11(RoomSQLiteQuery roomSQLiteQuery) {
this.val$_statement = roomSQLiteQuery;
}
/* JADX INFO: finally extract failed */
@Override // java.util.concurrent.Callable
public List<WorkSpec.WorkInfoPojo> call() throws Exception {
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).beginTransaction();
try {
Cursor query = DBUtil.query(WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this), this.val$_statement, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap arrayMap = new ArrayMap();
ArrayMap arrayMap2 = new ArrayMap();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList());
}
}
}
query.moveToPosition(-1);
WorkSpecDao_Impl.access$100(WorkSpecDao_Impl.this, arrayMap);
WorkSpecDao_Impl.access$200(WorkSpecDao_Impl.this, arrayMap2);
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
ArrayList arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
ArrayList arrayList3 = !query.isNull(columnIndexOrThrow) ? arrayMap2.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList3 == null) {
arrayList3 = new ArrayList();
}
WorkSpec.WorkInfoPojo workInfoPojo = new WorkSpec.WorkInfoPojo();
workInfoPojo.f31id = query.getString(columnIndexOrThrow);
workInfoPojo.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo.tags = arrayList2;
workInfoPojo.progress = arrayList3;
arrayList.add(workInfoPojo);
}
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).setTransactionSuccessful();
query.close();
return arrayList;
} catch (Throwable th) {
query.close();
throw th;
}
} finally {
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).endTransaction();
}
}
@Override // java.lang.Object
public void finalize() {
this.val$_statement.release();
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$12 reason: invalid class name */
public class AnonymousClass12 implements Callable<List<WorkSpec.WorkInfoPojo>> {
public final /* synthetic */ RoomSQLiteQuery val$_statement;
public AnonymousClass12(RoomSQLiteQuery roomSQLiteQuery) {
this.val$_statement = roomSQLiteQuery;
}
/* JADX INFO: finally extract failed */
@Override // java.util.concurrent.Callable
public List<WorkSpec.WorkInfoPojo> call() throws Exception {
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).beginTransaction();
try {
Cursor query = DBUtil.query(WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this), this.val$_statement, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap arrayMap = new ArrayMap();
ArrayMap arrayMap2 = new ArrayMap();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList());
}
}
}
query.moveToPosition(-1);
WorkSpecDao_Impl.access$100(WorkSpecDao_Impl.this, arrayMap);
WorkSpecDao_Impl.access$200(WorkSpecDao_Impl.this, arrayMap2);
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
ArrayList arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
ArrayList arrayList3 = !query.isNull(columnIndexOrThrow) ? arrayMap2.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList3 == null) {
arrayList3 = new ArrayList();
}
WorkSpec.WorkInfoPojo workInfoPojo = new WorkSpec.WorkInfoPojo();
workInfoPojo.f31id = query.getString(columnIndexOrThrow);
workInfoPojo.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo.tags = arrayList2;
workInfoPojo.progress = arrayList3;
arrayList.add(workInfoPojo);
}
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).setTransactionSuccessful();
query.close();
return arrayList;
} catch (Throwable th) {
query.close();
throw th;
}
} finally {
WorkSpecDao_Impl.access$000(WorkSpecDao_Impl.this).endTransaction();
}
}
@Override // java.lang.Object
public void finalize() {
this.val$_statement.release();
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$2 reason: invalid class name */
public class AnonymousClass2 extends SharedSQLiteStatement {
public AnonymousClass2(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "DELETE FROM workspec WHERE id=?";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$3 reason: invalid class name */
public class AnonymousClass3 extends SharedSQLiteStatement {
public AnonymousClass3(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "UPDATE workspec SET output=? WHERE id=?";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$4 reason: invalid class name */
public class AnonymousClass4 extends SharedSQLiteStatement {
public AnonymousClass4(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "UPDATE workspec SET period_start_time=? WHERE id=?";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$5 reason: invalid class name */
public class AnonymousClass5 extends SharedSQLiteStatement {
public AnonymousClass5(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "UPDATE workspec SET run_attempt_count=run_attempt_count+1 WHERE id=?";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$6 reason: invalid class name */
public class AnonymousClass6 extends SharedSQLiteStatement {
public AnonymousClass6(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "UPDATE workspec SET run_attempt_count=0 WHERE id=?";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$7 reason: invalid class name */
public class AnonymousClass7 extends SharedSQLiteStatement {
public AnonymousClass7(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "UPDATE workspec SET schedule_requested_at=? WHERE id=?";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$8 reason: invalid class name */
public class AnonymousClass8 extends SharedSQLiteStatement {
public AnonymousClass8(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "UPDATE workspec SET schedule_requested_at=-1 WHERE state NOT IN (2, 3, 5)";
}
}
/* renamed from: androidx.work.impl.model.WorkSpecDao_Impl$9 reason: invalid class name */
public class AnonymousClass9 extends SharedSQLiteStatement {
public AnonymousClass9(RoomDatabase roomDatabase) {
super(roomDatabase);
}
@Override // androidx.room.SharedSQLiteStatement
public String createQuery() {
return "DELETE FROM workspec WHERE state IN (2, 3, 5) AND (SELECT COUNT(*)=0 FROM dependency WHERE prerequisite_id=id AND work_spec_id NOT IN (SELECT id FROM workspec WHERE state IN (2, 3, 5)))";
}
}
public WorkSpecDao_Impl(RoomDatabase roomDatabase) {
this.__db = roomDatabase;
this.__insertionAdapterOfWorkSpec = new AnonymousClass1(roomDatabase);
this.__preparedStmtOfDelete = new AnonymousClass2(roomDatabase);
this.__preparedStmtOfSetOutput = new AnonymousClass3(roomDatabase);
this.__preparedStmtOfSetPeriodStartTime = new AnonymousClass4(roomDatabase);
this.__preparedStmtOfIncrementWorkSpecRunAttemptCount = new AnonymousClass5(roomDatabase);
this.__preparedStmtOfResetWorkSpecRunAttemptCount = new AnonymousClass6(roomDatabase);
this.__preparedStmtOfMarkWorkSpecScheduled = new AnonymousClass7(roomDatabase);
this.__preparedStmtOfResetScheduledState = new AnonymousClass8(roomDatabase);
this.__preparedStmtOfPruneFinishedWorkWithZeroDependentsIgnoringKeepForAtLeast = new AnonymousClass9(roomDatabase);
}
private void __fetchRelationshipWorkProgressAsandroidxWorkData(ArrayMap<String, ArrayList<Data>> arrayMap) {
ArrayList<Data> arrayList;
int i;
Set<String> keySet = arrayMap.keySet();
if (!keySet.isEmpty()) {
if (arrayMap.size() > 999) {
ArrayMap<String, ArrayList<Data>> arrayMap2 = new ArrayMap<>((int) RoomDatabase.MAX_BIND_PARAMETER_CNT);
int size = arrayMap.size();
int i2 = 0;
loop0:
while (true) {
i = 0;
while (i2 < size) {
arrayMap2.put(arrayMap.keyAt(i2), arrayMap.valueAt(i2));
i2++;
i++;
if (i == 999) {
__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap2);
arrayMap2 = new ArrayMap<>((int) RoomDatabase.MAX_BIND_PARAMETER_CNT);
}
}
break loop0;
}
if (i > 0) {
__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap2);
return;
}
return;
}
StringBuilder newStringBuilder = StringUtil.newStringBuilder();
newStringBuilder.append("SELECT `progress`,`work_spec_id` FROM `WorkProgress` WHERE `work_spec_id` IN (");
int size2 = keySet.size();
StringUtil.appendPlaceholders(newStringBuilder, size2);
newStringBuilder.append(")");
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(newStringBuilder.toString(), size2 + 0);
int i3 = 1;
for (String str : keySet) {
if (str == null) {
acquire.bindNull(i3);
} else {
acquire.bindString(i3, str);
}
i3++;
}
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndex = CursorUtil.getColumnIndex(query, "work_spec_id");
if (columnIndex != -1) {
while (query.moveToNext()) {
if (!query.isNull(columnIndex) && (arrayList = arrayMap.get(query.getString(columnIndex))) != null) {
arrayList.add(Data.fromByteArray(query.getBlob(0)));
}
}
query.close();
}
} finally {
query.close();
}
}
}
private void __fetchRelationshipWorkTagAsjavaLangString(ArrayMap<String, ArrayList<String>> arrayMap) {
ArrayList<String> arrayList;
int i;
Set<String> keySet = arrayMap.keySet();
if (!keySet.isEmpty()) {
if (arrayMap.size() > 999) {
ArrayMap<String, ArrayList<String>> arrayMap2 = new ArrayMap<>((int) RoomDatabase.MAX_BIND_PARAMETER_CNT);
int size = arrayMap.size();
int i2 = 0;
loop0:
while (true) {
i = 0;
while (i2 < size) {
arrayMap2.put(arrayMap.keyAt(i2), arrayMap.valueAt(i2));
i2++;
i++;
if (i == 999) {
__fetchRelationshipWorkTagAsjavaLangString(arrayMap2);
arrayMap2 = new ArrayMap<>((int) RoomDatabase.MAX_BIND_PARAMETER_CNT);
}
}
break loop0;
}
if (i > 0) {
__fetchRelationshipWorkTagAsjavaLangString(arrayMap2);
return;
}
return;
}
StringBuilder newStringBuilder = StringUtil.newStringBuilder();
newStringBuilder.append("SELECT `tag`,`work_spec_id` FROM `WorkTag` WHERE `work_spec_id` IN (");
int size2 = keySet.size();
StringUtil.appendPlaceholders(newStringBuilder, size2);
newStringBuilder.append(")");
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(newStringBuilder.toString(), size2 + 0);
int i3 = 1;
for (String str : keySet) {
if (str == null) {
acquire.bindNull(i3);
} else {
acquire.bindString(i3, str);
}
i3++;
}
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndex = CursorUtil.getColumnIndex(query, "work_spec_id");
if (columnIndex != -1) {
while (query.moveToNext()) {
if (!query.isNull(columnIndex) && (arrayList = arrayMap.get(query.getString(columnIndex))) != null) {
arrayList.add(query.getString(0));
}
}
query.close();
}
} finally {
query.close();
}
}
}
public static /* synthetic */ RoomDatabase access$000(WorkSpecDao_Impl workSpecDao_Impl) {
return workSpecDao_Impl.__db;
}
public static /* synthetic */ void access$100(WorkSpecDao_Impl workSpecDao_Impl, ArrayMap arrayMap) {
workSpecDao_Impl.__fetchRelationshipWorkTagAsjavaLangString(arrayMap);
}
public static /* synthetic */ void access$200(WorkSpecDao_Impl workSpecDao_Impl, ArrayMap arrayMap) {
workSpecDao_Impl.__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap);
}
@Override // androidx.work.impl.model.WorkSpecDao
public void delete(String str) {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfDelete.acquire();
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.beginTransaction();
try {
acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
} finally {
this.__db.endTransaction();
this.__preparedStmtOfDelete.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec> getAllEligibleWorkSpecsForScheduling() {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT `required_network_type`, `requires_charging`, `requires_device_idle`, `requires_battery_not_low`, `requires_storage_not_low`, `trigger_content_update_delay`, `trigger_max_content_delay`, `content_uri_triggers`, `WorkSpec`.`id` AS `id`, `WorkSpec`.`state` AS `state`, `WorkSpec`.`worker_class_name` AS `worker_class_name`, `WorkSpec`.`input_merger_class_name` AS `input_merger_class_name`, `WorkSpec`.`input` AS `input`, `WorkSpec`.`output` AS `output`, `WorkSpec`.`initial_delay` AS `initial_delay`, `WorkSpec`.`interval_duration` AS `interval_duration`, `WorkSpec`.`flex_duration` AS `flex_duration`, `WorkSpec`.`run_attempt_count` AS `run_attempt_count`, `WorkSpec`.`backoff_policy` AS `backoff_policy`, `WorkSpec`.`backoff_delay_duration` AS `backoff_delay_duration`, `WorkSpec`.`period_start_time` AS `period_start_time`, `WorkSpec`.`minimum_retention_duration` AS `minimum_retention_duration`, `WorkSpec`.`schedule_requested_at` AS `schedule_requested_at`, `WorkSpec`.`run_in_foreground` AS `run_in_foreground` FROM workspec WHERE state=0 ORDER BY period_start_time", 0);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
int i = columnIndexOrThrow14;
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec = new WorkSpec(string, string2);
workSpec.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec.output = Data.fromByteArray(query.getBlob(i));
i = i;
workSpec.initialDelay = query.getLong(columnIndexOrThrow15);
workSpec.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
columnIndexOrThrow17 = columnIndexOrThrow17;
workSpec.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec.periodStartTime = query.getLong(columnIndexOrThrow21);
columnIndexOrThrow21 = columnIndexOrThrow21;
workSpec.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
workSpec.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec.constraints = constraints;
arrayList.add(workSpec);
columnIndexOrThrow23 = columnIndexOrThrow23;
columnIndexOrThrow24 = columnIndexOrThrow24;
columnIndexOrThrow2 = columnIndexOrThrow2;
columnIndexOrThrow13 = columnIndexOrThrow13;
columnIndexOrThrow15 = columnIndexOrThrow15;
columnIndexOrThrow16 = columnIndexOrThrow16;
columnIndexOrThrow18 = columnIndexOrThrow18;
columnIndexOrThrow9 = columnIndexOrThrow9;
columnIndexOrThrow11 = columnIndexOrThrow11;
columnIndexOrThrow = columnIndexOrThrow;
columnIndexOrThrow22 = columnIndexOrThrow22;
columnIndexOrThrow3 = columnIndexOrThrow3;
columnIndexOrThrow20 = columnIndexOrThrow20;
columnIndexOrThrow4 = columnIndexOrThrow4;
columnIndexOrThrow19 = columnIndexOrThrow19;
}
query.close();
roomSQLiteQuery.release();
return arrayList;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<String> getAllUnfinishedWork() {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id FROM workspec WHERE state NOT IN (2, 3, 5)", 0);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
arrayList.add(query.getString(0));
}
return arrayList;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<String> getAllWorkSpecIds() {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id FROM workspec", 0);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
arrayList.add(query.getString(0));
}
return arrayList;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec> getEligibleWorkForScheduling(int i) {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT `required_network_type`, `requires_charging`, `requires_device_idle`, `requires_battery_not_low`, `requires_storage_not_low`, `trigger_content_update_delay`, `trigger_max_content_delay`, `content_uri_triggers`, `WorkSpec`.`id` AS `id`, `WorkSpec`.`state` AS `state`, `WorkSpec`.`worker_class_name` AS `worker_class_name`, `WorkSpec`.`input_merger_class_name` AS `input_merger_class_name`, `WorkSpec`.`input` AS `input`, `WorkSpec`.`output` AS `output`, `WorkSpec`.`initial_delay` AS `initial_delay`, `WorkSpec`.`interval_duration` AS `interval_duration`, `WorkSpec`.`flex_duration` AS `flex_duration`, `WorkSpec`.`run_attempt_count` AS `run_attempt_count`, `WorkSpec`.`backoff_policy` AS `backoff_policy`, `WorkSpec`.`backoff_delay_duration` AS `backoff_delay_duration`, `WorkSpec`.`period_start_time` AS `period_start_time`, `WorkSpec`.`minimum_retention_duration` AS `minimum_retention_duration`, `WorkSpec`.`schedule_requested_at` AS `schedule_requested_at`, `WorkSpec`.`run_in_foreground` AS `run_in_foreground` FROM workspec WHERE state=0 AND schedule_requested_at=-1 ORDER BY period_start_time LIMIT (SELECT MAX(?-COUNT(*), 0) FROM workspec WHERE schedule_requested_at<>-1 AND state NOT IN (2, 3, 5))", 1);
acquire.bindLong(1, (long) i);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
int i2 = columnIndexOrThrow14;
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec = new WorkSpec(string, string2);
workSpec.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec.output = Data.fromByteArray(query.getBlob(i2));
i2 = i2;
workSpec.initialDelay = query.getLong(columnIndexOrThrow15);
workSpec.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
columnIndexOrThrow17 = columnIndexOrThrow17;
workSpec.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec.periodStartTime = query.getLong(columnIndexOrThrow21);
columnIndexOrThrow21 = columnIndexOrThrow21;
workSpec.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
workSpec.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec.constraints = constraints;
arrayList.add(workSpec);
columnIndexOrThrow23 = columnIndexOrThrow23;
columnIndexOrThrow24 = columnIndexOrThrow24;
columnIndexOrThrow2 = columnIndexOrThrow2;
columnIndexOrThrow12 = columnIndexOrThrow12;
columnIndexOrThrow15 = columnIndexOrThrow15;
columnIndexOrThrow16 = columnIndexOrThrow16;
columnIndexOrThrow18 = columnIndexOrThrow18;
columnIndexOrThrow9 = columnIndexOrThrow9;
columnIndexOrThrow11 = columnIndexOrThrow11;
columnIndexOrThrow = columnIndexOrThrow;
columnIndexOrThrow22 = columnIndexOrThrow22;
columnIndexOrThrow3 = columnIndexOrThrow3;
columnIndexOrThrow20 = columnIndexOrThrow20;
columnIndexOrThrow4 = columnIndexOrThrow4;
columnIndexOrThrow19 = columnIndexOrThrow19;
}
query.close();
roomSQLiteQuery.release();
return arrayList;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<Data> getInputsFromPrerequisites(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT output FROM workspec WHERE id IN (SELECT prerequisite_id FROM dependency WHERE work_spec_id=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
arrayList.add(Data.fromByteArray(query.getBlob(0)));
}
return arrayList;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec> getRecentlyCompletedWork(long j) {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT `required_network_type`, `requires_charging`, `requires_device_idle`, `requires_battery_not_low`, `requires_storage_not_low`, `trigger_content_update_delay`, `trigger_max_content_delay`, `content_uri_triggers`, `WorkSpec`.`id` AS `id`, `WorkSpec`.`state` AS `state`, `WorkSpec`.`worker_class_name` AS `worker_class_name`, `WorkSpec`.`input_merger_class_name` AS `input_merger_class_name`, `WorkSpec`.`input` AS `input`, `WorkSpec`.`output` AS `output`, `WorkSpec`.`initial_delay` AS `initial_delay`, `WorkSpec`.`interval_duration` AS `interval_duration`, `WorkSpec`.`flex_duration` AS `flex_duration`, `WorkSpec`.`run_attempt_count` AS `run_attempt_count`, `WorkSpec`.`backoff_policy` AS `backoff_policy`, `WorkSpec`.`backoff_delay_duration` AS `backoff_delay_duration`, `WorkSpec`.`period_start_time` AS `period_start_time`, `WorkSpec`.`minimum_retention_duration` AS `minimum_retention_duration`, `WorkSpec`.`schedule_requested_at` AS `schedule_requested_at`, `WorkSpec`.`run_in_foreground` AS `run_in_foreground` FROM workspec WHERE period_start_time >= ? AND state IN (2, 3, 5) ORDER BY period_start_time DESC", 1);
acquire.bindLong(1, j);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
int i = columnIndexOrThrow14;
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec = new WorkSpec(string, string2);
workSpec.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec.output = Data.fromByteArray(query.getBlob(i));
i = i;
workSpec.initialDelay = query.getLong(columnIndexOrThrow15);
workSpec.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
columnIndexOrThrow17 = columnIndexOrThrow17;
workSpec.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec.periodStartTime = query.getLong(columnIndexOrThrow21);
columnIndexOrThrow21 = columnIndexOrThrow21;
workSpec.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
workSpec.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec.constraints = constraints;
arrayList.add(workSpec);
columnIndexOrThrow2 = columnIndexOrThrow2;
columnIndexOrThrow23 = columnIndexOrThrow23;
columnIndexOrThrow24 = columnIndexOrThrow24;
columnIndexOrThrow12 = columnIndexOrThrow12;
columnIndexOrThrow15 = columnIndexOrThrow15;
columnIndexOrThrow16 = columnIndexOrThrow16;
columnIndexOrThrow18 = columnIndexOrThrow18;
columnIndexOrThrow9 = columnIndexOrThrow9;
columnIndexOrThrow11 = columnIndexOrThrow11;
columnIndexOrThrow = columnIndexOrThrow;
columnIndexOrThrow22 = columnIndexOrThrow22;
columnIndexOrThrow3 = columnIndexOrThrow3;
columnIndexOrThrow20 = columnIndexOrThrow20;
columnIndexOrThrow4 = columnIndexOrThrow4;
columnIndexOrThrow19 = columnIndexOrThrow19;
}
query.close();
roomSQLiteQuery.release();
return arrayList;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec> getRunningWork() {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT `required_network_type`, `requires_charging`, `requires_device_idle`, `requires_battery_not_low`, `requires_storage_not_low`, `trigger_content_update_delay`, `trigger_max_content_delay`, `content_uri_triggers`, `WorkSpec`.`id` AS `id`, `WorkSpec`.`state` AS `state`, `WorkSpec`.`worker_class_name` AS `worker_class_name`, `WorkSpec`.`input_merger_class_name` AS `input_merger_class_name`, `WorkSpec`.`input` AS `input`, `WorkSpec`.`output` AS `output`, `WorkSpec`.`initial_delay` AS `initial_delay`, `WorkSpec`.`interval_duration` AS `interval_duration`, `WorkSpec`.`flex_duration` AS `flex_duration`, `WorkSpec`.`run_attempt_count` AS `run_attempt_count`, `WorkSpec`.`backoff_policy` AS `backoff_policy`, `WorkSpec`.`backoff_delay_duration` AS `backoff_delay_duration`, `WorkSpec`.`period_start_time` AS `period_start_time`, `WorkSpec`.`minimum_retention_duration` AS `minimum_retention_duration`, `WorkSpec`.`schedule_requested_at` AS `schedule_requested_at`, `WorkSpec`.`run_in_foreground` AS `run_in_foreground` FROM workspec WHERE state=1", 0);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
int i = columnIndexOrThrow14;
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec = new WorkSpec(string, string2);
workSpec.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec.output = Data.fromByteArray(query.getBlob(i));
i = i;
workSpec.initialDelay = query.getLong(columnIndexOrThrow15);
workSpec.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
columnIndexOrThrow17 = columnIndexOrThrow17;
workSpec.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec.periodStartTime = query.getLong(columnIndexOrThrow21);
columnIndexOrThrow21 = columnIndexOrThrow21;
workSpec.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
workSpec.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec.constraints = constraints;
arrayList.add(workSpec);
columnIndexOrThrow23 = columnIndexOrThrow23;
columnIndexOrThrow24 = columnIndexOrThrow24;
columnIndexOrThrow2 = columnIndexOrThrow2;
columnIndexOrThrow13 = columnIndexOrThrow13;
columnIndexOrThrow15 = columnIndexOrThrow15;
columnIndexOrThrow16 = columnIndexOrThrow16;
columnIndexOrThrow18 = columnIndexOrThrow18;
columnIndexOrThrow9 = columnIndexOrThrow9;
columnIndexOrThrow11 = columnIndexOrThrow11;
columnIndexOrThrow = columnIndexOrThrow;
columnIndexOrThrow22 = columnIndexOrThrow22;
columnIndexOrThrow3 = columnIndexOrThrow3;
columnIndexOrThrow20 = columnIndexOrThrow20;
columnIndexOrThrow4 = columnIndexOrThrow4;
columnIndexOrThrow19 = columnIndexOrThrow19;
}
query.close();
roomSQLiteQuery.release();
return arrayList;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec> getScheduledWork() {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT `required_network_type`, `requires_charging`, `requires_device_idle`, `requires_battery_not_low`, `requires_storage_not_low`, `trigger_content_update_delay`, `trigger_max_content_delay`, `content_uri_triggers`, `WorkSpec`.`id` AS `id`, `WorkSpec`.`state` AS `state`, `WorkSpec`.`worker_class_name` AS `worker_class_name`, `WorkSpec`.`input_merger_class_name` AS `input_merger_class_name`, `WorkSpec`.`input` AS `input`, `WorkSpec`.`output` AS `output`, `WorkSpec`.`initial_delay` AS `initial_delay`, `WorkSpec`.`interval_duration` AS `interval_duration`, `WorkSpec`.`flex_duration` AS `flex_duration`, `WorkSpec`.`run_attempt_count` AS `run_attempt_count`, `WorkSpec`.`backoff_policy` AS `backoff_policy`, `WorkSpec`.`backoff_delay_duration` AS `backoff_delay_duration`, `WorkSpec`.`period_start_time` AS `period_start_time`, `WorkSpec`.`minimum_retention_duration` AS `minimum_retention_duration`, `WorkSpec`.`schedule_requested_at` AS `schedule_requested_at`, `WorkSpec`.`run_in_foreground` AS `run_in_foreground` FROM workspec WHERE state=0 AND schedule_requested_at<>-1", 0);
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
int i = columnIndexOrThrow14;
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec = new WorkSpec(string, string2);
workSpec.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec.output = Data.fromByteArray(query.getBlob(i));
i = i;
workSpec.initialDelay = query.getLong(columnIndexOrThrow15);
workSpec.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
columnIndexOrThrow17 = columnIndexOrThrow17;
workSpec.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec.periodStartTime = query.getLong(columnIndexOrThrow21);
columnIndexOrThrow21 = columnIndexOrThrow21;
workSpec.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
workSpec.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec.constraints = constraints;
arrayList.add(workSpec);
columnIndexOrThrow23 = columnIndexOrThrow23;
columnIndexOrThrow24 = columnIndexOrThrow24;
columnIndexOrThrow2 = columnIndexOrThrow2;
columnIndexOrThrow13 = columnIndexOrThrow13;
columnIndexOrThrow15 = columnIndexOrThrow15;
columnIndexOrThrow16 = columnIndexOrThrow16;
columnIndexOrThrow18 = columnIndexOrThrow18;
columnIndexOrThrow9 = columnIndexOrThrow9;
columnIndexOrThrow11 = columnIndexOrThrow11;
columnIndexOrThrow = columnIndexOrThrow;
columnIndexOrThrow22 = columnIndexOrThrow22;
columnIndexOrThrow3 = columnIndexOrThrow3;
columnIndexOrThrow20 = columnIndexOrThrow20;
columnIndexOrThrow4 = columnIndexOrThrow4;
columnIndexOrThrow19 = columnIndexOrThrow19;
}
query.close();
roomSQLiteQuery.release();
return arrayList;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public WorkInfo.State getState(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT state FROM workspec WHERE id=?", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
WorkInfo.State state = null;
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
if (query.moveToFirst()) {
state = WorkTypeConverters.intToState(query.getInt(0));
}
return state;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<String> getUnfinishedWorkWithName(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id FROM workspec WHERE state NOT IN (2, 3, 5) AND id IN (SELECT work_spec_id FROM workname WHERE name=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
arrayList.add(query.getString(0));
}
return arrayList;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<String> getUnfinishedWorkWithTag(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id FROM workspec WHERE state NOT IN (2, 3, 5) AND id IN (SELECT work_spec_id FROM worktag WHERE tag=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
arrayList.add(query.getString(0));
}
return arrayList;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public WorkSpec getWorkSpec(String str) {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
WorkSpec workSpec;
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT `required_network_type`, `requires_charging`, `requires_device_idle`, `requires_battery_not_low`, `requires_storage_not_low`, `trigger_content_update_delay`, `trigger_max_content_delay`, `content_uri_triggers`, `WorkSpec`.`id` AS `id`, `WorkSpec`.`state` AS `state`, `WorkSpec`.`worker_class_name` AS `worker_class_name`, `WorkSpec`.`input_merger_class_name` AS `input_merger_class_name`, `WorkSpec`.`input` AS `input`, `WorkSpec`.`output` AS `output`, `WorkSpec`.`initial_delay` AS `initial_delay`, `WorkSpec`.`interval_duration` AS `interval_duration`, `WorkSpec`.`flex_duration` AS `flex_duration`, `WorkSpec`.`run_attempt_count` AS `run_attempt_count`, `WorkSpec`.`backoff_policy` AS `backoff_policy`, `WorkSpec`.`backoff_delay_duration` AS `backoff_delay_duration`, `WorkSpec`.`period_start_time` AS `period_start_time`, `WorkSpec`.`minimum_retention_duration` AS `minimum_retention_duration`, `WorkSpec`.`schedule_requested_at` AS `schedule_requested_at`, `WorkSpec`.`run_in_foreground` AS `run_in_foreground` FROM workspec WHERE id=?", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
if (query.moveToFirst()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec2 = new WorkSpec(string, string2);
workSpec2.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec2.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec2.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec2.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow14));
workSpec2.initialDelay = query.getLong(columnIndexOrThrow15);
workSpec2.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec2.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec2.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec2.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
workSpec2.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec2.periodStartTime = query.getLong(columnIndexOrThrow21);
workSpec2.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
workSpec2.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec2.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec2.constraints = constraints;
workSpec = workSpec2;
} else {
workSpec = null;
}
query.close();
roomSQLiteQuery.release();
return workSpec;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec.IdAndState> getWorkSpecIdAndStatesForName(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id, state FROM workspec WHERE id IN (SELECT work_spec_id FROM workname WHERE name=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
WorkSpec.IdAndState idAndState = new WorkSpec.IdAndState();
idAndState.f30id = query.getString(columnIndexOrThrow);
idAndState.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
arrayList.add(idAndState);
}
return arrayList;
} finally {
query.close();
acquire.release();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public WorkSpec[] getWorkSpecs(List<String> list) {
RoomSQLiteQuery roomSQLiteQuery;
Throwable th;
StringBuilder newStringBuilder = StringUtil.newStringBuilder();
newStringBuilder.append("SELECT ");
newStringBuilder.append("*");
newStringBuilder.append(" FROM workspec WHERE id IN (");
int size = list.size();
StringUtil.appendPlaceholders(newStringBuilder, size);
newStringBuilder.append(")");
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(newStringBuilder.toString(), size + 0);
int i = 1;
for (String str : list) {
if (str == null) {
acquire.bindNull(i);
} else {
acquire.bindString(i, str);
}
i++;
}
this.__db.assertNotSuspendingTransaction();
Cursor query = DBUtil.query(this.__db, acquire, false, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, "required_network_type");
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "requires_charging");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "requires_device_idle");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "requires_battery_not_low");
int columnIndexOrThrow5 = CursorUtil.getColumnIndexOrThrow(query, "requires_storage_not_low");
int columnIndexOrThrow6 = CursorUtil.getColumnIndexOrThrow(query, "trigger_content_update_delay");
int columnIndexOrThrow7 = CursorUtil.getColumnIndexOrThrow(query, "trigger_max_content_delay");
int columnIndexOrThrow8 = CursorUtil.getColumnIndexOrThrow(query, "content_uri_triggers");
int columnIndexOrThrow9 = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow10 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow11 = CursorUtil.getColumnIndexOrThrow(query, "worker_class_name");
int columnIndexOrThrow12 = CursorUtil.getColumnIndexOrThrow(query, "input_merger_class_name");
int columnIndexOrThrow13 = CursorUtil.getColumnIndexOrThrow(query, "input");
int columnIndexOrThrow14 = CursorUtil.getColumnIndexOrThrow(query, "output");
roomSQLiteQuery = acquire;
try {
int columnIndexOrThrow15 = CursorUtil.getColumnIndexOrThrow(query, "initial_delay");
int columnIndexOrThrow16 = CursorUtil.getColumnIndexOrThrow(query, "interval_duration");
int columnIndexOrThrow17 = CursorUtil.getColumnIndexOrThrow(query, "flex_duration");
int columnIndexOrThrow18 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
int columnIndexOrThrow19 = CursorUtil.getColumnIndexOrThrow(query, "backoff_policy");
int columnIndexOrThrow20 = CursorUtil.getColumnIndexOrThrow(query, "backoff_delay_duration");
int columnIndexOrThrow21 = CursorUtil.getColumnIndexOrThrow(query, "period_start_time");
int columnIndexOrThrow22 = CursorUtil.getColumnIndexOrThrow(query, "minimum_retention_duration");
int columnIndexOrThrow23 = CursorUtil.getColumnIndexOrThrow(query, "schedule_requested_at");
int columnIndexOrThrow24 = CursorUtil.getColumnIndexOrThrow(query, "run_in_foreground");
WorkSpec[] workSpecArr = new WorkSpec[query.getCount()];
int i2 = 0;
while (query.moveToNext()) {
String string = query.getString(columnIndexOrThrow9);
String string2 = query.getString(columnIndexOrThrow11);
Constraints constraints = new Constraints();
constraints.setRequiredNetworkType(WorkTypeConverters.intToNetworkType(query.getInt(columnIndexOrThrow)));
constraints.setRequiresCharging(query.getInt(columnIndexOrThrow2) != 0);
constraints.setRequiresDeviceIdle(query.getInt(columnIndexOrThrow3) != 0);
constraints.setRequiresBatteryNotLow(query.getInt(columnIndexOrThrow4) != 0);
constraints.setRequiresStorageNotLow(query.getInt(columnIndexOrThrow5) != 0);
constraints.setTriggerContentUpdateDelay(query.getLong(columnIndexOrThrow6));
constraints.setTriggerMaxContentDelay(query.getLong(columnIndexOrThrow7));
constraints.setContentUriTriggers(WorkTypeConverters.byteArrayToContentUriTriggers(query.getBlob(columnIndexOrThrow8)));
WorkSpec workSpec = new WorkSpec(string, string2);
workSpec.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow10));
workSpec.inputMergerClassName = query.getString(columnIndexOrThrow12);
workSpec.input = Data.fromByteArray(query.getBlob(columnIndexOrThrow13));
workSpec.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow14));
workSpec.initialDelay = query.getLong(columnIndexOrThrow15);
columnIndexOrThrow15 = columnIndexOrThrow15;
workSpec.intervalDuration = query.getLong(columnIndexOrThrow16);
workSpec.flexDuration = query.getLong(columnIndexOrThrow17);
workSpec.runAttemptCount = query.getInt(columnIndexOrThrow18);
workSpec.backoffPolicy = WorkTypeConverters.intToBackoffPolicy(query.getInt(columnIndexOrThrow19));
columnIndexOrThrow17 = columnIndexOrThrow17;
workSpec.backoffDelayDuration = query.getLong(columnIndexOrThrow20);
workSpec.periodStartTime = query.getLong(columnIndexOrThrow21);
columnIndexOrThrow21 = columnIndexOrThrow21;
workSpec.minimumRetentionDuration = query.getLong(columnIndexOrThrow22);
columnIndexOrThrow22 = columnIndexOrThrow22;
workSpec.scheduleRequestedAt = query.getLong(columnIndexOrThrow23);
workSpec.runInForeground = query.getInt(columnIndexOrThrow24) != 0;
workSpec.constraints = constraints;
workSpecArr[i2] = workSpec;
i2++;
columnIndexOrThrow23 = columnIndexOrThrow23;
columnIndexOrThrow24 = columnIndexOrThrow24;
columnIndexOrThrow14 = columnIndexOrThrow14;
columnIndexOrThrow2 = columnIndexOrThrow2;
workSpecArr = workSpecArr;
columnIndexOrThrow9 = columnIndexOrThrow9;
columnIndexOrThrow11 = columnIndexOrThrow11;
columnIndexOrThrow3 = columnIndexOrThrow3;
columnIndexOrThrow = columnIndexOrThrow;
columnIndexOrThrow20 = columnIndexOrThrow20;
columnIndexOrThrow12 = columnIndexOrThrow12;
columnIndexOrThrow16 = columnIndexOrThrow16;
columnIndexOrThrow18 = columnIndexOrThrow18;
columnIndexOrThrow19 = columnIndexOrThrow19;
}
query.close();
roomSQLiteQuery.release();
return workSpecArr;
} catch (Throwable th2) {
th = th2;
query.close();
roomSQLiteQuery.release();
throw th;
}
} catch (Throwable th3) {
th = th3;
roomSQLiteQuery = acquire;
query.close();
roomSQLiteQuery.release();
throw th;
}
}
/* JADX INFO: finally extract failed */
@Override // androidx.work.impl.model.WorkSpecDao
public WorkSpec.WorkInfoPojo getWorkStatusPojoForId(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id, state, output, run_attempt_count FROM workspec WHERE id=?", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
this.__db.beginTransaction();
try {
WorkSpec.WorkInfoPojo workInfoPojo = null;
ArrayList<Data> arrayList = null;
Cursor query = DBUtil.query(this.__db, acquire, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap<String, ArrayList<String>> arrayMap = new ArrayMap<>();
ArrayMap<String, ArrayList<Data>> arrayMap2 = new ArrayMap<>();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList<>());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList<>());
}
}
}
query.moveToPosition(-1);
__fetchRelationshipWorkTagAsjavaLangString(arrayMap);
__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap2);
if (query.moveToFirst()) {
ArrayList<String> arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList<>();
}
if (!query.isNull(columnIndexOrThrow)) {
arrayList = arrayMap2.get(query.getString(columnIndexOrThrow));
}
if (arrayList == null) {
arrayList = new ArrayList<>();
}
WorkSpec.WorkInfoPojo workInfoPojo2 = new WorkSpec.WorkInfoPojo();
workInfoPojo2.f31id = query.getString(columnIndexOrThrow);
workInfoPojo2.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo2.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo2.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo2.tags = arrayList2;
workInfoPojo2.progress = arrayList;
workInfoPojo = workInfoPojo2;
}
this.__db.setTransactionSuccessful();
query.close();
acquire.release();
return workInfoPojo;
} catch (Throwable th) {
query.close();
acquire.release();
throw th;
}
} finally {
this.__db.endTransaction();
}
}
/* JADX INFO: finally extract failed */
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec.WorkInfoPojo> getWorkStatusPojoForIds(List<String> list) {
StringBuilder newStringBuilder = StringUtil.newStringBuilder();
newStringBuilder.append("SELECT id, state, output, run_attempt_count FROM workspec WHERE id IN (");
int size = list.size();
StringUtil.appendPlaceholders(newStringBuilder, size);
newStringBuilder.append(")");
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(newStringBuilder.toString(), size + 0);
int i = 1;
for (String str : list) {
if (str == null) {
acquire.bindNull(i);
} else {
acquire.bindString(i, str);
}
i++;
}
this.__db.assertNotSuspendingTransaction();
this.__db.beginTransaction();
try {
Cursor query = DBUtil.query(this.__db, acquire, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap<String, ArrayList<String>> arrayMap = new ArrayMap<>();
ArrayMap<String, ArrayList<Data>> arrayMap2 = new ArrayMap<>();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList<>());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList<>());
}
}
}
query.moveToPosition(-1);
__fetchRelationshipWorkTagAsjavaLangString(arrayMap);
__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap2);
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
ArrayList<String> arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList<>();
}
ArrayList<Data> arrayList3 = !query.isNull(columnIndexOrThrow) ? arrayMap2.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList3 == null) {
arrayList3 = new ArrayList<>();
}
WorkSpec.WorkInfoPojo workInfoPojo = new WorkSpec.WorkInfoPojo();
workInfoPojo.f31id = query.getString(columnIndexOrThrow);
workInfoPojo.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo.tags = arrayList2;
workInfoPojo.progress = arrayList3;
arrayList.add(workInfoPojo);
}
this.__db.setTransactionSuccessful();
query.close();
acquire.release();
return arrayList;
} catch (Throwable th) {
query.close();
acquire.release();
throw th;
}
} finally {
this.__db.endTransaction();
}
}
/* JADX INFO: finally extract failed */
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec.WorkInfoPojo> getWorkStatusPojoForName(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id, state, output, run_attempt_count FROM workspec WHERE id IN (SELECT work_spec_id FROM workname WHERE name=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
this.__db.beginTransaction();
try {
Cursor query = DBUtil.query(this.__db, acquire, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap<String, ArrayList<String>> arrayMap = new ArrayMap<>();
ArrayMap<String, ArrayList<Data>> arrayMap2 = new ArrayMap<>();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList<>());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList<>());
}
}
}
query.moveToPosition(-1);
__fetchRelationshipWorkTagAsjavaLangString(arrayMap);
__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap2);
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
ArrayList<String> arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList<>();
}
ArrayList<Data> arrayList3 = !query.isNull(columnIndexOrThrow) ? arrayMap2.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList3 == null) {
arrayList3 = new ArrayList<>();
}
WorkSpec.WorkInfoPojo workInfoPojo = new WorkSpec.WorkInfoPojo();
workInfoPojo.f31id = query.getString(columnIndexOrThrow);
workInfoPojo.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo.tags = arrayList2;
workInfoPojo.progress = arrayList3;
arrayList.add(workInfoPojo);
}
this.__db.setTransactionSuccessful();
query.close();
acquire.release();
return arrayList;
} catch (Throwable th) {
query.close();
acquire.release();
throw th;
}
} finally {
this.__db.endTransaction();
}
}
/* JADX INFO: finally extract failed */
@Override // androidx.work.impl.model.WorkSpecDao
public List<WorkSpec.WorkInfoPojo> getWorkStatusPojoForTag(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id, state, output, run_attempt_count FROM workspec WHERE id IN (SELECT work_spec_id FROM worktag WHERE tag=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.assertNotSuspendingTransaction();
this.__db.beginTransaction();
try {
Cursor query = DBUtil.query(this.__db, acquire, true, null);
try {
int columnIndexOrThrow = CursorUtil.getColumnIndexOrThrow(query, ModelAuditLogEntry.CHANGE_KEY_ID);
int columnIndexOrThrow2 = CursorUtil.getColumnIndexOrThrow(query, "state");
int columnIndexOrThrow3 = CursorUtil.getColumnIndexOrThrow(query, "output");
int columnIndexOrThrow4 = CursorUtil.getColumnIndexOrThrow(query, "run_attempt_count");
ArrayMap<String, ArrayList<String>> arrayMap = new ArrayMap<>();
ArrayMap<String, ArrayList<Data>> arrayMap2 = new ArrayMap<>();
while (query.moveToNext()) {
if (!query.isNull(columnIndexOrThrow)) {
String string = query.getString(columnIndexOrThrow);
if (arrayMap.get(string) == null) {
arrayMap.put(string, new ArrayList<>());
}
}
if (!query.isNull(columnIndexOrThrow)) {
String string2 = query.getString(columnIndexOrThrow);
if (arrayMap2.get(string2) == null) {
arrayMap2.put(string2, new ArrayList<>());
}
}
}
query.moveToPosition(-1);
__fetchRelationshipWorkTagAsjavaLangString(arrayMap);
__fetchRelationshipWorkProgressAsandroidxWorkData(arrayMap2);
ArrayList arrayList = new ArrayList(query.getCount());
while (query.moveToNext()) {
ArrayList<String> arrayList2 = !query.isNull(columnIndexOrThrow) ? arrayMap.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList2 == null) {
arrayList2 = new ArrayList<>();
}
ArrayList<Data> arrayList3 = !query.isNull(columnIndexOrThrow) ? arrayMap2.get(query.getString(columnIndexOrThrow)) : null;
if (arrayList3 == null) {
arrayList3 = new ArrayList<>();
}
WorkSpec.WorkInfoPojo workInfoPojo = new WorkSpec.WorkInfoPojo();
workInfoPojo.f31id = query.getString(columnIndexOrThrow);
workInfoPojo.state = WorkTypeConverters.intToState(query.getInt(columnIndexOrThrow2));
workInfoPojo.output = Data.fromByteArray(query.getBlob(columnIndexOrThrow3));
workInfoPojo.runAttemptCount = query.getInt(columnIndexOrThrow4);
workInfoPojo.tags = arrayList2;
workInfoPojo.progress = arrayList3;
arrayList.add(workInfoPojo);
}
this.__db.setTransactionSuccessful();
query.close();
acquire.release();
return arrayList;
} catch (Throwable th) {
query.close();
acquire.release();
throw th;
}
} finally {
this.__db.endTransaction();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public LiveData<List<WorkSpec.WorkInfoPojo>> getWorkStatusPojoLiveDataForIds(List<String> list) {
StringBuilder newStringBuilder = StringUtil.newStringBuilder();
newStringBuilder.append("SELECT id, state, output, run_attempt_count FROM workspec WHERE id IN (");
int size = list.size();
StringUtil.appendPlaceholders(newStringBuilder, size);
newStringBuilder.append(")");
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(newStringBuilder.toString(), size + 0);
int i = 1;
for (String str : list) {
if (str == null) {
acquire.bindNull(i);
} else {
acquire.bindString(i, str);
}
i++;
}
return this.__db.getInvalidationTracker().createLiveData(new String[]{"WorkTag", "WorkProgress", "workspec"}, true, new AnonymousClass10(acquire));
}
@Override // androidx.work.impl.model.WorkSpecDao
public LiveData<List<WorkSpec.WorkInfoPojo>> getWorkStatusPojoLiveDataForName(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id, state, output, run_attempt_count FROM workspec WHERE id IN (SELECT work_spec_id FROM workname WHERE name=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
return this.__db.getInvalidationTracker().createLiveData(new String[]{"WorkTag", "WorkProgress", "workspec", "workname"}, true, new AnonymousClass12(acquire));
}
@Override // androidx.work.impl.model.WorkSpecDao
public LiveData<List<WorkSpec.WorkInfoPojo>> getWorkStatusPojoLiveDataForTag(String str) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire("SELECT id, state, output, run_attempt_count FROM workspec WHERE id IN (SELECT work_spec_id FROM worktag WHERE tag=?)", 1);
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
return this.__db.getInvalidationTracker().createLiveData(new String[]{"WorkTag", "WorkProgress", "workspec", "worktag"}, true, new AnonymousClass11(acquire));
}
@Override // androidx.work.impl.model.WorkSpecDao
public int incrementWorkSpecRunAttemptCount(String str) {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfIncrementWorkSpecRunAttemptCount.acquire();
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.beginTransaction();
try {
int executeUpdateDelete = acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
return executeUpdateDelete;
} finally {
this.__db.endTransaction();
this.__preparedStmtOfIncrementWorkSpecRunAttemptCount.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public void insertWorkSpec(WorkSpec workSpec) {
this.__db.assertNotSuspendingTransaction();
this.__db.beginTransaction();
try {
this.__insertionAdapterOfWorkSpec.insert((EntityInsertionAdapter<WorkSpec>) workSpec);
this.__db.setTransactionSuccessful();
} finally {
this.__db.endTransaction();
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public int markWorkSpecScheduled(String str, long j) {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfMarkWorkSpecScheduled.acquire();
acquire.bindLong(1, j);
if (str == null) {
acquire.bindNull(2);
} else {
acquire.bindString(2, str);
}
this.__db.beginTransaction();
try {
int executeUpdateDelete = acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
return executeUpdateDelete;
} finally {
this.__db.endTransaction();
this.__preparedStmtOfMarkWorkSpecScheduled.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public void pruneFinishedWorkWithZeroDependentsIgnoringKeepForAtLeast() {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfPruneFinishedWorkWithZeroDependentsIgnoringKeepForAtLeast.acquire();
this.__db.beginTransaction();
try {
acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
} finally {
this.__db.endTransaction();
this.__preparedStmtOfPruneFinishedWorkWithZeroDependentsIgnoringKeepForAtLeast.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public int resetScheduledState() {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfResetScheduledState.acquire();
this.__db.beginTransaction();
try {
int executeUpdateDelete = acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
return executeUpdateDelete;
} finally {
this.__db.endTransaction();
this.__preparedStmtOfResetScheduledState.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public int resetWorkSpecRunAttemptCount(String str) {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfResetWorkSpecRunAttemptCount.acquire();
if (str == null) {
acquire.bindNull(1);
} else {
acquire.bindString(1, str);
}
this.__db.beginTransaction();
try {
int executeUpdateDelete = acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
return executeUpdateDelete;
} finally {
this.__db.endTransaction();
this.__preparedStmtOfResetWorkSpecRunAttemptCount.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public void setOutput(String str, Data data) {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfSetOutput.acquire();
byte[] byteArrayInternal = Data.toByteArrayInternal(data);
if (byteArrayInternal == null) {
acquire.bindNull(1);
} else {
acquire.bindBlob(1, byteArrayInternal);
}
if (str == null) {
acquire.bindNull(2);
} else {
acquire.bindString(2, str);
}
this.__db.beginTransaction();
try {
acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
} finally {
this.__db.endTransaction();
this.__preparedStmtOfSetOutput.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public void setPeriodStartTime(String str, long j) {
this.__db.assertNotSuspendingTransaction();
SupportSQLiteStatement acquire = this.__preparedStmtOfSetPeriodStartTime.acquire();
acquire.bindLong(1, j);
if (str == null) {
acquire.bindNull(2);
} else {
acquire.bindString(2, str);
}
this.__db.beginTransaction();
try {
acquire.executeUpdateDelete();
this.__db.setTransactionSuccessful();
} finally {
this.__db.endTransaction();
this.__preparedStmtOfSetPeriodStartTime.release(acquire);
}
}
@Override // androidx.work.impl.model.WorkSpecDao
public int setState(WorkInfo.State state, String... strArr) {
this.__db.assertNotSuspendingTransaction();
StringBuilder newStringBuilder = StringUtil.newStringBuilder();
newStringBuilder.append("UPDATE workspec SET state=");
newStringBuilder.append("?");
newStringBuilder.append(" WHERE id IN (");
StringUtil.appendPlaceholders(newStringBuilder, strArr.length);
newStringBuilder.append(")");
SupportSQLiteStatement compileStatement = this.__db.compileStatement(newStringBuilder.toString());
compileStatement.bindLong(1, (long) WorkTypeConverters.stateToInt(state));
int i = 2;
for (String str : strArr) {
if (str == null) {
compileStatement.bindNull(i);
} else {
compileStatement.bindString(i, str);
}
i++;
}
this.__db.beginTransaction();
try {
int executeUpdateDelete = compileStatement.executeUpdateDelete();
this.__db.setTransactionSuccessful();
return executeUpdateDelete;
} finally {
this.__db.endTransaction();
}
}
}