Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,486 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import androidx.room.AmbiguousColumnResolver;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.Set;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.IntIterator;
import kotlin.collections.SetsKt__SetsJVMKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.ranges.IntRange;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
@SourceDebugExtension({"SMAP\nAmbiguousColumnResolver.kt\nKotlin\n*S Kotlin\n*F\n+ 1 AmbiguousColumnResolver.kt\nandroidx/room/AmbiguousColumnResolver\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 4 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 5 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,253:1\n1#2:254\n13579#3,2:255\n13644#3,3:257\n13644#3,2:260\n11335#3:262\n11670#3,2:263\n11672#3:267\n13646#3:268\n1855#4,2:265\n1726#4,3:269\n1549#4:272\n1620#4,3:273\n1855#4,2:278\n37#5,2:276\n*S KotlinDebug\n*F\n+ 1 AmbiguousColumnResolver.kt\nandroidx/room/AmbiguousColumnResolver\n*L\n85#1:255,2\n87#1:257,3\n96#1:260,2\n118#1:262\n118#1:263,2\n118#1:267\n96#1:268\n120#1:265,2\n141#1:269,3\n151#1:272\n151#1:273,3\n188#1:278,2\n151#1:276,2\n*E\n"})
/* loaded from: classes.dex */
public final class AmbiguousColumnResolver {
public static final AmbiguousColumnResolver INSTANCE = new AmbiguousColumnResolver();
private AmbiguousColumnResolver() {
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v2, types: [T, androidx.room.AmbiguousColumnResolver$Solution] */
public static final int[][] resolve(String[] resultColumns, String[][] mappings) {
Set createSetBuilder;
Set build;
List createListBuilder;
List<ResultColumn> build2;
int[] intArray;
List createListBuilder2;
List build3;
Intrinsics.checkNotNullParameter(resultColumns, "resultColumns");
Intrinsics.checkNotNullParameter(mappings, "mappings");
int length = resultColumns.length;
int i = 0;
for (int i2 = 0; i2 < length; i2++) {
String str = resultColumns[i2];
if (str.charAt(0) == '`' && str.charAt(str.length() - 1) == '`') {
str = str.substring(1, str.length() - 1);
Intrinsics.checkNotNullExpressionValue(str, "this as java.lang.String…ing(startIndex, endIndex)");
}
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String lowerCase = str.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
resultColumns[i2] = lowerCase;
}
int length2 = mappings.length;
for (int i3 = 0; i3 < length2; i3++) {
int length3 = mappings[i3].length;
for (int i4 = 0; i4 < length3; i4++) {
String[] strArr = mappings[i3];
String str2 = strArr[i4];
Locale US2 = Locale.US;
Intrinsics.checkNotNullExpressionValue(US2, "US");
String lowerCase2 = str2.toLowerCase(US2);
Intrinsics.checkNotNullExpressionValue(lowerCase2, "this as java.lang.String).toLowerCase(locale)");
strArr[i4] = lowerCase2;
}
}
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
for (String[] strArr2 : mappings) {
CollectionsKt__MutableCollectionsKt.addAll(createSetBuilder, strArr2);
}
build = SetsKt__SetsJVMKt.build(createSetBuilder);
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
int length4 = resultColumns.length;
int i5 = 0;
int i6 = 0;
while (i5 < length4) {
String str3 = resultColumns[i5];
int i7 = i6 + 1;
if (build.contains(str3)) {
createListBuilder.add(new ResultColumn(str3, i6));
}
i5++;
i6 = i7;
}
build2 = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
int length5 = mappings.length;
final ArrayList arrayList = new ArrayList(length5);
for (int i8 = 0; i8 < length5; i8++) {
arrayList.add(new ArrayList());
}
int length6 = mappings.length;
int i9 = 0;
final int i10 = 0;
while (i9 < length6) {
final String[] strArr3 = mappings[i9];
int i11 = i10 + 1;
INSTANCE.rabinKarpSearch(build2, strArr3, new Function3() { // from class: androidx.room.AmbiguousColumnResolver$resolve$1$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(3);
}
@Override // kotlin.jvm.functions.Function3
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3) {
invoke(((Number) obj).intValue(), ((Number) obj2).intValue(), (List<AmbiguousColumnResolver.ResultColumn>) obj3);
return Unit.INSTANCE;
}
public final void invoke(int i12, int i13, List<AmbiguousColumnResolver.ResultColumn> resultColumnsSublist) {
Object obj;
Intrinsics.checkNotNullParameter(resultColumnsSublist, "resultColumnsSublist");
String[] strArr4 = strArr3;
ArrayList arrayList2 = new ArrayList(strArr4.length);
for (String str4 : strArr4) {
Iterator<T> it = resultColumnsSublist.iterator();
while (true) {
if (it.hasNext()) {
obj = it.next();
if (Intrinsics.areEqual(str4, ((AmbiguousColumnResolver.ResultColumn) obj).component1())) {
break;
}
} else {
obj = null;
break;
}
}
AmbiguousColumnResolver.ResultColumn resultColumn = (AmbiguousColumnResolver.ResultColumn) obj;
if (resultColumn == null) {
return;
}
arrayList2.add(Integer.valueOf(resultColumn.getIndex()));
}
arrayList.get(i10).add(new AmbiguousColumnResolver.Match(new IntRange(i12, i13 - 1), arrayList2));
}
});
if (((List) arrayList.get(i10)).isEmpty()) {
ArrayList arrayList2 = new ArrayList(strArr3.length);
int length7 = strArr3.length;
for (int i12 = i; i12 < length7; i12++) {
String str4 = strArr3[i12];
createListBuilder2 = CollectionsKt__CollectionsJVMKt.createListBuilder();
for (ResultColumn resultColumn : build2) {
if (Intrinsics.areEqual(str4, resultColumn.getName())) {
createListBuilder2.add(Integer.valueOf(resultColumn.getIndex()));
}
}
build3 = CollectionsKt__CollectionsJVMKt.build(createListBuilder2);
if (!(!build3.isEmpty())) {
throw new IllegalStateException(("Column " + str4 + " not found in result").toString());
}
arrayList2.add(build3);
}
dfs$default(INSTANCE, arrayList2, null, 0, new Function1() { // from class: androidx.room.AmbiguousColumnResolver$resolve$1$2
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((List<Integer>) obj);
return Unit.INSTANCE;
}
public final void invoke(List<Integer> indices) {
Intrinsics.checkNotNullParameter(indices, "indices");
List<Integer> list = indices;
Iterator<T> it = list.iterator();
if (!it.hasNext()) {
throw new NoSuchElementException();
}
int intValue = ((Number) it.next()).intValue();
while (it.hasNext()) {
int intValue2 = ((Number) it.next()).intValue();
if (intValue > intValue2) {
intValue = intValue2;
}
}
Iterator<T> it2 = list.iterator();
if (!it2.hasNext()) {
throw new NoSuchElementException();
}
int intValue3 = ((Number) it2.next()).intValue();
while (it2.hasNext()) {
int intValue4 = ((Number) it2.next()).intValue();
if (intValue3 < intValue4) {
intValue3 = intValue4;
}
}
arrayList.get(i10).add(new AmbiguousColumnResolver.Match(new IntRange(intValue, intValue3), indices));
}
}, 6, null);
}
i9++;
i10 = i11;
i = 0;
}
if (!arrayList.isEmpty()) {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
if (!(!((List) it.next()).isEmpty())) {
throw new IllegalStateException("Failed to find matches for all mappings".toString());
}
}
}
final Ref.ObjectRef objectRef = new Ref.ObjectRef();
objectRef.element = Solution.Companion.getNO_SOLUTION();
dfs$default(INSTANCE, arrayList, null, 0, new Function1() { // from class: androidx.room.AmbiguousColumnResolver$resolve$4
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((List<AmbiguousColumnResolver.Match>) obj);
return Unit.INSTANCE;
}
/* JADX WARN: Type inference failed for: r2v1, types: [T, androidx.room.AmbiguousColumnResolver$Solution] */
public final void invoke(List<AmbiguousColumnResolver.Match> it2) {
Intrinsics.checkNotNullParameter(it2, "it");
?? build4 = AmbiguousColumnResolver.Solution.Companion.build(it2);
if (build4.compareTo(objectRef.element) < 0) {
objectRef.element = build4;
}
}
}, 6, null);
List<Match> matches = ((Solution) objectRef.element).getMatches();
ArrayList arrayList3 = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(matches, 10));
Iterator<T> it2 = matches.iterator();
while (it2.hasNext()) {
intArray = CollectionsKt___CollectionsKt.toIntArray(((Match) it2.next()).getResultIndices());
arrayList3.add(intArray);
}
return (int[][]) arrayList3.toArray(new int[0][]);
}
private final void rabinKarpSearch(List<ResultColumn> list, String[] strArr, Function3 function3) {
int i = 0;
int i2 = 0;
for (String str : strArr) {
i2 += str.hashCode();
}
int length = strArr.length;
Iterator<T> it = list.subList(0, length).iterator();
int i3 = 0;
while (it.hasNext()) {
i3 += ((ResultColumn) it.next()).getName().hashCode();
}
while (true) {
if (i2 == i3) {
function3.invoke(Integer.valueOf(i), Integer.valueOf(length), list.subList(i, length));
}
int i4 = i + 1;
int i5 = length + 1;
if (i5 > list.size()) {
return;
}
i3 = (i3 - list.get(i).getName().hashCode()) + list.get(length).getName().hashCode();
i = i4;
length = i5;
}
}
public static /* synthetic */ void dfs$default(AmbiguousColumnResolver ambiguousColumnResolver, List list, List list2, int i, Function1 function1, int i2, Object obj) {
if ((i2 & 2) != 0) {
list2 = new ArrayList();
}
if ((i2 & 4) != 0) {
i = 0;
}
ambiguousColumnResolver.dfs(list, list2, i, function1);
}
private final <T> void dfs(List<? extends List<? extends T>> list, List<T> list2, int i, Function1 function1) {
if (i == list.size()) {
function1.invoke(CollectionsKt___CollectionsKt.toList(list2));
return;
}
Iterator<T> it = list.get(i).iterator();
while (it.hasNext()) {
list2.add(it.next());
INSTANCE.dfs(list, list2, i + 1, function1);
CollectionsKt__MutableCollectionsKt.removeLast(list2);
}
}
public static final class ResultColumn {
private final int index;
private final String name;
public static /* synthetic */ ResultColumn copy$default(ResultColumn resultColumn, String str, int i, int i2, Object obj) {
if ((i2 & 1) != 0) {
str = resultColumn.name;
}
if ((i2 & 2) != 0) {
i = resultColumn.index;
}
return resultColumn.copy(str, i);
}
public final String component1() {
return this.name;
}
public final int component2() {
return this.index;
}
public final ResultColumn copy(String name, int i) {
Intrinsics.checkNotNullParameter(name, "name");
return new ResultColumn(name, i);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ResultColumn)) {
return false;
}
ResultColumn resultColumn = (ResultColumn) obj;
return Intrinsics.areEqual(this.name, resultColumn.name) && this.index == resultColumn.index;
}
public final int getIndex() {
return this.index;
}
public final String getName() {
return this.name;
}
public int hashCode() {
return (this.name.hashCode() * 31) + Integer.hashCode(this.index);
}
public String toString() {
return "ResultColumn(name=" + this.name + ", index=" + this.index + ')';
}
public ResultColumn(String name, int i) {
Intrinsics.checkNotNullParameter(name, "name");
this.name = name;
this.index = i;
}
}
public static final class Match {
private final List<Integer> resultIndices;
private final IntRange resultRange;
public final List<Integer> getResultIndices() {
return this.resultIndices;
}
public final IntRange getResultRange() {
return this.resultRange;
}
public Match(IntRange resultRange, List<Integer> resultIndices) {
Intrinsics.checkNotNullParameter(resultRange, "resultRange");
Intrinsics.checkNotNullParameter(resultIndices, "resultIndices");
this.resultRange = resultRange;
this.resultIndices = resultIndices;
}
}
public static final class Solution implements Comparable<Solution> {
public static final Companion Companion = new Companion(null);
private static final Solution NO_SOLUTION = new Solution(CollectionsKt__CollectionsKt.emptyList(), Integer.MAX_VALUE, Integer.MAX_VALUE);
private final int coverageOffset;
private final List<Match> matches;
private final int overlaps;
public final int getCoverageOffset() {
return this.coverageOffset;
}
public final List<Match> getMatches() {
return this.matches;
}
public final int getOverlaps() {
return this.overlaps;
}
public Solution(List<Match> matches, int i, int i2) {
Intrinsics.checkNotNullParameter(matches, "matches");
this.matches = matches;
this.coverageOffset = i;
this.overlaps = i2;
}
@Override // java.lang.Comparable
public int compareTo(Solution other) {
Intrinsics.checkNotNullParameter(other, "other");
int compare = Intrinsics.compare(this.overlaps, other.overlaps);
return compare != 0 ? compare : Intrinsics.compare(this.coverageOffset, other.coverageOffset);
}
@SourceDebugExtension({"SMAP\nAmbiguousColumnResolver.kt\nKotlin\n*S Kotlin\n*F\n+ 1 AmbiguousColumnResolver.kt\nandroidx/room/AmbiguousColumnResolver$Solution$Companion\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,253:1\n1#2:254\n1774#3,3:255\n1855#3,2:258\n1777#3:260\n*S KotlinDebug\n*F\n+ 1 AmbiguousColumnResolver.kt\nandroidx/room/AmbiguousColumnResolver$Solution$Companion\n*L\n232#1:255,3\n234#1:258,2\n232#1:260\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Solution getNO_SOLUTION() {
return Solution.NO_SOLUTION;
}
public final Solution build(List<Match> matches) {
Intrinsics.checkNotNullParameter(matches, "matches");
List<Match> list = matches;
int i = 0;
int i2 = 0;
for (Match match : list) {
i2 += ((match.getResultRange().getLast() - match.getResultRange().getFirst()) + 1) - match.getResultIndices().size();
}
Iterator<T> it = list.iterator();
if (!it.hasNext()) {
throw new NoSuchElementException();
}
int first = ((Match) it.next()).getResultRange().getFirst();
while (it.hasNext()) {
int first2 = ((Match) it.next()).getResultRange().getFirst();
if (first > first2) {
first = first2;
}
}
Iterator<T> it2 = list.iterator();
if (!it2.hasNext()) {
throw new NoSuchElementException();
}
int last = ((Match) it2.next()).getResultRange().getLast();
while (it2.hasNext()) {
int last2 = ((Match) it2.next()).getResultRange().getLast();
if (last < last2) {
last = last2;
}
}
Iterable intRange = new IntRange(first, last);
if (!(intRange instanceof Collection) || !((Collection) intRange).isEmpty()) {
Iterator it3 = intRange.iterator();
int i3 = 0;
while (it3.hasNext()) {
int nextInt = ((IntIterator) it3).nextInt();
Iterator<T> it4 = list.iterator();
int i4 = 0;
while (true) {
if (!it4.hasNext()) {
break;
}
if (((Match) it4.next()).getResultRange().contains(nextInt)) {
i4++;
}
if (i4 > 1) {
i3++;
if (i3 < 0) {
CollectionsKt__CollectionsKt.throwCountOverflow();
}
}
}
}
i = i3;
}
return new Solution(matches, i2, i);
}
}
}
}

View File

@@ -0,0 +1,247 @@
package androidx.room;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import androidx.annotation.GuardedBy;
import androidx.annotation.VisibleForTesting;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.io.IOException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nAutoCloser.kt\nKotlin\n*S Kotlin\n*F\n+ 1 AutoCloser.kt\nandroidx/room/AutoCloser\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,228:1\n1#2:229\n*E\n"})
/* loaded from: classes.dex */
public final class AutoCloser {
public static final Companion Companion = new Companion(null);
public static final String autoCloseBug = "https://issuetracker.google.com/issues/new?component=413107&template=1096568";
private long autoCloseTimeoutInMs;
private final Runnable autoCloser;
@GuardedBy("lock")
private SupportSQLiteDatabase delegateDatabase;
public SupportSQLiteOpenHelper delegateOpenHelper;
private final Runnable executeAutoCloser;
private final Executor executor;
private final Handler handler;
@GuardedBy("lock")
private long lastDecrementRefCountTimeStamp;
private final Object lock;
private boolean manuallyClosed;
private Runnable onAutoCloseCallback;
@GuardedBy("lock")
private int refCount;
public final SupportSQLiteDatabase getDelegateDatabase$room_runtime_release() {
return this.delegateDatabase;
}
public final long getLastDecrementRefCountTimeStamp$room_runtime_release() {
return this.lastDecrementRefCountTimeStamp;
}
public final Runnable getOnAutoCloseCallback$room_runtime_release() {
return this.onAutoCloseCallback;
}
public final int getRefCount$room_runtime_release() {
return this.refCount;
}
public final boolean isActive() {
return !this.manuallyClosed;
}
public final void setAutoCloseCallback(Runnable onAutoClose) {
Intrinsics.checkNotNullParameter(onAutoClose, "onAutoClose");
this.onAutoCloseCallback = onAutoClose;
}
public final void setDelegateDatabase$room_runtime_release(SupportSQLiteDatabase supportSQLiteDatabase) {
this.delegateDatabase = supportSQLiteDatabase;
}
public final void setDelegateOpenHelper(SupportSQLiteOpenHelper supportSQLiteOpenHelper) {
Intrinsics.checkNotNullParameter(supportSQLiteOpenHelper, "<set-?>");
this.delegateOpenHelper = supportSQLiteOpenHelper;
}
public final void setLastDecrementRefCountTimeStamp$room_runtime_release(long j) {
this.lastDecrementRefCountTimeStamp = j;
}
public final void setOnAutoCloseCallback$room_runtime_release(Runnable runnable) {
this.onAutoCloseCallback = runnable;
}
public final void setRefCount$room_runtime_release(int i) {
this.refCount = i;
}
public AutoCloser(long j, TimeUnit autoCloseTimeUnit, Executor autoCloseExecutor) {
Intrinsics.checkNotNullParameter(autoCloseTimeUnit, "autoCloseTimeUnit");
Intrinsics.checkNotNullParameter(autoCloseExecutor, "autoCloseExecutor");
this.handler = new Handler(Looper.getMainLooper());
this.lock = new Object();
this.autoCloseTimeoutInMs = autoCloseTimeUnit.toMillis(j);
this.executor = autoCloseExecutor;
this.lastDecrementRefCountTimeStamp = SystemClock.uptimeMillis();
this.executeAutoCloser = new Runnable() { // from class: androidx.room.AutoCloser$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
AutoCloser.executeAutoCloser$lambda$0(AutoCloser.this);
}
};
this.autoCloser = new Runnable() { // from class: androidx.room.AutoCloser$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
AutoCloser.autoCloser$lambda$3(AutoCloser.this);
}
};
}
public final SupportSQLiteOpenHelper getDelegateOpenHelper() {
SupportSQLiteOpenHelper supportSQLiteOpenHelper = this.delegateOpenHelper;
if (supportSQLiteOpenHelper != null) {
return supportSQLiteOpenHelper;
}
Intrinsics.throwUninitializedPropertyAccessException("delegateOpenHelper");
return null;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void executeAutoCloser$lambda$0(AutoCloser this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.executor.execute(this$0.autoCloser);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void autoCloser$lambda$3(AutoCloser this$0) {
Unit unit;
Intrinsics.checkNotNullParameter(this$0, "this$0");
synchronized (this$0.lock) {
try {
if (SystemClock.uptimeMillis() - this$0.lastDecrementRefCountTimeStamp < this$0.autoCloseTimeoutInMs) {
return;
}
if (this$0.refCount != 0) {
return;
}
Runnable runnable = this$0.onAutoCloseCallback;
if (runnable != null) {
runnable.run();
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
throw new IllegalStateException("onAutoCloseCallback is null but it should have been set before use. Please file a bug against Room at: https://issuetracker.google.com/issues/new?component=413107&template=1096568".toString());
}
SupportSQLiteDatabase supportSQLiteDatabase = this$0.delegateDatabase;
if (supportSQLiteDatabase != null && supportSQLiteDatabase.isOpen()) {
supportSQLiteDatabase.close();
}
this$0.delegateDatabase = null;
Unit unit2 = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public final void init(SupportSQLiteOpenHelper delegateOpenHelper) {
Intrinsics.checkNotNullParameter(delegateOpenHelper, "delegateOpenHelper");
setDelegateOpenHelper(delegateOpenHelper);
}
public final <V> V executeRefCountingFunction(Function1 block) {
Intrinsics.checkNotNullParameter(block, "block");
try {
return (V) block.invoke(incrementCountAndEnsureDbIsOpen());
} finally {
decrementCountAndScheduleClose();
}
}
public final SupportSQLiteDatabase incrementCountAndEnsureDbIsOpen() {
synchronized (this.lock) {
this.handler.removeCallbacks(this.executeAutoCloser);
this.refCount++;
if (!(!this.manuallyClosed)) {
throw new IllegalStateException("Attempting to open already closed database.".toString());
}
SupportSQLiteDatabase supportSQLiteDatabase = this.delegateDatabase;
if (supportSQLiteDatabase != null && supportSQLiteDatabase.isOpen()) {
return supportSQLiteDatabase;
}
SupportSQLiteDatabase writableDatabase = getDelegateOpenHelper().getWritableDatabase();
this.delegateDatabase = writableDatabase;
return writableDatabase;
}
}
public final void decrementCountAndScheduleClose() {
synchronized (this.lock) {
try {
int i = this.refCount;
if (i <= 0) {
throw new IllegalStateException("ref count is 0 or lower but we're supposed to decrement".toString());
}
int i2 = i - 1;
this.refCount = i2;
if (i2 == 0) {
if (this.delegateDatabase == null) {
return;
} else {
this.handler.postDelayed(this.executeAutoCloser, this.autoCloseTimeoutInMs);
}
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public final void closeDatabaseIfOpen() throws IOException {
synchronized (this.lock) {
try {
this.manuallyClosed = true;
SupportSQLiteDatabase supportSQLiteDatabase = this.delegateDatabase;
if (supportSQLiteDatabase != null) {
supportSQLiteDatabase.close();
}
this.delegateDatabase = null;
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
@VisibleForTesting
public final int getRefCountForTest$room_runtime_release() {
int i;
synchronized (this.lock) {
i = this.refCount;
}
return i;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,21 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public /* synthetic */ class AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$inTransaction$1 extends FunctionReferenceImpl implements Function1 {
public static final AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$inTransaction$1 INSTANCE = new AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$inTransaction$1();
public AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$inTransaction$1() {
super(1, SupportSQLiteDatabase.class, "inTransaction", "inTransaction()Z", 0);
}
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase p0) {
Intrinsics.checkNotNullParameter(p0, "p0");
return Boolean.valueOf(p0.inTransaction());
}
}

View File

@@ -0,0 +1,21 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public /* synthetic */ class AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$1 extends FunctionReferenceImpl implements Function1 {
public static final AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$1 INSTANCE = new AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$1();
public AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$1() {
super(1, SupportSQLiteDatabase.class, "yieldIfContendedSafely", "yieldIfContendedSafely()Z", 0);
}
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase p0) {
Intrinsics.checkNotNullParameter(p0, "p0");
return Boolean.valueOf(p0.yieldIfContendedSafely());
}
}

View File

@@ -0,0 +1,21 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public /* synthetic */ class AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$2 extends FunctionReferenceImpl implements Function1 {
public static final AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$2 INSTANCE = new AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$2();
public AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$2() {
super(1, SupportSQLiteDatabase.class, "yieldIfContendedSafely", "yieldIfContendedSafely()Z", 0);
}
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase p0) {
Intrinsics.checkNotNullParameter(p0, "p0");
return Boolean.valueOf(p0.yieldIfContendedSafely());
}
}

View File

@@ -0,0 +1,990 @@
package androidx.room;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.CharArrayBuffer;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.DataSetObserver;
import android.database.SQLException;
import android.database.sqlite.SQLiteTransactionListener;
import android.net.Uri;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.util.Pair;
import androidx.annotation.RequiresApi;
import androidx.room.AutoClosingRoomOpenHelper;
import androidx.sqlite.db.SupportSQLiteCompat;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import androidx.sqlite.db.SupportSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.MutablePropertyReference1Impl;
import kotlin.jvm.internal.PropertyReference1Impl;
import kotlin.jvm.internal.SourceDebugExtension;
/* loaded from: classes.dex */
public final class AutoClosingRoomOpenHelper implements SupportSQLiteOpenHelper, DelegatingOpenHelper {
public final AutoCloser autoCloser;
private final AutoClosingSupportSQLiteDatabase autoClosingDb;
private final SupportSQLiteOpenHelper delegate;
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public String getDatabaseName() {
return this.delegate.getDatabaseName();
}
@Override // androidx.room.DelegatingOpenHelper
public SupportSQLiteOpenHelper getDelegate() {
return this.delegate;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
@RequiresApi(api = 16)
public void setWriteAheadLoggingEnabled(boolean z) {
this.delegate.setWriteAheadLoggingEnabled(z);
}
public AutoClosingRoomOpenHelper(SupportSQLiteOpenHelper delegate, AutoCloser autoCloser) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(autoCloser, "autoCloser");
this.delegate = delegate;
this.autoCloser = autoCloser;
autoCloser.init(getDelegate());
this.autoClosingDb = new AutoClosingSupportSQLiteDatabase(autoCloser);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
@RequiresApi(api = 24)
public SupportSQLiteDatabase getWritableDatabase() {
this.autoClosingDb.pokeOpen();
return this.autoClosingDb;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
@RequiresApi(api = 24)
public SupportSQLiteDatabase getReadableDatabase() {
this.autoClosingDb.pokeOpen();
return this.autoClosingDb;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper, java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.autoClosingDb.close();
}
public static final class AutoClosingSupportSQLiteDatabase implements SupportSQLiteDatabase {
private final AutoCloser autoCloser;
public AutoClosingSupportSQLiteDatabase(AutoCloser autoCloser) {
Intrinsics.checkNotNullParameter(autoCloser, "autoCloser");
this.autoCloser = autoCloser;
}
public final void pokeOpen() {
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$pokeOpen$1
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase it) {
Intrinsics.checkNotNullParameter(it, "it");
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public SupportSQLiteStatement compileStatement(String sql) {
Intrinsics.checkNotNullParameter(sql, "sql");
return new AutoClosingSupportSqliteStatement(sql, this.autoCloser);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransaction() {
try {
this.autoCloser.incrementCountAndEnsureDbIsOpen().beginTransaction();
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionNonExclusive() {
try {
this.autoCloser.incrementCountAndEnsureDbIsOpen().beginTransactionNonExclusive();
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionWithListener(SQLiteTransactionListener transactionListener) {
Intrinsics.checkNotNullParameter(transactionListener, "transactionListener");
try {
this.autoCloser.incrementCountAndEnsureDbIsOpen().beginTransactionWithListener(transactionListener);
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionWithListenerNonExclusive(SQLiteTransactionListener transactionListener) {
Intrinsics.checkNotNullParameter(transactionListener, "transactionListener");
try {
this.autoCloser.incrementCountAndEnsureDbIsOpen().beginTransactionWithListenerNonExclusive(transactionListener);
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void endTransaction() {
if (this.autoCloser.getDelegateDatabase$room_runtime_release() == null) {
throw new IllegalStateException("End transaction called but delegateDb is null".toString());
}
try {
SupportSQLiteDatabase delegateDatabase$room_runtime_release = this.autoCloser.getDelegateDatabase$room_runtime_release();
Intrinsics.checkNotNull(delegateDatabase$room_runtime_release);
delegateDatabase$room_runtime_release.endTransaction();
} finally {
this.autoCloser.decrementCountAndScheduleClose();
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setTransactionSuccessful() {
Unit unit;
SupportSQLiteDatabase delegateDatabase$room_runtime_release = this.autoCloser.getDelegateDatabase$room_runtime_release();
if (delegateDatabase$room_runtime_release != null) {
delegateDatabase$room_runtime_release.setTransactionSuccessful();
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
throw new IllegalStateException("setTransactionSuccessful called but delegateDb is null".toString());
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean inTransaction() {
if (this.autoCloser.getDelegateDatabase$room_runtime_release() == null) {
return false;
}
return ((Boolean) this.autoCloser.executeRefCountingFunction(AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$inTransaction$1.INSTANCE)).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isDbLockedByCurrentThread() {
if (this.autoCloser.getDelegateDatabase$room_runtime_release() == null) {
return false;
}
return ((Boolean) this.autoCloser.executeRefCountingFunction(new PropertyReference1Impl() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$isDbLockedByCurrentThread$1
@Override // kotlin.jvm.internal.PropertyReference1Impl, kotlin.jvm.internal.PropertyReference1
public Object get(Object obj) {
return Boolean.valueOf(((SupportSQLiteDatabase) obj).isDbLockedByCurrentThread());
}
})).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean yieldIfContendedSafely() {
return ((Boolean) this.autoCloser.executeRefCountingFunction(AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$1.INSTANCE)).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean yieldIfContendedSafely(long j) {
return ((Boolean) this.autoCloser.executeRefCountingFunction(AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$yieldIfContendedSafely$2.INSTANCE)).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int getVersion() {
return ((Number) this.autoCloser.executeRefCountingFunction(new MutablePropertyReference1Impl() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$version$1
@Override // kotlin.jvm.internal.MutablePropertyReference1Impl, kotlin.jvm.internal.MutablePropertyReference1
public Object get(Object obj) {
return Integer.valueOf(((SupportSQLiteDatabase) obj).getVersion());
}
@Override // kotlin.jvm.internal.MutablePropertyReference1Impl, kotlin.jvm.internal.MutablePropertyReference1
public void set(Object obj, Object obj2) {
((SupportSQLiteDatabase) obj).setVersion(((Number) obj2).intValue());
}
})).intValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setVersion(final int i) {
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$version$2
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.setVersion(i);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long getMaximumSize() {
return ((Number) this.autoCloser.executeRefCountingFunction(new PropertyReference1Impl() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$maximumSize$1
@Override // kotlin.jvm.internal.PropertyReference1Impl, kotlin.jvm.internal.PropertyReference1
public Object get(Object obj) {
return Long.valueOf(((SupportSQLiteDatabase) obj).getMaximumSize());
}
})).longValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long setMaximumSize(final long j) {
return ((Number) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$setMaximumSize$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Long invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
return Long.valueOf(db.setMaximumSize(j));
}
})).longValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long getPageSize() {
return ((Number) this.autoCloser.executeRefCountingFunction(new MutablePropertyReference1Impl() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$pageSize$1
@Override // kotlin.jvm.internal.MutablePropertyReference1Impl, kotlin.jvm.internal.MutablePropertyReference1
public Object get(Object obj) {
return Long.valueOf(((SupportSQLiteDatabase) obj).getPageSize());
}
@Override // kotlin.jvm.internal.MutablePropertyReference1Impl, kotlin.jvm.internal.MutablePropertyReference1
public void set(Object obj, Object obj2) {
((SupportSQLiteDatabase) obj).setPageSize(((Number) obj2).longValue());
}
})).longValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setPageSize(final long j) {
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$pageSize$2
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.setPageSize(j);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(String query) {
Intrinsics.checkNotNullParameter(query, "query");
try {
return new KeepAliveCursor(this.autoCloser.incrementCountAndEnsureDbIsOpen().query(query), this.autoCloser);
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(String query, Object[] bindArgs) {
Intrinsics.checkNotNullParameter(query, "query");
Intrinsics.checkNotNullParameter(bindArgs, "bindArgs");
try {
return new KeepAliveCursor(this.autoCloser.incrementCountAndEnsureDbIsOpen().query(query, bindArgs), this.autoCloser);
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(SupportSQLiteQuery query) {
Intrinsics.checkNotNullParameter(query, "query");
try {
return new KeepAliveCursor(this.autoCloser.incrementCountAndEnsureDbIsOpen().query(query), this.autoCloser);
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 24)
public Cursor query(SupportSQLiteQuery query, CancellationSignal cancellationSignal) {
Intrinsics.checkNotNullParameter(query, "query");
try {
return new KeepAliveCursor(this.autoCloser.incrementCountAndEnsureDbIsOpen().query(query, cancellationSignal), this.autoCloser);
} catch (Throwable th) {
this.autoCloser.decrementCountAndScheduleClose();
throw th;
}
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long insert(final String table, final int i, final ContentValues values) throws SQLException {
Intrinsics.checkNotNullParameter(table, "table");
Intrinsics.checkNotNullParameter(values, "values");
return ((Number) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$insert$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Long invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
return Long.valueOf(db.insert(table, i, values));
}
})).longValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int delete(final String table, final String str, final Object[] objArr) {
Intrinsics.checkNotNullParameter(table, "table");
return ((Number) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$delete$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Integer invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
return Integer.valueOf(db.delete(table, str, objArr));
}
})).intValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int update(final String table, final int i, final ContentValues values, final String str, final Object[] objArr) {
Intrinsics.checkNotNullParameter(table, "table");
Intrinsics.checkNotNullParameter(values, "values");
return ((Number) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$update$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Integer invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
return Integer.valueOf(db.update(table, i, values, str, objArr));
}
})).intValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execSQL(final String sql) throws SQLException {
Intrinsics.checkNotNullParameter(sql, "sql");
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$execSQL$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL(sql);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execSQL(final String sql, final Object[] bindArgs) throws SQLException {
Intrinsics.checkNotNullParameter(sql, "sql");
Intrinsics.checkNotNullParameter(bindArgs, "bindArgs");
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$execSQL$2
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL(sql, bindArgs);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isReadOnly() {
return ((Boolean) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$isReadOnly$1
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return Boolean.valueOf(obj.isReadOnly());
}
})).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isOpen() {
SupportSQLiteDatabase delegateDatabase$room_runtime_release = this.autoCloser.getDelegateDatabase$room_runtime_release();
if (delegateDatabase$room_runtime_release == null) {
return false;
}
return delegateDatabase$room_runtime_release.isOpen();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean needUpgrade(final int i) {
return ((Boolean) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$needUpgrade$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
return Boolean.valueOf(db.needUpgrade(i));
}
})).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public String getPath() {
return (String) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$path$1
@Override // kotlin.jvm.functions.Function1
public final String invoke(SupportSQLiteDatabase obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return obj.getPath();
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setLocale(final Locale locale) {
Intrinsics.checkNotNullParameter(locale, "locale");
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$setLocale$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.setLocale(locale);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setMaxSqlCacheSize(final int i) {
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$setMaxSqlCacheSize$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.setMaxSqlCacheSize(i);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public void setForeignKeyConstraintsEnabled(final boolean z) {
this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$setForeignKeyConstraintsEnabled$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.setForeignKeyConstraintsEnabled(z);
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean enableWriteAheadLogging() {
throw new UnsupportedOperationException("Enable/disable write ahead logging on the OpenHelper instead of on the database directly.");
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void disableWriteAheadLogging() {
throw new UnsupportedOperationException("Enable/disable write ahead logging on the OpenHelper instead of on the database directly.");
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public boolean isWriteAheadLoggingEnabled() {
return ((Boolean) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$isWriteAheadLoggingEnabled$1
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
return Boolean.valueOf(db.isWriteAheadLoggingEnabled());
}
})).booleanValue();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public List<Pair<String, String>> getAttachedDbs() {
return (List) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$attachedDbs$1
@Override // kotlin.jvm.functions.Function1
public final List<Pair<String, String>> invoke(SupportSQLiteDatabase obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return obj.getAttachedDbs();
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isDatabaseIntegrityOk() {
return ((Boolean) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSQLiteDatabase$isDatabaseIntegrityOk$1
@Override // kotlin.jvm.functions.Function1
public final Boolean invoke(SupportSQLiteDatabase obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return Boolean.valueOf(obj.isDatabaseIntegrityOk());
}
})).booleanValue();
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
this.autoCloser.closeDatabaseIfOpen();
}
}
public static final class KeepAliveCursor implements Cursor {
private final AutoCloser autoCloser;
private final Cursor delegate;
@Override // android.database.Cursor
public void copyStringToBuffer(int i, CharArrayBuffer charArrayBuffer) {
this.delegate.copyStringToBuffer(i, charArrayBuffer);
}
@Override // android.database.Cursor
public void deactivate() {
this.delegate.deactivate();
}
@Override // android.database.Cursor
public byte[] getBlob(int i) {
return this.delegate.getBlob(i);
}
@Override // android.database.Cursor
public int getColumnCount() {
return this.delegate.getColumnCount();
}
@Override // android.database.Cursor
public int getColumnIndex(String str) {
return this.delegate.getColumnIndex(str);
}
@Override // android.database.Cursor
public int getColumnIndexOrThrow(String str) {
return this.delegate.getColumnIndexOrThrow(str);
}
@Override // android.database.Cursor
public String getColumnName(int i) {
return this.delegate.getColumnName(i);
}
@Override // android.database.Cursor
public String[] getColumnNames() {
return this.delegate.getColumnNames();
}
@Override // android.database.Cursor
public int getCount() {
return this.delegate.getCount();
}
@Override // android.database.Cursor
public double getDouble(int i) {
return this.delegate.getDouble(i);
}
@Override // android.database.Cursor
public Bundle getExtras() {
return this.delegate.getExtras();
}
@Override // android.database.Cursor
public float getFloat(int i) {
return this.delegate.getFloat(i);
}
@Override // android.database.Cursor
public int getInt(int i) {
return this.delegate.getInt(i);
}
@Override // android.database.Cursor
public long getLong(int i) {
return this.delegate.getLong(i);
}
@Override // android.database.Cursor
public int getPosition() {
return this.delegate.getPosition();
}
@Override // android.database.Cursor
public short getShort(int i) {
return this.delegate.getShort(i);
}
@Override // android.database.Cursor
public String getString(int i) {
return this.delegate.getString(i);
}
@Override // android.database.Cursor
public int getType(int i) {
return this.delegate.getType(i);
}
@Override // android.database.Cursor
public boolean getWantsAllOnMoveCalls() {
return this.delegate.getWantsAllOnMoveCalls();
}
@Override // android.database.Cursor
public boolean isAfterLast() {
return this.delegate.isAfterLast();
}
@Override // android.database.Cursor
public boolean isBeforeFirst() {
return this.delegate.isBeforeFirst();
}
@Override // android.database.Cursor
public boolean isClosed() {
return this.delegate.isClosed();
}
@Override // android.database.Cursor
public boolean isFirst() {
return this.delegate.isFirst();
}
@Override // android.database.Cursor
public boolean isLast() {
return this.delegate.isLast();
}
@Override // android.database.Cursor
public boolean isNull(int i) {
return this.delegate.isNull(i);
}
@Override // android.database.Cursor
public boolean move(int i) {
return this.delegate.move(i);
}
@Override // android.database.Cursor
public boolean moveToFirst() {
return this.delegate.moveToFirst();
}
@Override // android.database.Cursor
public boolean moveToLast() {
return this.delegate.moveToLast();
}
@Override // android.database.Cursor
public boolean moveToNext() {
return this.delegate.moveToNext();
}
@Override // android.database.Cursor
public boolean moveToPosition(int i) {
return this.delegate.moveToPosition(i);
}
@Override // android.database.Cursor
public boolean moveToPrevious() {
return this.delegate.moveToPrevious();
}
@Override // android.database.Cursor
public void registerContentObserver(ContentObserver contentObserver) {
this.delegate.registerContentObserver(contentObserver);
}
@Override // android.database.Cursor
public void registerDataSetObserver(DataSetObserver dataSetObserver) {
this.delegate.registerDataSetObserver(dataSetObserver);
}
@Override // android.database.Cursor
public boolean requery() {
return this.delegate.requery();
}
@Override // android.database.Cursor
public Bundle respond(Bundle bundle) {
return this.delegate.respond(bundle);
}
@Override // android.database.Cursor
public void setNotificationUri(ContentResolver contentResolver, Uri uri) {
this.delegate.setNotificationUri(contentResolver, uri);
}
@Override // android.database.Cursor
public void unregisterContentObserver(ContentObserver contentObserver) {
this.delegate.unregisterContentObserver(contentObserver);
}
@Override // android.database.Cursor
public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
this.delegate.unregisterDataSetObserver(dataSetObserver);
}
public KeepAliveCursor(Cursor delegate, AutoCloser autoCloser) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(autoCloser, "autoCloser");
this.delegate = delegate;
this.autoCloser = autoCloser;
}
@Override // android.database.Cursor, java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.delegate.close();
this.autoCloser.decrementCountAndScheduleClose();
}
@Override // android.database.Cursor
@RequiresApi(api = 29)
public void setNotificationUris(ContentResolver cr, List<? extends Uri> uris) {
Intrinsics.checkNotNullParameter(cr, "cr");
Intrinsics.checkNotNullParameter(uris, "uris");
SupportSQLiteCompat.Api29Impl.setNotificationUris(this.delegate, cr, uris);
}
@Override // android.database.Cursor
@RequiresApi(api = 19)
public Uri getNotificationUri() {
return SupportSQLiteCompat.Api19Impl.getNotificationUri(this.delegate);
}
@Override // android.database.Cursor
@RequiresApi(api = 29)
public List<Uri> getNotificationUris() {
return SupportSQLiteCompat.Api29Impl.getNotificationUris(this.delegate);
}
@Override // android.database.Cursor
@RequiresApi(api = 23)
public void setExtras(Bundle extras) {
Intrinsics.checkNotNullParameter(extras, "extras");
SupportSQLiteCompat.Api23Impl.setExtras(this.delegate, extras);
}
}
@SourceDebugExtension({"SMAP\nAutoClosingRoomOpenHelper.kt\nKotlin\n*S Kotlin\n*F\n+ 1 AutoClosingRoomOpenHelper.kt\nandroidx/room/AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,571:1\n1864#2,3:572\n*S KotlinDebug\n*F\n+ 1 AutoClosingRoomOpenHelper.kt\nandroidx/room/AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement\n*L\n478#1:572,3\n*E\n"})
public static final class AutoClosingSupportSqliteStatement implements SupportSQLiteStatement {
private final AutoCloser autoCloser;
private final ArrayList<Object> binds;
private final String sql;
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
}
public AutoClosingSupportSqliteStatement(String sql, AutoCloser autoCloser) {
Intrinsics.checkNotNullParameter(sql, "sql");
Intrinsics.checkNotNullParameter(autoCloser, "autoCloser");
this.sql = sql;
this.autoCloser = autoCloser;
this.binds = new ArrayList<>();
}
private final <T> T executeSqliteStatementWithRefCount(final Function1 function1) {
return (T) this.autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement$executeSqliteStatementWithRefCount$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
/* JADX WARN: Type inference failed for: r2v2, types: [T, java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public final T invoke(SupportSQLiteDatabase db) {
String str;
Intrinsics.checkNotNullParameter(db, "db");
str = AutoClosingRoomOpenHelper.AutoClosingSupportSqliteStatement.this.sql;
SupportSQLiteStatement compileStatement = db.compileStatement(str);
AutoClosingRoomOpenHelper.AutoClosingSupportSqliteStatement.this.doBinds(compileStatement);
return function1.invoke(compileStatement);
}
});
}
private final void saveBinds(int i, Object obj) {
int size;
int i2 = i - 1;
if (i2 >= this.binds.size() && (size = this.binds.size()) <= i2) {
while (true) {
this.binds.add(null);
if (size == i2) {
break;
} else {
size++;
}
}
}
this.binds.set(i2, obj);
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public void execute() {
executeSqliteStatementWithRefCount(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement$execute$1
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteStatement statement) {
Intrinsics.checkNotNullParameter(statement, "statement");
statement.execute();
return null;
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public int executeUpdateDelete() {
return ((Number) executeSqliteStatementWithRefCount(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement$executeUpdateDelete$1
@Override // kotlin.jvm.functions.Function1
public final Integer invoke(SupportSQLiteStatement obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return Integer.valueOf(obj.executeUpdateDelete());
}
})).intValue();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public long executeInsert() {
return ((Number) executeSqliteStatementWithRefCount(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement$executeInsert$1
@Override // kotlin.jvm.functions.Function1
public final Long invoke(SupportSQLiteStatement obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return Long.valueOf(obj.executeInsert());
}
})).longValue();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public long simpleQueryForLong() {
return ((Number) executeSqliteStatementWithRefCount(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement$simpleQueryForLong$1
@Override // kotlin.jvm.functions.Function1
public final Long invoke(SupportSQLiteStatement obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return Long.valueOf(obj.simpleQueryForLong());
}
})).longValue();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public String simpleQueryForString() {
return (String) executeSqliteStatementWithRefCount(new Function1() { // from class: androidx.room.AutoClosingRoomOpenHelper$AutoClosingSupportSqliteStatement$simpleQueryForString$1
@Override // kotlin.jvm.functions.Function1
public final String invoke(SupportSQLiteStatement obj) {
Intrinsics.checkNotNullParameter(obj, "obj");
return obj.simpleQueryForString();
}
});
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindNull(int i) {
saveBinds(i, null);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindLong(int i, long j) {
saveBinds(i, Long.valueOf(j));
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindDouble(int i, double d) {
saveBinds(i, Double.valueOf(d));
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindString(int i, String value) {
Intrinsics.checkNotNullParameter(value, "value");
saveBinds(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindBlob(int i, byte[] value) {
Intrinsics.checkNotNullParameter(value, "value");
saveBinds(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void clearBindings() {
this.binds.clear();
}
/* JADX INFO: Access modifiers changed from: private */
public final void doBinds(SupportSQLiteStatement supportSQLiteStatement) {
Iterator<T> it = this.binds.iterator();
int i = 0;
while (it.hasNext()) {
it.next();
int i2 = i + 1;
if (i < 0) {
CollectionsKt__CollectionsKt.throwIndexOverflow();
}
Object obj = this.binds.get(i);
if (obj == null) {
supportSQLiteStatement.bindNull(i2);
} else if (obj instanceof Long) {
supportSQLiteStatement.bindLong(i2, ((Number) obj).longValue());
} else if (obj instanceof Double) {
supportSQLiteStatement.bindDouble(i2, ((Number) obj).doubleValue());
} else if (obj instanceof String) {
supportSQLiteStatement.bindString(i2, (String) obj);
} else if (obj instanceof byte[]) {
supportSQLiteStatement.bindBlob(i2, (byte[]) obj);
}
i = i2;
}
}
}
}

View File

@@ -0,0 +1,23 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class AutoClosingRoomOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
private final AutoCloser autoCloser;
private final SupportSQLiteOpenHelper.Factory delegate;
public AutoClosingRoomOpenHelperFactory(SupportSQLiteOpenHelper.Factory delegate, AutoCloser autoCloser) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(autoCloser, "autoCloser");
this.delegate = delegate;
this.autoCloser = autoCloser;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Factory
public AutoClosingRoomOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
return new AutoClosingRoomOpenHelper(this.delegate.create(configuration), this.autoCloser);
}
}

View File

@@ -0,0 +1,17 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface AutoMigration {
int from();
Class<?> spec() default Object.class;
int to();
}

View File

@@ -0,0 +1,23 @@
package androidx.room;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface BuiltInTypeConverters {
public enum State {
ENABLED,
DISABLED,
INHERITED
}
State byteBuffer() default State.INHERITED;
State enums() default State.INHERITED;
State uuid() default State.INHERITED;
}

View File

@@ -0,0 +1,76 @@
package androidx.room;
import androidx.annotation.RequiresApi;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface ColumnInfo {
public static final int BINARY = 2;
public static final int BLOB = 5;
public static final Companion Companion = Companion.$$INSTANCE;
public static final String INHERIT_FIELD_NAME = "[field-name]";
public static final int INTEGER = 3;
@RequiresApi(21)
public static final int LOCALIZED = 5;
public static final int NOCASE = 3;
public static final int REAL = 4;
public static final int RTRIM = 4;
public static final int TEXT = 2;
public static final int UNDEFINED = 1;
@RequiresApi(21)
public static final int UNICODE = 6;
public static final int UNSPECIFIED = 1;
public static final String VALUE_UNSPECIFIED = "[value-unspecified]";
@RequiresApi(21)
@Retention(RetentionPolicy.CLASS)
public @interface Collate {
}
@Retention(RetentionPolicy.CLASS)
public @interface SQLiteTypeAffinity {
}
@Collate
int collate() default 1;
String defaultValue() default "[value-unspecified]";
boolean index() default false;
String name() default "[field-name]";
@SQLiteTypeAffinity
int typeAffinity() default 1;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int BINARY = 2;
public static final int BLOB = 5;
public static final String INHERIT_FIELD_NAME = "[field-name]";
public static final int INTEGER = 3;
@RequiresApi(21)
public static final int LOCALIZED = 5;
public static final int NOCASE = 3;
public static final int REAL = 4;
public static final int RTRIM = 4;
public static final int TEXT = 2;
public static final int UNDEFINED = 1;
@RequiresApi(21)
public static final int UNICODE = 6;
public static final int UNSPECIFIED = 1;
public static final String VALUE_UNSPECIFIED = "[value-unspecified]";
private Companion() {
}
}
}

View File

@@ -0,0 +1,275 @@
package androidx.room;
import androidx.room.InvalidationTracker;
import java.util.Set;
import java.util.concurrent.Callable;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.channels.Channel;
import kotlinx.coroutines.channels.ChannelKt;
import kotlinx.coroutines.flow.FlowCollector;
import kotlinx.coroutines.flow.FlowKt;
@DebugMetadata(c = "androidx.room.CoroutinesRoom$Companion$createFlow$1", f = "CoroutinesRoom.kt", l = {111}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class CoroutinesRoom$Companion$createFlow$1 extends SuspendLambda implements Function2 {
final /* synthetic */ Callable<R> $callable;
final /* synthetic */ RoomDatabase $db;
final /* synthetic */ boolean $inTransaction;
final /* synthetic */ String[] $tableNames;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CoroutinesRoom$Companion$createFlow$1(boolean z, RoomDatabase roomDatabase, String[] strArr, Callable<R> callable, Continuation continuation) {
super(2, continuation);
this.$inTransaction = z;
this.$db = roomDatabase;
this.$tableNames = strArr;
this.$callable = callable;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
CoroutinesRoom$Companion$createFlow$1 coroutinesRoom$Companion$createFlow$1 = new CoroutinesRoom$Companion$createFlow$1(this.$inTransaction, this.$db, this.$tableNames, this.$callable, continuation);
coroutinesRoom$Companion$createFlow$1.L$0 = obj;
return coroutinesRoom$Companion$createFlow$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(FlowCollector flowCollector, Continuation continuation) {
return ((CoroutinesRoom$Companion$createFlow$1) create(flowCollector, continuation)).invokeSuspend(Unit.INSTANCE);
}
@DebugMetadata(c = "androidx.room.CoroutinesRoom$Companion$createFlow$1$1", f = "CoroutinesRoom.kt", l = {137}, m = "invokeSuspend")
/* renamed from: androidx.room.CoroutinesRoom$Companion$createFlow$1$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
final /* synthetic */ FlowCollector $$this$flow;
final /* synthetic */ Callable<R> $callable;
final /* synthetic */ RoomDatabase $db;
final /* synthetic */ boolean $inTransaction;
final /* synthetic */ String[] $tableNames;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AnonymousClass1(boolean z, RoomDatabase roomDatabase, FlowCollector flowCollector, String[] strArr, Callable<R> callable, Continuation continuation) {
super(2, continuation);
this.$inTransaction = z;
this.$db = roomDatabase;
this.$$this$flow = flowCollector;
this.$tableNames = strArr;
this.$callable = callable;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$inTransaction, this.$db, this.$$this$flow, this.$tableNames, this.$callable, continuation);
anonymousClass1.L$0 = obj;
return anonymousClass1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Type inference failed for: r7v0, types: [androidx.room.CoroutinesRoom$Companion$createFlow$1$1$observer$1] */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
ContinuationInterceptor transactionDispatcher;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
final Channel Channel$default = ChannelKt.Channel$default(-1, null, null, 6, null);
final String[] strArr = this.$tableNames;
?? r7 = new InvalidationTracker.Observer(strArr) { // from class: androidx.room.CoroutinesRoom$Companion$createFlow$1$1$observer$1
@Override // androidx.room.InvalidationTracker.Observer
public void onInvalidated(Set<String> set) {
Channel$default.mo4126trySendJP2dKIU(Unit.INSTANCE);
}
};
Channel$default.mo4126trySendJP2dKIU(Unit.INSTANCE);
TransactionElement transactionElement = (TransactionElement) coroutineScope.getCoroutineContext().get(TransactionElement.Key);
if (transactionElement == null || (transactionDispatcher = transactionElement.getTransactionDispatcher$room_ktx_release()) == null) {
transactionDispatcher = this.$inTransaction ? CoroutinesRoomKt.getTransactionDispatcher(this.$db) : CoroutinesRoomKt.getQueryDispatcher(this.$db);
}
Channel Channel$default2 = ChannelKt.Channel$default(0, null, null, 7, null);
BuildersKt__Builders_commonKt.launch$default(coroutineScope, transactionDispatcher, null, new C00051(this.$db, r7, Channel$default, this.$callable, Channel$default2, null), 2, null);
FlowCollector flowCollector = this.$$this$flow;
this.label = 1;
if (FlowKt.emitAll(flowCollector, Channel$default2, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Unit.INSTANCE;
}
@DebugMetadata(c = "androidx.room.CoroutinesRoom$Companion$createFlow$1$1$1", f = "CoroutinesRoom.kt", l = {128, 130}, m = "invokeSuspend")
/* renamed from: androidx.room.CoroutinesRoom$Companion$createFlow$1$1$1, reason: invalid class name and collision with other inner class name */
public static final class C00051 extends SuspendLambda implements Function2 {
final /* synthetic */ Callable<R> $callable;
final /* synthetic */ RoomDatabase $db;
final /* synthetic */ CoroutinesRoom$Companion$createFlow$1$1$observer$1 $observer;
final /* synthetic */ Channel $observerChannel;
final /* synthetic */ Channel $resultChannel;
Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public C00051(RoomDatabase roomDatabase, CoroutinesRoom$Companion$createFlow$1$1$observer$1 coroutinesRoom$Companion$createFlow$1$1$observer$1, Channel channel, Callable callable, Channel channel2, Continuation continuation) {
super(2, continuation);
this.$db = roomDatabase;
this.$observer = coroutinesRoom$Companion$createFlow$1$1$observer$1;
this.$observerChannel = channel;
this.$callable = callable;
this.$resultChannel = channel2;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new C00051(this.$db, this.$observer, this.$observerChannel, this.$callable, this.$resultChannel, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((C00051) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Removed duplicated region for block: B:13:0x004b A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:15:0x004c */
/* JADX WARN: Removed duplicated region for block: B:18:0x0057 A[Catch: all -> 0x006f, TRY_LEAVE, TryCatch #1 {all -> 0x006f, blocks: (B:11:0x0041, B:16:0x004f, B:18:0x0057), top: B:10:0x0041 }] */
/* JADX WARN: Removed duplicated region for block: B:22:0x0071 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:21:0x006d -> B:10:0x0041). Please report as a decompilation issue!!! */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object invokeSuspend(java.lang.Object r8) {
/*
r7 = this;
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r1 = r7.label
r2 = 2
r3 = 1
if (r1 == 0) goto L2c
if (r1 == r3) goto L22
if (r1 != r2) goto L1a
java.lang.Object r1 = r7.L$0
kotlinx.coroutines.channels.ChannelIterator r1 = (kotlinx.coroutines.channels.ChannelIterator) r1
kotlin.ResultKt.throwOnFailure(r8) // Catch: java.lang.Throwable -> L17
r8 = r1
goto L40
L17:
r8 = move-exception
r1 = r7
goto L7f
L1a:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r8.<init>(r0)
throw r8
L22:
java.lang.Object r1 = r7.L$0
kotlinx.coroutines.channels.ChannelIterator r1 = (kotlinx.coroutines.channels.ChannelIterator) r1
kotlin.ResultKt.throwOnFailure(r8) // Catch: java.lang.Throwable -> L17
r4 = r1
r1 = r7
goto L4f
L2c:
kotlin.ResultKt.throwOnFailure(r8)
androidx.room.RoomDatabase r8 = r7.$db
androidx.room.InvalidationTracker r8 = r8.getInvalidationTracker()
androidx.room.CoroutinesRoom$Companion$createFlow$1$1$observer$1 r1 = r7.$observer
r8.addObserver(r1)
kotlinx.coroutines.channels.Channel r8 = r7.$observerChannel // Catch: java.lang.Throwable -> L17
kotlinx.coroutines.channels.ChannelIterator r8 = r8.iterator() // Catch: java.lang.Throwable -> L17
L40:
r1 = r7
L41:
r1.L$0 = r8 // Catch: java.lang.Throwable -> L6f
r1.label = r3 // Catch: java.lang.Throwable -> L6f
java.lang.Object r4 = r8.hasNext(r1) // Catch: java.lang.Throwable -> L6f
if (r4 != r0) goto L4c
return r0
L4c:
r6 = r4
r4 = r8
r8 = r6
L4f:
java.lang.Boolean r8 = (java.lang.Boolean) r8 // Catch: java.lang.Throwable -> L6f
boolean r8 = r8.booleanValue() // Catch: java.lang.Throwable -> L6f
if (r8 == 0) goto L71
r4.next() // Catch: java.lang.Throwable -> L6f
java.util.concurrent.Callable<R> r8 = r1.$callable // Catch: java.lang.Throwable -> L6f
java.lang.Object r8 = r8.call() // Catch: java.lang.Throwable -> L6f
kotlinx.coroutines.channels.Channel r5 = r1.$resultChannel // Catch: java.lang.Throwable -> L6f
r1.L$0 = r4 // Catch: java.lang.Throwable -> L6f
r1.label = r2 // Catch: java.lang.Throwable -> L6f
java.lang.Object r8 = r5.send(r8, r1) // Catch: java.lang.Throwable -> L6f
if (r8 != r0) goto L6d
return r0
L6d:
r8 = r4
goto L41
L6f:
r8 = move-exception
goto L7f
L71:
androidx.room.RoomDatabase r8 = r1.$db
androidx.room.InvalidationTracker r8 = r8.getInvalidationTracker()
androidx.room.CoroutinesRoom$Companion$createFlow$1$1$observer$1 r0 = r1.$observer
r8.removeObserver(r0)
kotlin.Unit r8 = kotlin.Unit.INSTANCE
return r8
L7f:
androidx.room.RoomDatabase r0 = r1.$db
androidx.room.InvalidationTracker r0 = r0.getInvalidationTracker()
androidx.room.CoroutinesRoom$Companion$createFlow$1$1$observer$1 r1 = r1.$observer
r0.removeObserver(r1)
throw r8
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.CoroutinesRoom$Companion$createFlow$1.AnonymousClass1.C00051.invokeSuspend(java.lang.Object):java.lang.Object");
}
}
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$inTransaction, this.$db, (FlowCollector) this.L$0, this.$tableNames, this.$callable, null);
this.label = 1;
if (CoroutineScopeKt.coroutineScope(anonymousClass1, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,44 @@
package androidx.room;
import java.util.concurrent.Callable;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
@DebugMetadata(c = "androidx.room.CoroutinesRoom$Companion$execute$2", f = "CoroutinesRoom.kt", l = {}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class CoroutinesRoom$Companion$execute$2 extends SuspendLambda implements Function2 {
final /* synthetic */ Callable<R> $callable;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CoroutinesRoom$Companion$execute$2(Callable<R> callable, Continuation continuation) {
super(2, continuation);
this.$callable = callable;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new CoroutinesRoom$Companion$execute$2(this.$callable, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((CoroutinesRoom$Companion$execute$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
return this.$callable.call();
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@@ -0,0 +1,55 @@
package androidx.room;
import java.util.concurrent.Callable;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CancellableContinuation;
import kotlinx.coroutines.CoroutineScope;
@DebugMetadata(c = "androidx.room.CoroutinesRoom$Companion$execute$4$job$1", f = "CoroutinesRoom.kt", l = {}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class CoroutinesRoom$Companion$execute$4$job$1 extends SuspendLambda implements Function2 {
final /* synthetic */ Callable<R> $callable;
final /* synthetic */ CancellableContinuation $continuation;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CoroutinesRoom$Companion$execute$4$job$1(Callable<R> callable, CancellableContinuation cancellableContinuation, Continuation continuation) {
super(2, continuation);
this.$callable = callable;
this.$continuation = cancellableContinuation;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new CoroutinesRoom$Companion$execute$4$job$1(this.$callable, this.$continuation, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((CoroutinesRoom$Companion$execute$4$job$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
try {
this.$continuation.resumeWith(Result.m4060constructorimpl(this.$callable.call()));
} catch (Throwable th) {
CancellableContinuation cancellableContinuation = this.$continuation;
Result.Companion companion = Result.Companion;
cancellableContinuation.resumeWith(Result.m4060constructorimpl(ResultKt.createFailure(th)));
}
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@@ -0,0 +1,114 @@
package androidx.room;
import android.os.CancellationSignal;
import androidx.annotation.RestrictTo;
import androidx.sqlite.db.SupportSQLiteCompat;
import java.util.concurrent.Callable;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CancellableContinuationImpl;
import kotlinx.coroutines.GlobalScope;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class CoroutinesRoom {
public static final Companion Companion = new Companion(null);
public static final <R> Flow createFlow(RoomDatabase roomDatabase, boolean z, String[] strArr, Callable<R> callable) {
return Companion.createFlow(roomDatabase, z, strArr, callable);
}
public static final <R> Object execute(RoomDatabase roomDatabase, boolean z, CancellationSignal cancellationSignal, Callable<R> callable, Continuation continuation) {
return Companion.execute(roomDatabase, z, cancellationSignal, callable, continuation);
}
public static final <R> Object execute(RoomDatabase roomDatabase, boolean z, Callable<R> callable, Continuation continuation) {
return Companion.execute(roomDatabase, z, callable, continuation);
}
private CoroutinesRoom() {
}
@SourceDebugExtension({"SMAP\nCoroutinesRoom.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CoroutinesRoom.kt\nandroidx/room/CoroutinesRoom$Companion\n+ 2 CancellableContinuation.kt\nkotlinx/coroutines/CancellableContinuationKt\n*L\n1#1,162:1\n314#2,11:163\n*S KotlinDebug\n*F\n+ 1 CoroutinesRoom.kt\nandroidx/room/CoroutinesRoom$Companion\n*L\n84#1:163,11\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final <R> Object execute(RoomDatabase roomDatabase, boolean z, Callable<R> callable, Continuation continuation) {
ContinuationInterceptor transactionDispatcher;
if (roomDatabase.isOpenInternal() && roomDatabase.inTransaction()) {
return callable.call();
}
TransactionElement transactionElement = (TransactionElement) continuation.getContext().get(TransactionElement.Key);
if (transactionElement == null || (transactionDispatcher = transactionElement.getTransactionDispatcher$room_ktx_release()) == null) {
transactionDispatcher = z ? CoroutinesRoomKt.getTransactionDispatcher(roomDatabase) : CoroutinesRoomKt.getQueryDispatcher(roomDatabase);
}
return BuildersKt.withContext(transactionDispatcher, new CoroutinesRoom$Companion$execute$2(callable, null), continuation);
}
public final <R> Object execute(RoomDatabase roomDatabase, boolean z, final CancellationSignal cancellationSignal, Callable<R> callable, Continuation continuation) {
ContinuationInterceptor transactionDispatcher;
Continuation intercepted;
final Job launch$default;
Object coroutine_suspended;
if (roomDatabase.isOpenInternal() && roomDatabase.inTransaction()) {
return callable.call();
}
TransactionElement transactionElement = (TransactionElement) continuation.getContext().get(TransactionElement.Key);
if (transactionElement == null || (transactionDispatcher = transactionElement.getTransactionDispatcher$room_ktx_release()) == null) {
transactionDispatcher = z ? CoroutinesRoomKt.getTransactionDispatcher(roomDatabase) : CoroutinesRoomKt.getQueryDispatcher(roomDatabase);
}
ContinuationInterceptor continuationInterceptor = transactionDispatcher;
intercepted = IntrinsicsKt__IntrinsicsJvmKt.intercepted(continuation);
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(intercepted, 1);
cancellableContinuationImpl.initCancellability();
launch$default = BuildersKt__Builders_commonKt.launch$default(GlobalScope.INSTANCE, continuationInterceptor, null, new CoroutinesRoom$Companion$execute$4$job$1(callable, cancellableContinuationImpl, null), 2, null);
cancellableContinuationImpl.invokeOnCancellation(new Function1() { // from class: androidx.room.CoroutinesRoom$Companion$execute$4$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((Throwable) obj);
return Unit.INSTANCE;
}
public final void invoke(Throwable th) {
CancellationSignal cancellationSignal2 = cancellationSignal;
if (cancellationSignal2 != null) {
SupportSQLiteCompat.Api16Impl.cancel(cancellationSignal2);
}
Job.DefaultImpls.cancel$default(launch$default, null, 1, null);
}
});
Object result = cancellableContinuationImpl.getResult();
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (result == coroutine_suspended) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
}
public final <R> Flow createFlow(RoomDatabase roomDatabase, boolean z, String[] strArr, Callable<R> callable) {
return FlowKt.flow(new CoroutinesRoom$Companion$createFlow$1(z, roomDatabase, strArr, callable, null));
}
}
}

View File

@@ -0,0 +1,35 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.ExecutorsKt;
@SourceDebugExtension({"SMAP\nCoroutinesRoom.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CoroutinesRoom.kt\nandroidx/room/CoroutinesRoomKt\n+ 2 Maps.kt\nkotlin/collections/MapsKt__MapsKt\n*L\n1#1,162:1\n361#2,7:163\n361#2,7:170\n*S KotlinDebug\n*F\n+ 1 CoroutinesRoom.kt\nandroidx/room/CoroutinesRoomKt\n*L\n149#1:163,7\n159#1:170,7\n*E\n"})
/* loaded from: classes.dex */
public final class CoroutinesRoomKt {
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final CoroutineDispatcher getQueryDispatcher(RoomDatabase roomDatabase) {
Map<String, Object> backingFieldMap = roomDatabase.getBackingFieldMap();
Object obj = backingFieldMap.get("QueryDispatcher");
if (obj == null) {
obj = ExecutorsKt.from(roomDatabase.getQueryExecutor());
backingFieldMap.put("QueryDispatcher", obj);
}
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlinx.coroutines.CoroutineDispatcher");
return (CoroutineDispatcher) obj;
}
public static final CoroutineDispatcher getTransactionDispatcher(RoomDatabase roomDatabase) {
Map<String, Object> backingFieldMap = roomDatabase.getBackingFieldMap();
Object obj = backingFieldMap.get("TransactionDispatcher");
if (obj == null) {
obj = ExecutorsKt.from(roomDatabase.getTransactionExecutor());
backingFieldMap.put("TransactionDispatcher", obj);
}
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlinx.coroutines.CoroutineDispatcher");
return (CoroutineDispatcher) obj;
}
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Dao {
}

View File

@@ -0,0 +1,21 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Database {
AutoMigration[] autoMigrations() default {};
Class<?>[] entities() default {};
boolean exportSchema() default true;
int version();
Class<?>[] views() default {};
}

View File

@@ -0,0 +1,178 @@
package androidx.room;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import androidx.annotation.RestrictTo;
import androidx.room.RoomDatabase;
import androidx.room.migration.AutoMigrationSpec;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public class DatabaseConfiguration {
public final boolean allowDestructiveMigrationOnDowngrade;
public final boolean allowMainThreadQueries;
public final List<AutoMigrationSpec> autoMigrationSpecs;
public final List<RoomDatabase.Callback> callbacks;
public final Context context;
public final String copyFromAssetPath;
public final File copyFromFile;
public final Callable<InputStream> copyFromInputStream;
public final RoomDatabase.JournalMode journalMode;
public final RoomDatabase.MigrationContainer migrationContainer;
private final Set<Integer> migrationNotRequiredFrom;
public final boolean multiInstanceInvalidation;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public final Intent multiInstanceInvalidationServiceIntent;
public final String name;
public final RoomDatabase.PrepackagedDatabaseCallback prepackagedDatabaseCallback;
public final Executor queryExecutor;
public final boolean requireMigration;
public final SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory;
public final Executor transactionExecutor;
public final List<Object> typeConverters;
/* JADX WARN: Multi-variable type inference failed */
@SuppressLint({"LambdaLast"})
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, Intent intent, boolean z2, boolean z3, Set<Integer> set, String str2, File file, Callable<InputStream> callable, RoomDatabase.PrepackagedDatabaseCallback prepackagedDatabaseCallback, List<? extends Object> typeConverters, List<? extends AutoMigrationSpec> autoMigrationSpecs) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
Intrinsics.checkNotNullParameter(typeConverters, "typeConverters");
Intrinsics.checkNotNullParameter(autoMigrationSpecs, "autoMigrationSpecs");
this.context = context;
this.name = str;
this.sqliteOpenHelperFactory = sqliteOpenHelperFactory;
this.migrationContainer = migrationContainer;
this.callbacks = list;
this.allowMainThreadQueries = z;
this.journalMode = journalMode;
this.queryExecutor = queryExecutor;
this.transactionExecutor = transactionExecutor;
this.multiInstanceInvalidationServiceIntent = intent;
this.requireMigration = z2;
this.allowDestructiveMigrationOnDowngrade = z3;
this.migrationNotRequiredFrom = set;
this.copyFromAssetPath = str2;
this.copyFromFile = file;
this.copyFromInputStream = callable;
this.prepackagedDatabaseCallback = prepackagedDatabaseCallback;
this.typeConverters = typeConverters;
this.autoMigrationSpecs = autoMigrationSpecs;
this.multiInstanceInvalidation = intent != null;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, boolean z2, Set<Integer> set) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, queryExecutor, (Intent) null, z2, false, set, (String) null, (File) null, (Callable<InputStream>) null, (RoomDatabase.PrepackagedDatabaseCallback) null, (List<? extends Object>) CollectionsKt__CollectionsKt.emptyList(), (List<? extends AutoMigrationSpec>) CollectionsKt__CollectionsKt.emptyList());
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, boolean z2, boolean z3, boolean z4, Set<Integer> set) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, transactionExecutor, z2 ? new Intent(context, (Class<?>) MultiInstanceInvalidationService.class) : null, z3, z4, set, (String) null, (File) null, (Callable<InputStream>) null, (RoomDatabase.PrepackagedDatabaseCallback) null, (List<? extends Object>) CollectionsKt__CollectionsKt.emptyList(), (List<? extends AutoMigrationSpec>) CollectionsKt__CollectionsKt.emptyList());
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, boolean z2, boolean z3, boolean z4, Set<Integer> set, String str2, File file) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, transactionExecutor, z2 ? new Intent(context, (Class<?>) MultiInstanceInvalidationService.class) : null, z3, z4, set, str2, file, (Callable<InputStream>) null, (RoomDatabase.PrepackagedDatabaseCallback) null, (List<? extends Object>) CollectionsKt__CollectionsKt.emptyList(), (List<? extends AutoMigrationSpec>) CollectionsKt__CollectionsKt.emptyList());
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, boolean z2, boolean z3, boolean z4, Set<Integer> set, String str2, File file, Callable<InputStream> callable) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, transactionExecutor, z2 ? new Intent(context, (Class<?>) MultiInstanceInvalidationService.class) : null, z3, z4, set, str2, file, callable, (RoomDatabase.PrepackagedDatabaseCallback) null, (List<? extends Object>) CollectionsKt__CollectionsKt.emptyList(), (List<? extends AutoMigrationSpec>) CollectionsKt__CollectionsKt.emptyList());
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@SuppressLint({"LambdaLast"})
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, boolean z2, boolean z3, boolean z4, Set<Integer> set, String str2, File file, Callable<InputStream> callable, RoomDatabase.PrepackagedDatabaseCallback prepackagedDatabaseCallback) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, transactionExecutor, z2 ? new Intent(context, (Class<?>) MultiInstanceInvalidationService.class) : null, z3, z4, set, str2, file, callable, prepackagedDatabaseCallback, (List<? extends Object>) CollectionsKt__CollectionsKt.emptyList(), (List<? extends AutoMigrationSpec>) CollectionsKt__CollectionsKt.emptyList());
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@SuppressLint({"LambdaLast"})
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, boolean z2, boolean z3, boolean z4, Set<Integer> set, String str2, File file, Callable<InputStream> callable, RoomDatabase.PrepackagedDatabaseCallback prepackagedDatabaseCallback, List<? extends Object> typeConverters) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, transactionExecutor, z2 ? new Intent(context, (Class<?>) MultiInstanceInvalidationService.class) : null, z3, z4, set, str2, file, callable, prepackagedDatabaseCallback, typeConverters, (List<? extends AutoMigrationSpec>) CollectionsKt__CollectionsKt.emptyList());
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
Intrinsics.checkNotNullParameter(typeConverters, "typeConverters");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@SuppressLint({"LambdaLast"})
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public DatabaseConfiguration(Context context, String str, SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory, RoomDatabase.MigrationContainer migrationContainer, List<? extends RoomDatabase.Callback> list, boolean z, RoomDatabase.JournalMode journalMode, Executor queryExecutor, Executor transactionExecutor, boolean z2, boolean z3, boolean z4, Set<Integer> set, String str2, File file, Callable<InputStream> callable, RoomDatabase.PrepackagedDatabaseCallback prepackagedDatabaseCallback, List<? extends Object> typeConverters, List<? extends AutoMigrationSpec> autoMigrationSpecs) {
this(context, str, sqliteOpenHelperFactory, migrationContainer, list, z, journalMode, queryExecutor, transactionExecutor, z2 ? new Intent(context, (Class<?>) MultiInstanceInvalidationService.class) : null, z3, z4, set, str2, file, callable, (RoomDatabase.PrepackagedDatabaseCallback) null, typeConverters, autoMigrationSpecs);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sqliteOpenHelperFactory, "sqliteOpenHelperFactory");
Intrinsics.checkNotNullParameter(migrationContainer, "migrationContainer");
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(transactionExecutor, "transactionExecutor");
Intrinsics.checkNotNullParameter(typeConverters, "typeConverters");
Intrinsics.checkNotNullParameter(autoMigrationSpecs, "autoMigrationSpecs");
}
public boolean isMigrationRequiredFrom(int i) {
return isMigrationRequired(i, i + 1);
}
public boolean isMigrationRequired(int i, int i2) {
if ((i > i2 && this.allowDestructiveMigrationOnDowngrade) || !this.requireMigration) {
return false;
}
Set<Integer> set = this.migrationNotRequiredFrom;
return set == null || !set.contains(Integer.valueOf(i));
}
}

View File

@@ -0,0 +1,15 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface DatabaseView {
String value() default "";
String viewName() default "";
}

View File

@@ -0,0 +1,8 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
/* loaded from: classes.dex */
public interface DelegatingOpenHelper {
SupportSQLiteOpenHelper getDelegate();
}

View File

@@ -0,0 +1,13 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Delete {
Class<?> entity() default Object.class;
}

View File

@@ -0,0 +1,24 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Repeatable(Entries.class)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface DeleteColumn {
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Entries {
DeleteColumn[] value();
}
String columnName();
String tableName();
}

View File

@@ -0,0 +1,22 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Repeatable(Entries.class)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface DeleteTable {
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Entries {
DeleteTable[] value();
}
String tableName();
}

View File

@@ -0,0 +1,13 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Embedded {
String prefix() default "";
}

View File

@@ -0,0 +1,23 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Entity {
ForeignKey[] foreignKeys() default {};
String[] ignoredColumns() default {};
Index[] indices() default {};
boolean inheritSuperIndices() default false;
String[] primaryKeys() default {};
String tableName() default "";
}

View File

@@ -0,0 +1,64 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.util.Iterator;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nEntityDeletionOrUpdateAdapter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 EntityDeletionOrUpdateAdapter.kt\nandroidx/room/EntityDeletionOrUpdateAdapter\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,107:1\n1855#2,2:108\n13579#3,2:110\n*S KotlinDebug\n*F\n+ 1 EntityDeletionOrUpdateAdapter.kt\nandroidx/room/EntityDeletionOrUpdateAdapter\n*L\n77#1:108,2\n97#1:110,2\n*E\n"})
/* loaded from: classes.dex */
public abstract class EntityDeletionOrUpdateAdapter<T> extends SharedSQLiteStatement {
public abstract void bind(SupportSQLiteStatement supportSQLiteStatement, T t);
@Override // androidx.room.SharedSQLiteStatement
public abstract String createQuery();
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public EntityDeletionOrUpdateAdapter(RoomDatabase database) {
super(database);
Intrinsics.checkNotNullParameter(database, "database");
}
public final int handle(T t) {
SupportSQLiteStatement acquire = acquire();
try {
bind(acquire, t);
return acquire.executeUpdateDelete();
} finally {
release(acquire);
}
}
public final int handleMultiple(Iterable<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
Iterator<? extends T> it = entities.iterator();
int i = 0;
while (it.hasNext()) {
bind(acquire, it.next());
i += acquire.executeUpdateDelete();
}
return i;
} finally {
release(acquire);
}
}
public final int handleMultiple(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
int i = 0;
for (T t : entities) {
bind(acquire, t);
i += acquire.executeUpdateDelete();
}
return i;
} finally {
release(acquire);
}
}
}

View File

@@ -0,0 +1,192 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.internal.ArrayIteratorKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nEntityInsertionAdapter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 EntityInsertionAdapter.kt\nandroidx/room/EntityInsertionAdapter\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,229:1\n13579#2,2:230\n13644#2,3:237\n13579#2,2:240\n1855#3,2:232\n1864#3,3:234\n1855#3,2:242\n*S KotlinDebug\n*F\n+ 1 EntityInsertionAdapter.kt\nandroidx/room/EntityInsertionAdapter\n*L\n65#1:230,2\n137#1:237,3\n199#1:240,2\n82#1:232,2\n117#1:234,3\n219#1:242,2\n*E\n"})
/* loaded from: classes.dex */
public abstract class EntityInsertionAdapter<T> extends SharedSQLiteStatement {
public abstract void bind(SupportSQLiteStatement supportSQLiteStatement, T t);
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public EntityInsertionAdapter(RoomDatabase database) {
super(database);
Intrinsics.checkNotNullParameter(database, "database");
}
public final void insert(T t) {
SupportSQLiteStatement acquire = acquire();
try {
bind(acquire, t);
acquire.executeInsert();
} finally {
release(acquire);
}
}
public final void insert(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
for (T t : entities) {
bind(acquire, t);
acquire.executeInsert();
}
} finally {
release(acquire);
}
}
public final void insert(Iterable<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
Iterator<? extends T> it = entities.iterator();
while (it.hasNext()) {
bind(acquire, it.next());
acquire.executeInsert();
}
} finally {
release(acquire);
}
}
public final long insertAndReturnId(T t) {
SupportSQLiteStatement acquire = acquire();
try {
bind(acquire, t);
return acquire.executeInsert();
} finally {
release(acquire);
}
}
public final long[] insertAndReturnIdsArray(Collection<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
long[] jArr = new long[entities.size()];
int i = 0;
for (T t : entities) {
int i2 = i + 1;
if (i < 0) {
CollectionsKt__CollectionsKt.throwIndexOverflow();
}
bind(acquire, t);
jArr[i] = acquire.executeInsert();
i = i2;
}
release(acquire);
return jArr;
} catch (Throwable th) {
release(acquire);
throw th;
}
}
public final long[] insertAndReturnIdsArray(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
long[] jArr = new long[entities.length];
int length = entities.length;
int i = 0;
int i2 = 0;
while (i < length) {
int i3 = i2 + 1;
bind(acquire, entities[i]);
jArr[i2] = acquire.executeInsert();
i++;
i2 = i3;
}
return jArr;
} finally {
release(acquire);
}
}
public final Long[] insertAndReturnIdsArrayBox(Collection<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
Iterator<? extends T> it = entities.iterator();
try {
int size = entities.size();
Long[] lArr = new Long[size];
for (int i = 0; i < size; i++) {
bind(acquire, it.next());
lArr[i] = Long.valueOf(acquire.executeInsert());
}
return lArr;
} finally {
release(acquire);
}
}
/* JADX WARN: Multi-variable type inference failed */
public final Long[] insertAndReturnIdsArrayBox(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
Iterator it = ArrayIteratorKt.iterator(entities);
try {
int length = entities.length;
Long[] lArr = new Long[length];
for (int i = 0; i < length; i++) {
bind(acquire, it.next());
lArr[i] = Long.valueOf(acquire.executeInsert());
}
return lArr;
} finally {
release(acquire);
}
}
public final List<Long> insertAndReturnIdsList(T[] entities) {
List createListBuilder;
List<Long> build;
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
for (T t : entities) {
bind(acquire, t);
createListBuilder.add(Long.valueOf(acquire.executeInsert()));
}
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
release(acquire);
return build;
} catch (Throwable th) {
release(acquire);
throw th;
}
}
public final List<Long> insertAndReturnIdsList(Collection<? extends T> entities) {
List createListBuilder;
List<Long> build;
Intrinsics.checkNotNullParameter(entities, "entities");
SupportSQLiteStatement acquire = acquire();
try {
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
Iterator<T> it = entities.iterator();
while (it.hasNext()) {
bind(acquire, it.next());
createListBuilder.add(Long.valueOf(acquire.executeInsert()));
}
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
release(acquire);
return build;
} catch (Throwable th) {
release(acquire);
throw th;
}
}
}

View File

@@ -0,0 +1,201 @@
package androidx.room;
import android.database.sqlite.SQLiteConstraintException;
import androidx.annotation.RestrictTo;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nEntityUpsertionAdapter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 EntityUpsertionAdapter.kt\nandroidx/room/EntityUpsertionAdapter\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,224:1\n13579#2,2:225\n13579#2,2:229\n1855#3,2:227\n1855#3,2:231\n*S KotlinDebug\n*F\n+ 1 EntityUpsertionAdapter.kt\nandroidx/room/EntityUpsertionAdapter\n*L\n78#1:225,2\n151#1:229,2\n89#1:227,2\n165#1:231,2\n*E\n"})
/* loaded from: classes.dex */
public final class EntityUpsertionAdapter<T> {
private final EntityInsertionAdapter<T> insertionAdapter;
private final EntityDeletionOrUpdateAdapter<T> updateAdapter;
public EntityUpsertionAdapter(EntityInsertionAdapter<T> insertionAdapter, EntityDeletionOrUpdateAdapter<T> updateAdapter) {
Intrinsics.checkNotNullParameter(insertionAdapter, "insertionAdapter");
Intrinsics.checkNotNullParameter(updateAdapter, "updateAdapter");
this.insertionAdapter = insertionAdapter;
this.updateAdapter = updateAdapter;
}
public final void upsert(T t) {
try {
this.insertionAdapter.insert((EntityInsertionAdapter<T>) t);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(t);
}
}
public final long upsertAndReturnId(T t) {
try {
return this.insertionAdapter.insertAndReturnId(t);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(t);
return -1L;
}
}
public final long[] upsertAndReturnIdsArray(T[] entities) {
long j;
Intrinsics.checkNotNullParameter(entities, "entities");
int length = entities.length;
long[] jArr = new long[length];
for (int i = 0; i < length; i++) {
try {
j = this.insertionAdapter.insertAndReturnId(entities[i]);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(entities[i]);
j = -1;
}
jArr[i] = j;
}
return jArr;
}
public final long[] upsertAndReturnIdsArray(Collection<? extends T> entities) {
long j;
Intrinsics.checkNotNullParameter(entities, "entities");
Iterator<? extends T> it = entities.iterator();
int size = entities.size();
long[] jArr = new long[size];
for (int i = 0; i < size; i++) {
T next = it.next();
try {
j = this.insertionAdapter.insertAndReturnId(next);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(next);
j = -1;
}
jArr[i] = j;
}
return jArr;
}
public final List<Long> upsertAndReturnIdsList(T[] entities) {
List createListBuilder;
List<Long> build;
Intrinsics.checkNotNullParameter(entities, "entities");
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
for (T t : entities) {
try {
createListBuilder.add(Long.valueOf(this.insertionAdapter.insertAndReturnId(t)));
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(t);
createListBuilder.add(-1L);
}
}
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
return build;
}
public final List<Long> upsertAndReturnIdsList(Collection<? extends T> entities) {
List createListBuilder;
List<Long> build;
Intrinsics.checkNotNullParameter(entities, "entities");
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
for (T t : entities) {
try {
createListBuilder.add(Long.valueOf(this.insertionAdapter.insertAndReturnId(t)));
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(t);
createListBuilder.add(-1L);
}
}
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
return build;
}
public final Long[] upsertAndReturnIdsArrayBox(T[] entities) {
long j;
Intrinsics.checkNotNullParameter(entities, "entities");
int length = entities.length;
Long[] lArr = new Long[length];
for (int i = 0; i < length; i++) {
try {
j = this.insertionAdapter.insertAndReturnId(entities[i]);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(entities[i]);
j = -1;
}
lArr[i] = Long.valueOf(j);
}
return lArr;
}
public final Long[] upsertAndReturnIdsArrayBox(Collection<? extends T> entities) {
long j;
Intrinsics.checkNotNullParameter(entities, "entities");
Iterator<? extends T> it = entities.iterator();
int size = entities.size();
Long[] lArr = new Long[size];
for (int i = 0; i < size; i++) {
T next = it.next();
try {
j = this.insertionAdapter.insertAndReturnId(next);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(next);
j = -1;
}
lArr[i] = Long.valueOf(j);
}
return lArr;
}
private final void checkUniquenessException(SQLiteConstraintException sQLiteConstraintException) {
boolean contains$default;
boolean contains$default2;
String message = sQLiteConstraintException.getMessage();
if (message == null) {
throw sQLiteConstraintException;
}
if (StringsKt__StringsKt.contains(message, "unique", true)) {
return;
}
contains$default = StringsKt__StringsKt.contains$default(message, "2067", false, 2, null);
if (contains$default) {
return;
}
contains$default2 = StringsKt__StringsKt.contains$default(message, "1555", false, 2, null);
if (!contains$default2) {
throw sQLiteConstraintException;
}
}
public final void upsert(Iterable<? extends T> entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
for (T t : entities) {
try {
this.insertionAdapter.insert((EntityInsertionAdapter<T>) t);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(t);
}
}
}
public final void upsert(T[] entities) {
Intrinsics.checkNotNullParameter(entities, "entities");
for (T t : entities) {
try {
this.insertionAdapter.insert((EntityInsertionAdapter<T>) t);
} catch (SQLiteConstraintException e) {
checkUniquenessException(e);
this.updateAdapter.handle(t);
}
}
}
}

View File

@@ -0,0 +1,8 @@
package androidx.room;
/* loaded from: classes.dex */
public final class EntityUpsertionAdapterKt {
private static final String ErrorMsg = "unique";
private static final String SQLITE_CONSTRAINT_PRIMARYKEY = "1555";
private static final String SQLITE_CONSTRAINT_UNIQUE = "2067";
}

View File

@@ -0,0 +1,14 @@
package androidx.room;
import androidx.annotation.RequiresOptIn;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@RequiresOptIn
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface ExperimentalRoomApi {
}

View File

@@ -0,0 +1,47 @@
package androidx.room;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface ForeignKey {
public static final int CASCADE = 5;
public static final Companion Companion = Companion.$$INSTANCE;
public static final int NO_ACTION = 1;
public static final int RESTRICT = 2;
public static final int SET_DEFAULT = 4;
public static final int SET_NULL = 3;
@Retention(RetentionPolicy.CLASS)
public @interface Action {
}
String[] childColumns();
boolean deferred() default false;
Class<?> entity();
@Action
int onDelete() default 1;
@Action
int onUpdate() default 1;
String[] parentColumns();
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int CASCADE = 5;
public static final int NO_ACTION = 1;
public static final int RESTRICT = 2;
public static final int SET_DEFAULT = 4;
public static final int SET_NULL = 3;
private Companion() {
}
}
}

View File

@@ -0,0 +1,17 @@
package androidx.room;
import androidx.annotation.RequiresApi;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@RequiresApi(16)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Fts3 {
String tokenizer() default "simple";
String[] tokenizerArgs() default {};
}

View File

@@ -0,0 +1,30 @@
package androidx.room;
import androidx.annotation.RequiresApi;
import androidx.room.FtsOptions;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@RequiresApi(16)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Fts4 {
Class<?> contentEntity() default Object.class;
String languageId() default "";
FtsOptions.MatchInfo matchInfo() default FtsOptions.MatchInfo.FTS4;
String[] notIndexed() default {};
FtsOptions.Order order() default FtsOptions.Order.ASC;
int[] prefix() default {};
String tokenizer() default "simple";
String[] tokenizerArgs() default {};
}

View File

@@ -0,0 +1,27 @@
package androidx.room;
import androidx.annotation.RequiresApi;
/* loaded from: classes.dex */
public final class FtsOptions {
public static final FtsOptions INSTANCE = new FtsOptions();
public static final String TOKENIZER_ICU = "icu";
public static final String TOKENIZER_PORTER = "porter";
public static final String TOKENIZER_SIMPLE = "simple";
@RequiresApi(21)
public static final String TOKENIZER_UNICODE61 = "unicode61";
public enum MatchInfo {
FTS3,
FTS4
}
public enum Order {
ASC,
DESC
}
private FtsOptions() {
}
}

View File

@@ -0,0 +1,97 @@
package androidx.room;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY})
/* loaded from: classes.dex */
public interface IMultiInstanceInvalidationCallback extends IInterface {
public static final String DESCRIPTOR = "androidx$room$IMultiInstanceInvalidationCallback".replace('$', '.');
public static class Default implements IMultiInstanceInvalidationCallback {
@Override // android.os.IInterface
public IBinder asBinder() {
return null;
}
@Override // androidx.room.IMultiInstanceInvalidationCallback
public void onInvalidation(String[] strArr) throws RemoteException {
}
}
void onInvalidation(String[] strArr) throws RemoteException;
public static abstract class Stub extends Binder implements IMultiInstanceInvalidationCallback {
static final int TRANSACTION_onInvalidation = 1;
@Override // android.os.IInterface
public IBinder asBinder() {
return this;
}
public Stub() {
attachInterface(this, IMultiInstanceInvalidationCallback.DESCRIPTOR);
}
public static IMultiInstanceInvalidationCallback asInterface(IBinder iBinder) {
if (iBinder == null) {
return null;
}
IInterface queryLocalInterface = iBinder.queryLocalInterface(IMultiInstanceInvalidationCallback.DESCRIPTOR);
if (queryLocalInterface != null && (queryLocalInterface instanceof IMultiInstanceInvalidationCallback)) {
return (IMultiInstanceInvalidationCallback) queryLocalInterface;
}
return new Proxy(iBinder);
}
@Override // android.os.Binder
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
String str = IMultiInstanceInvalidationCallback.DESCRIPTOR;
if (i >= 1 && i <= 16777215) {
parcel.enforceInterface(str);
}
if (i == 1598968902) {
parcel2.writeString(str);
return true;
}
if (i == 1) {
onInvalidation(parcel.createStringArray());
return true;
}
return super.onTransact(i, parcel, parcel2, i2);
}
public static class Proxy implements IMultiInstanceInvalidationCallback {
private IBinder mRemote;
@Override // android.os.IInterface
public IBinder asBinder() {
return this.mRemote;
}
public String getInterfaceDescriptor() {
return IMultiInstanceInvalidationCallback.DESCRIPTOR;
}
public Proxy(IBinder iBinder) {
this.mRemote = iBinder;
}
@Override // androidx.room.IMultiInstanceInvalidationCallback
public void onInvalidation(String[] strArr) throws RemoteException {
Parcel obtain = Parcel.obtain();
try {
obtain.writeInterfaceToken(IMultiInstanceInvalidationCallback.DESCRIPTOR);
obtain.writeStringArray(strArr);
this.mRemote.transact(1, obtain, null, 1);
} finally {
obtain.recycle();
}
}
}
}
}

View File

@@ -0,0 +1,155 @@
package androidx.room;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import androidx.annotation.RestrictTo;
import androidx.room.IMultiInstanceInvalidationCallback;
@RestrictTo({RestrictTo.Scope.LIBRARY})
/* loaded from: classes.dex */
public interface IMultiInstanceInvalidationService extends IInterface {
public static final String DESCRIPTOR = "androidx$room$IMultiInstanceInvalidationService".replace('$', '.');
public static class Default implements IMultiInstanceInvalidationService {
@Override // android.os.IInterface
public IBinder asBinder() {
return null;
}
@Override // androidx.room.IMultiInstanceInvalidationService
public void broadcastInvalidation(int i, String[] strArr) throws RemoteException {
}
@Override // androidx.room.IMultiInstanceInvalidationService
public int registerCallback(IMultiInstanceInvalidationCallback iMultiInstanceInvalidationCallback, String str) throws RemoteException {
return 0;
}
@Override // androidx.room.IMultiInstanceInvalidationService
public void unregisterCallback(IMultiInstanceInvalidationCallback iMultiInstanceInvalidationCallback, int i) throws RemoteException {
}
}
void broadcastInvalidation(int i, String[] strArr) throws RemoteException;
int registerCallback(IMultiInstanceInvalidationCallback iMultiInstanceInvalidationCallback, String str) throws RemoteException;
void unregisterCallback(IMultiInstanceInvalidationCallback iMultiInstanceInvalidationCallback, int i) throws RemoteException;
public static abstract class Stub extends Binder implements IMultiInstanceInvalidationService {
static final int TRANSACTION_broadcastInvalidation = 3;
static final int TRANSACTION_registerCallback = 1;
static final int TRANSACTION_unregisterCallback = 2;
@Override // android.os.IInterface
public IBinder asBinder() {
return this;
}
public Stub() {
attachInterface(this, IMultiInstanceInvalidationService.DESCRIPTOR);
}
public static IMultiInstanceInvalidationService asInterface(IBinder iBinder) {
if (iBinder == null) {
return null;
}
IInterface queryLocalInterface = iBinder.queryLocalInterface(IMultiInstanceInvalidationService.DESCRIPTOR);
if (queryLocalInterface != null && (queryLocalInterface instanceof IMultiInstanceInvalidationService)) {
return (IMultiInstanceInvalidationService) queryLocalInterface;
}
return new Proxy(iBinder);
}
@Override // android.os.Binder
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
String str = IMultiInstanceInvalidationService.DESCRIPTOR;
if (i >= 1 && i <= 16777215) {
parcel.enforceInterface(str);
}
if (i == 1598968902) {
parcel2.writeString(str);
return true;
}
if (i == 1) {
int registerCallback = registerCallback(IMultiInstanceInvalidationCallback.Stub.asInterface(parcel.readStrongBinder()), parcel.readString());
parcel2.writeNoException();
parcel2.writeInt(registerCallback);
} else if (i == 2) {
unregisterCallback(IMultiInstanceInvalidationCallback.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt());
parcel2.writeNoException();
} else if (i == 3) {
broadcastInvalidation(parcel.readInt(), parcel.createStringArray());
} else {
return super.onTransact(i, parcel, parcel2, i2);
}
return true;
}
public static class Proxy implements IMultiInstanceInvalidationService {
private IBinder mRemote;
@Override // android.os.IInterface
public IBinder asBinder() {
return this.mRemote;
}
public String getInterfaceDescriptor() {
return IMultiInstanceInvalidationService.DESCRIPTOR;
}
public Proxy(IBinder iBinder) {
this.mRemote = iBinder;
}
@Override // androidx.room.IMultiInstanceInvalidationService
public int registerCallback(IMultiInstanceInvalidationCallback iMultiInstanceInvalidationCallback, String str) throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken(IMultiInstanceInvalidationService.DESCRIPTOR);
obtain.writeStrongInterface(iMultiInstanceInvalidationCallback);
obtain.writeString(str);
this.mRemote.transact(1, obtain, obtain2, 0);
obtain2.readException();
return obtain2.readInt();
} finally {
obtain2.recycle();
obtain.recycle();
}
}
@Override // androidx.room.IMultiInstanceInvalidationService
public void unregisterCallback(IMultiInstanceInvalidationCallback iMultiInstanceInvalidationCallback, int i) throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken(IMultiInstanceInvalidationService.DESCRIPTOR);
obtain.writeStrongInterface(iMultiInstanceInvalidationCallback);
obtain.writeInt(i);
this.mRemote.transact(2, obtain, obtain2, 0);
obtain2.readException();
} finally {
obtain2.recycle();
obtain.recycle();
}
}
@Override // androidx.room.IMultiInstanceInvalidationService
public void broadcastInvalidation(int i, String[] strArr) throws RemoteException {
Parcel obtain = Parcel.obtain();
try {
obtain.writeInterfaceToken(IMultiInstanceInvalidationService.DESCRIPTOR);
obtain.writeInt(i);
obtain.writeStringArray(strArr);
this.mRemote.transact(3, obtain, null, 1);
} finally {
obtain.recycle();
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Ignore {
}

View File

@@ -0,0 +1,24 @@
package androidx.room;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Index {
public enum Order {
ASC,
DESC
}
String name() default "";
Order[] orders() default {};
boolean unique() default false;
String[] value();
}

View File

@@ -0,0 +1,16 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Insert {
Class<?> entity() default Object.class;
@OnConflictStrategy
int onConflict() default 3;
}

View File

@@ -0,0 +1,42 @@
package androidx.room;
import androidx.lifecycle.LiveData;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Set;
import java.util.concurrent.Callable;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class InvalidationLiveDataContainer {
private final RoomDatabase database;
private final Set<LiveData<?>> liveDataSet;
public final Set<LiveData<?>> getLiveDataSet$room_runtime_release() {
return this.liveDataSet;
}
public InvalidationLiveDataContainer(RoomDatabase database) {
Intrinsics.checkNotNullParameter(database, "database");
this.database = database;
Set<LiveData<?>> newSetFromMap = Collections.newSetFromMap(new IdentityHashMap());
Intrinsics.checkNotNullExpressionValue(newSetFromMap, "newSetFromMap(IdentityHashMap())");
this.liveDataSet = newSetFromMap;
}
public final <T> LiveData<T> create(String[] tableNames, boolean z, Callable<T> computeFunction) {
Intrinsics.checkNotNullParameter(tableNames, "tableNames");
Intrinsics.checkNotNullParameter(computeFunction, "computeFunction");
return new RoomTrackingLiveData(this.database, this, z, computeFunction, tableNames);
}
public final void onActive(LiveData<?> liveData) {
Intrinsics.checkNotNullParameter(liveData, "liveData");
this.liveDataSet.add(liveData);
}
public final void onInactive(LiveData<?> liveData) {
Intrinsics.checkNotNullParameter(liveData, "liveData");
this.liveDataSet.remove(liveData);
}
}

View File

@@ -0,0 +1,948 @@
package androidx.room;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.util.Log;
import androidx.annotation.GuardedBy;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.annotation.WorkerThread;
import androidx.arch.core.internal.SafeIterableMap;
import androidx.lifecycle.LiveData;
import androidx.sqlite.db.SimpleSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Lock;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.collections.SetsKt__SetsJVMKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsJVMKt;
import org.apache.http.client.methods.HttpDelete;
@SourceDebugExtension({"SMAP\nInvalidationTracker.kt\nKotlin\n*S Kotlin\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker\n+ 2 _Maps.kt\nkotlin/collections/MapsKt___MapsKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 4 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n+ 5 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,840:1\n215#2,2:841\n11335#3:843\n11670#3,3:844\n13579#3,2:847\n13579#3,2:849\n13674#3,3:855\n37#4,2:851\n1855#5,2:853\n*S KotlinDebug\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker\n*L\n102#1:841,2\n250#1:843\n250#1:844,3\n271#1:847,2\n287#1:849,2\n491#1:855,3\n294#1:851,2\n467#1:853,2\n*E\n"})
/* loaded from: classes.dex */
public class InvalidationTracker {
private static final String CREATE_TRACKING_TABLE_SQL = "CREATE TEMP TABLE room_table_modification_log (table_id INTEGER PRIMARY KEY, invalidated INTEGER NOT NULL DEFAULT 0)";
private static final String INVALIDATED_COLUMN_NAME = "invalidated";
public static final String RESET_UPDATED_TABLES_SQL = "UPDATE room_table_modification_log SET invalidated = 0 WHERE invalidated = 1";
public static final String SELECT_UPDATED_TABLES_SQL = "SELECT * FROM room_table_modification_log WHERE invalidated = 1;";
private static final String TABLE_ID_COLUMN_NAME = "table_id";
private static final String UPDATE_TABLE_NAME = "room_table_modification_log";
private AutoCloser autoCloser;
private volatile SupportSQLiteStatement cleanupStatement;
private final RoomDatabase database;
private volatile boolean initialized;
private final InvalidationLiveDataContainer invalidationLiveDataContainer;
private MultiInstanceInvalidationClient multiInstanceInvalidationClient;
private final ObservedTableTracker observedTableTracker;
@GuardedBy("observerMap")
private final SafeIterableMap<Observer, ObserverWrapper> observerMap;
@RestrictTo({RestrictTo.Scope.LIBRARY})
private final AtomicBoolean pendingRefresh;
@RestrictTo({RestrictTo.Scope.LIBRARY})
public final Runnable refreshRunnable;
private final Map<String, String> shadowTablesMap;
private final Object syncTriggersLock;
private final Map<String, Integer> tableIdLookup;
private final String[] tablesNames;
private final Object trackerLock;
private final Map<String, Set<String>> viewTables;
public static final Companion Companion = new Companion(null);
private static final String[] TRIGGERS = {"UPDATE", HttpDelete.METHOD_NAME, "INSERT"};
@VisibleForTesting
public static /* synthetic */ void getRefreshRunnable$annotations() {
}
public final SupportSQLiteStatement getCleanupStatement$room_runtime_release() {
return this.cleanupStatement;
}
public final RoomDatabase getDatabase$room_runtime_release() {
return this.database;
}
public final SafeIterableMap<Observer, ObserverWrapper> getObserverMap$room_runtime_release() {
return this.observerMap;
}
@RestrictTo({RestrictTo.Scope.LIBRARY})
public final AtomicBoolean getPendingRefresh() {
return this.pendingRefresh;
}
public final Map<String, Integer> getTableIdLookup$room_runtime_release() {
return this.tableIdLookup;
}
public final String[] getTablesNames$room_runtime_release() {
return this.tablesNames;
}
public final void setCleanupStatement$room_runtime_release(SupportSQLiteStatement supportSQLiteStatement) {
this.cleanupStatement = supportSQLiteStatement;
}
/* JADX WARN: Multi-variable type inference failed */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public InvalidationTracker(RoomDatabase database, Map<String, String> shadowTablesMap, Map<String, Set<String>> viewTables, String... tableNames) {
Object value;
String str;
Intrinsics.checkNotNullParameter(database, "database");
Intrinsics.checkNotNullParameter(shadowTablesMap, "shadowTablesMap");
Intrinsics.checkNotNullParameter(viewTables, "viewTables");
Intrinsics.checkNotNullParameter(tableNames, "tableNames");
this.database = database;
this.shadowTablesMap = shadowTablesMap;
this.viewTables = viewTables;
this.pendingRefresh = new AtomicBoolean(false);
this.observedTableTracker = new ObservedTableTracker(tableNames.length);
this.invalidationLiveDataContainer = new InvalidationLiveDataContainer(database);
this.observerMap = new SafeIterableMap<>();
this.syncTriggersLock = new Object();
this.trackerLock = new Object();
this.tableIdLookup = new LinkedHashMap();
int length = tableNames.length;
String[] strArr = new String[length];
for (int i = 0; i < length; i++) {
String str2 = tableNames[i];
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String lowerCase = str2.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
this.tableIdLookup.put(lowerCase, Integer.valueOf(i));
String str3 = this.shadowTablesMap.get(tableNames[i]);
if (str3 != null) {
Intrinsics.checkNotNullExpressionValue(US, "US");
str = str3.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(str, "this as java.lang.String).toLowerCase(locale)");
} else {
str = null;
}
if (str != null) {
lowerCase = str;
}
strArr[i] = lowerCase;
}
this.tablesNames = strArr;
for (Map.Entry<String, String> entry : this.shadowTablesMap.entrySet()) {
String value2 = entry.getValue();
Locale US2 = Locale.US;
Intrinsics.checkNotNullExpressionValue(US2, "US");
String lowerCase2 = value2.toLowerCase(US2);
Intrinsics.checkNotNullExpressionValue(lowerCase2, "this as java.lang.String).toLowerCase(locale)");
if (this.tableIdLookup.containsKey(lowerCase2)) {
String key = entry.getKey();
Intrinsics.checkNotNullExpressionValue(US2, "US");
String lowerCase3 = key.toLowerCase(US2);
Intrinsics.checkNotNullExpressionValue(lowerCase3, "this as java.lang.String).toLowerCase(locale)");
Map<String, Integer> map = this.tableIdLookup;
value = MapsKt__MapsKt.getValue(map, lowerCase2);
map.put(lowerCase3, value);
}
}
this.refreshRunnable = new Runnable() { // from class: androidx.room.InvalidationTracker$refreshRunnable$1
/* JADX WARN: Code restructure failed: missing block: B:30:0x0080, code lost:
if (r0 != null) goto L26;
*/
/* JADX WARN: Code restructure failed: missing block: B:31:0x0082, code lost:
r0.decrementCountAndScheduleClose();
*/
/* JADX WARN: Code restructure failed: missing block: B:33:0x00c5, code lost:
if ((!r3.isEmpty()) == false) goto L59;
*/
/* JADX WARN: Code restructure failed: missing block: B:34:0x00c7, code lost:
r0 = r5.this$0.getObserverMap$room_runtime_release();
r1 = r5.this$0;
*/
/* JADX WARN: Code restructure failed: missing block: B:35:0x00cf, code lost:
monitor-enter(r0);
*/
/* JADX WARN: Code restructure failed: missing block: B:37:0x00d0, code lost:
r1 = r1.getObserverMap$room_runtime_release().iterator();
*/
/* JADX WARN: Code restructure failed: missing block: B:39:0x00dc, code lost:
if (r1.hasNext() == false) goto L69;
*/
/* JADX WARN: Code restructure failed: missing block: B:40:0x00de, code lost:
((androidx.room.InvalidationTracker.ObserverWrapper) ((java.util.Map.Entry) r1.next()).getValue()).notifyByTableInvalidStatus$room_runtime_release(r3);
*/
/* JADX WARN: Code restructure failed: missing block: B:42:0x00f0, code lost:
r1 = kotlin.Unit.INSTANCE;
*/
/* JADX WARN: Code restructure failed: missing block: B:43:0x00f2, code lost:
monitor-exit(r0);
*/
/* JADX WARN: Code restructure failed: missing block: B:44:?, code lost:
return;
*/
/* JADX WARN: Code restructure failed: missing block: B:46:0x00ee, code lost:
r1 = move-exception;
*/
/* JADX WARN: Code restructure failed: missing block: B:48:0x00f5, code lost:
throw r1;
*/
/* JADX WARN: Code restructure failed: missing block: B:49:0x00f6, code lost:
return;
*/
/* JADX WARN: Code restructure failed: missing block: B:62:0x00a6, code lost:
if (r0 == null) goto L44;
*/
/* JADX WARN: Code restructure failed: missing block: B:66:0x00bd, code lost:
if (r0 == null) goto L44;
*/
@Override // java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void run() {
/*
Method dump skipped, instructions count: 262
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.InvalidationTracker$refreshRunnable$1.run():void");
}
private final Set<Integer> checkUpdatedTable() {
Set createSetBuilder;
Set<Integer> build;
InvalidationTracker invalidationTracker = InvalidationTracker.this;
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
Cursor query$default = RoomDatabase.query$default(invalidationTracker.getDatabase$room_runtime_release(), new SimpleSQLiteQuery(InvalidationTracker.SELECT_UPDATED_TABLES_SQL), null, 2, null);
while (query$default.moveToNext()) {
try {
createSetBuilder.add(Integer.valueOf(query$default.getInt(0)));
} finally {
}
}
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(query$default, null);
build = SetsKt__SetsJVMKt.build(createSetBuilder);
if (!build.isEmpty()) {
if (InvalidationTracker.this.getCleanupStatement$room_runtime_release() == null) {
throw new IllegalStateException("Required value was null.".toString());
}
SupportSQLiteStatement cleanupStatement$room_runtime_release = InvalidationTracker.this.getCleanupStatement$room_runtime_release();
if (cleanupStatement$room_runtime_release == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
cleanupStatement$room_runtime_release.executeUpdateDelete();
}
return build;
}
};
}
/* JADX WARN: Illegal instructions before constructor call */
@androidx.annotation.RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public InvalidationTracker(androidx.room.RoomDatabase r4, java.lang.String... r5) {
/*
r3 = this;
java.lang.String r0 = "database"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r4, r0)
java.lang.String r0 = "tableNames"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r5, r0)
java.util.Map r0 = kotlin.collections.MapsKt.emptyMap()
java.util.Map r1 = kotlin.collections.MapsKt.emptyMap()
int r2 = r5.length
java.lang.Object[] r5 = java.util.Arrays.copyOf(r5, r2)
java.lang.String[] r5 = (java.lang.String[]) r5
r3.<init>(r4, r0, r1, r5)
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.InvalidationTracker.<init>(androidx.room.RoomDatabase, java.lang.String[]):void");
}
public final void setAutoCloser$room_runtime_release(AutoCloser autoCloser) {
Intrinsics.checkNotNullParameter(autoCloser, "autoCloser");
this.autoCloser = autoCloser;
autoCloser.setAutoCloseCallback(new Runnable() { // from class: androidx.room.InvalidationTracker$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
InvalidationTracker.this.onAutoCloseCallback();
}
});
}
public final void internalInit$room_runtime_release(SupportSQLiteDatabase database) {
Intrinsics.checkNotNullParameter(database, "database");
synchronized (this.trackerLock) {
if (this.initialized) {
Log.e(Room.LOG_TAG, "Invalidation tracker is initialized twice :/.");
return;
}
database.execSQL("PRAGMA temp_store = MEMORY;");
database.execSQL("PRAGMA recursive_triggers='ON';");
database.execSQL(CREATE_TRACKING_TABLE_SQL);
syncTriggers$room_runtime_release(database);
this.cleanupStatement = database.compileStatement(RESET_UPDATED_TABLES_SQL);
this.initialized = true;
Unit unit = Unit.INSTANCE;
}
}
/* JADX INFO: Access modifiers changed from: private */
public final void onAutoCloseCallback() {
synchronized (this.trackerLock) {
this.initialized = false;
this.observedTableTracker.resetTriggerState();
SupportSQLiteStatement supportSQLiteStatement = this.cleanupStatement;
if (supportSQLiteStatement != null) {
supportSQLiteStatement.close();
Unit unit = Unit.INSTANCE;
}
}
}
public final void startMultiInstanceInvalidation$room_runtime_release(Context context, String name, Intent serviceIntent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(serviceIntent, "serviceIntent");
this.multiInstanceInvalidationClient = new MultiInstanceInvalidationClient(context, name, serviceIntent, this, this.database.getQueryExecutor());
}
public final void stopMultiInstanceInvalidation$room_runtime_release() {
MultiInstanceInvalidationClient multiInstanceInvalidationClient = this.multiInstanceInvalidationClient;
if (multiInstanceInvalidationClient != null) {
multiInstanceInvalidationClient.stop();
}
this.multiInstanceInvalidationClient = null;
}
private final void stopTrackingTable(SupportSQLiteDatabase supportSQLiteDatabase, int i) {
String str = this.tablesNames[i];
for (String str2 : TRIGGERS) {
String str3 = "DROP TRIGGER IF EXISTS " + Companion.getTriggerName$room_runtime_release(str, str2);
Intrinsics.checkNotNullExpressionValue(str3, "StringBuilder().apply(builderAction).toString()");
supportSQLiteDatabase.execSQL(str3);
}
}
private final void startTrackingTable(SupportSQLiteDatabase supportSQLiteDatabase, int i) {
supportSQLiteDatabase.execSQL("INSERT OR IGNORE INTO room_table_modification_log VALUES(" + i + ", 0)");
String str = this.tablesNames[i];
for (String str2 : TRIGGERS) {
String str3 = "CREATE TEMP TRIGGER IF NOT EXISTS " + Companion.getTriggerName$room_runtime_release(str, str2) + " AFTER " + str2 + " ON `" + str + "` BEGIN UPDATE " + UPDATE_TABLE_NAME + " SET " + INVALIDATED_COLUMN_NAME + " = 1 WHERE " + TABLE_ID_COLUMN_NAME + " = " + i + " AND " + INVALIDATED_COLUMN_NAME + " = 0; END";
Intrinsics.checkNotNullExpressionValue(str3, "StringBuilder().apply(builderAction).toString()");
supportSQLiteDatabase.execSQL(str3);
}
}
@SuppressLint({"RestrictedApi"})
@WorkerThread
public void addObserver(Observer observer) {
int[] intArray;
ObserverWrapper putIfAbsent;
Intrinsics.checkNotNullParameter(observer, "observer");
String[] resolveViews = resolveViews(observer.getTables$room_runtime_release());
ArrayList arrayList = new ArrayList(resolveViews.length);
for (String str : resolveViews) {
Map<String, Integer> map = this.tableIdLookup;
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String lowerCase = str.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
Integer num = map.get(lowerCase);
if (num == null) {
throw new IllegalArgumentException("There is no table with name " + str);
}
arrayList.add(Integer.valueOf(num.intValue()));
}
intArray = CollectionsKt___CollectionsKt.toIntArray(arrayList);
ObserverWrapper observerWrapper = new ObserverWrapper(observer, intArray, resolveViews);
synchronized (this.observerMap) {
putIfAbsent = this.observerMap.putIfAbsent(observer, observerWrapper);
}
if (putIfAbsent == null && this.observedTableTracker.onAdded(Arrays.copyOf(intArray, intArray.length))) {
syncTriggers$room_runtime_release();
}
}
private final String[] validateAndResolveTableNames(String[] strArr) {
String[] resolveViews = resolveViews(strArr);
for (String str : resolveViews) {
Map<String, Integer> map = this.tableIdLookup;
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String lowerCase = str.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
if (!map.containsKey(lowerCase)) {
throw new IllegalArgumentException(("There is no table with name " + str).toString());
}
}
return resolveViews;
}
private final String[] resolveViews(String[] strArr) {
Set createSetBuilder;
Set build;
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
for (String str : strArr) {
Map<String, Set<String>> map = this.viewTables;
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String lowerCase = str.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
if (map.containsKey(lowerCase)) {
Map<String, Set<String>> map2 = this.viewTables;
Intrinsics.checkNotNullExpressionValue(US, "US");
String lowerCase2 = str.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(lowerCase2, "this as java.lang.String).toLowerCase(locale)");
Set<String> set = map2.get(lowerCase2);
Intrinsics.checkNotNull(set);
createSetBuilder.addAll(set);
} else {
createSetBuilder.add(str);
}
}
build = SetsKt__SetsJVMKt.build(createSetBuilder);
return (String[]) build.toArray(new String[0]);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void addWeakObserver(Observer observer) {
Intrinsics.checkNotNullParameter(observer, "observer");
addObserver(new WeakObserver(this, observer));
}
@SuppressLint({"RestrictedApi"})
@WorkerThread
public void removeObserver(Observer observer) {
ObserverWrapper remove;
Intrinsics.checkNotNullParameter(observer, "observer");
synchronized (this.observerMap) {
remove = this.observerMap.remove(observer);
}
if (remove != null) {
ObservedTableTracker observedTableTracker = this.observedTableTracker;
int[] tableIds$room_runtime_release = remove.getTableIds$room_runtime_release();
if (observedTableTracker.onRemoved(Arrays.copyOf(tableIds$room_runtime_release, tableIds$room_runtime_release.length))) {
syncTriggers$room_runtime_release();
}
}
}
public final boolean ensureInitialization$room_runtime_release() {
if (!this.database.isOpenInternal()) {
return false;
}
if (!this.initialized) {
this.database.getOpenHelper().getWritableDatabase();
}
if (this.initialized) {
return true;
}
Log.e(Room.LOG_TAG, "database is not initialized even though it is open");
return false;
}
public void refreshVersionsAsync() {
if (this.pendingRefresh.compareAndSet(false, true)) {
AutoCloser autoCloser = this.autoCloser;
if (autoCloser != null) {
autoCloser.incrementCountAndEnsureDbIsOpen();
}
this.database.getQueryExecutor().execute(this.refreshRunnable);
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@WorkerThread
public void refreshVersionsSync() {
AutoCloser autoCloser = this.autoCloser;
if (autoCloser != null) {
autoCloser.incrementCountAndEnsureDbIsOpen();
}
syncTriggers$room_runtime_release();
this.refreshRunnable.run();
}
@RestrictTo({RestrictTo.Scope.LIBRARY})
public final void notifyObserversByTableNames(String... tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
synchronized (this.observerMap) {
try {
Iterator<Map.Entry<K, V>> it = this.observerMap.iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Intrinsics.checkNotNullExpressionValue(entry, "(observer, wrapper)");
Observer observer = (Observer) entry.getKey();
ObserverWrapper observerWrapper = (ObserverWrapper) entry.getValue();
if (!observer.isRemote$room_runtime_release()) {
observerWrapper.notifyByTableNames$room_runtime_release(tables);
}
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public final void syncTriggers$room_runtime_release(SupportSQLiteDatabase database) {
Intrinsics.checkNotNullParameter(database, "database");
if (database.inTransaction()) {
return;
}
try {
Lock closeLock$room_runtime_release = this.database.getCloseLock$room_runtime_release();
closeLock$room_runtime_release.lock();
try {
synchronized (this.syncTriggersLock) {
int[] tablesToSync = this.observedTableTracker.getTablesToSync();
if (tablesToSync == null) {
return;
}
Companion.beginTransactionInternal$room_runtime_release(database);
try {
int length = tablesToSync.length;
int i = 0;
int i2 = 0;
while (i < length) {
int i3 = tablesToSync[i];
int i4 = i2 + 1;
if (i3 == 1) {
startTrackingTable(database, i2);
} else if (i3 == 2) {
stopTrackingTable(database, i2);
}
i++;
i2 = i4;
}
database.setTransactionSuccessful();
database.endTransaction();
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
database.endTransaction();
throw th;
}
}
} finally {
closeLock$room_runtime_release.unlock();
}
} catch (SQLiteException e) {
Log.e(Room.LOG_TAG, "Cannot run invalidation tracker. Is the db closed?", e);
} catch (IllegalStateException e2) {
Log.e(Room.LOG_TAG, "Cannot run invalidation tracker. Is the db closed?", e2);
}
}
public final void syncTriggers$room_runtime_release() {
if (this.database.isOpenInternal()) {
syncTriggers$room_runtime_release(this.database.getOpenHelper().getWritableDatabase());
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public <T> LiveData<T> createLiveData(String[] tableNames, Callable<T> computeFunction) {
Intrinsics.checkNotNullParameter(tableNames, "tableNames");
Intrinsics.checkNotNullParameter(computeFunction, "computeFunction");
return createLiveData(tableNames, false, computeFunction);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public <T> LiveData<T> createLiveData(String[] tableNames, boolean z, Callable<T> computeFunction) {
Intrinsics.checkNotNullParameter(tableNames, "tableNames");
Intrinsics.checkNotNullParameter(computeFunction, "computeFunction");
return this.invalidationLiveDataContainer.create(validateAndResolveTableNames(tableNames), z, computeFunction);
}
@SourceDebugExtension({"SMAP\nInvalidationTracker.kt\nKotlin\n*S Kotlin\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker$ObserverWrapper\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,840:1\n13674#2,3:841\n12744#2,2:844\n13579#2:846\n13579#2,2:847\n13580#2:849\n*S KotlinDebug\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker$ObserverWrapper\n*L\n612#1:841,3\n634#1:844,2\n640#1:846\n641#1:847,2\n640#1:849\n*E\n"})
public static final class ObserverWrapper {
private final Observer observer;
private final Set<String> singleTableSet;
private final int[] tableIds;
private final String[] tableNames;
public final Observer getObserver$room_runtime_release() {
return this.observer;
}
public final int[] getTableIds$room_runtime_release() {
return this.tableIds;
}
public ObserverWrapper(Observer observer, int[] tableIds, String[] tableNames) {
Set<String> emptySet;
Intrinsics.checkNotNullParameter(observer, "observer");
Intrinsics.checkNotNullParameter(tableIds, "tableIds");
Intrinsics.checkNotNullParameter(tableNames, "tableNames");
this.observer = observer;
this.tableIds = tableIds;
this.tableNames = tableNames;
if (!(tableNames.length == 0)) {
emptySet = SetsKt__SetsJVMKt.setOf(tableNames[0]);
} else {
emptySet = SetsKt__SetsKt.emptySet();
}
this.singleTableSet = emptySet;
if (tableIds.length != tableNames.length) {
throw new IllegalStateException("Check failed.".toString());
}
}
public final void notifyByTableInvalidStatus$room_runtime_release(Set<Integer> invalidatedTablesIds) {
Set<String> emptySet;
Set createSetBuilder;
Intrinsics.checkNotNullParameter(invalidatedTablesIds, "invalidatedTablesIds");
int[] iArr = this.tableIds;
int length = iArr.length;
if (length != 0) {
int i = 0;
if (length == 1) {
emptySet = invalidatedTablesIds.contains(Integer.valueOf(iArr[0])) ? this.singleTableSet : SetsKt__SetsKt.emptySet();
} else {
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
int[] iArr2 = this.tableIds;
int length2 = iArr2.length;
int i2 = 0;
while (i < length2) {
int i3 = i2 + 1;
if (invalidatedTablesIds.contains(Integer.valueOf(iArr2[i]))) {
createSetBuilder.add(this.tableNames[i2]);
}
i++;
i2 = i3;
}
emptySet = SetsKt__SetsJVMKt.build(createSetBuilder);
}
} else {
emptySet = SetsKt__SetsKt.emptySet();
}
if (!emptySet.isEmpty()) {
this.observer.onInvalidated(emptySet);
}
}
public final void notifyByTableNames$room_runtime_release(String[] tables) {
Set<String> emptySet;
boolean equals;
Set createSetBuilder;
boolean equals2;
Intrinsics.checkNotNullParameter(tables, "tables");
int length = this.tableNames.length;
if (length != 0) {
if (length != 1) {
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
for (String str : tables) {
for (String str2 : this.tableNames) {
equals2 = StringsKt__StringsJVMKt.equals(str2, str, true);
if (equals2) {
createSetBuilder.add(str2);
}
}
}
emptySet = SetsKt__SetsJVMKt.build(createSetBuilder);
} else {
int length2 = tables.length;
int i = 0;
while (true) {
if (i < length2) {
equals = StringsKt__StringsJVMKt.equals(tables[i], this.tableNames[0], true);
if (equals) {
emptySet = this.singleTableSet;
break;
}
i++;
} else {
emptySet = SetsKt__SetsKt.emptySet();
break;
}
}
}
} else {
emptySet = SetsKt__SetsKt.emptySet();
}
if (!emptySet.isEmpty()) {
this.observer.onInvalidated(emptySet);
}
}
}
@SourceDebugExtension({"SMAP\nInvalidationTracker.kt\nKotlin\n*S Kotlin\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker$Observer\n+ 2 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,840:1\n37#2,2:841\n*S KotlinDebug\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker$Observer\n*L\n670#1:841,2\n*E\n"})
public static abstract class Observer {
private final String[] tables;
public final String[] getTables$room_runtime_release() {
return this.tables;
}
public boolean isRemote$room_runtime_release() {
return false;
}
public abstract void onInvalidated(Set<String> set);
public Observer(String[] tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
this.tables = tables;
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public Observer(java.lang.String r3, java.lang.String... r4) {
/*
r2 = this;
java.lang.String r0 = "firstTable"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r3, r0)
java.lang.String r0 = "rest"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r4, r0)
java.util.List r0 = kotlin.collections.CollectionsKt.createListBuilder()
r1 = r0
java.util.Collection r1 = (java.util.Collection) r1
kotlin.collections.CollectionsKt.addAll(r1, r4)
r0.add(r3)
java.util.List r3 = kotlin.collections.CollectionsKt.build(r0)
java.util.Collection r3 = (java.util.Collection) r3
r4 = 0
java.lang.String[] r4 = new java.lang.String[r4]
java.lang.Object[] r3 = r3.toArray(r4)
java.lang.String[] r3 = (java.lang.String[]) r3
r2.<init>(r3)
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.InvalidationTracker.Observer.<init>(java.lang.String, java.lang.String[]):void");
}
}
@SourceDebugExtension({"SMAP\nInvalidationTracker.kt\nKotlin\n*S Kotlin\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker$ObservedTableTracker\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,840:1\n13600#2,2:841\n13600#2,2:843\n13684#2,3:845\n*S KotlinDebug\n*F\n+ 1 InvalidationTracker.kt\nandroidx/room/InvalidationTracker$ObservedTableTracker\n*L\n711#1:841,2\n729#1:843,2\n765#1:845,3\n*E\n"})
public static final class ObservedTableTracker {
public static final int ADD = 1;
public static final Companion Companion = new Companion(null);
public static final int NO_OP = 0;
public static final int REMOVE = 2;
private boolean needsSync;
private final long[] tableObservers;
private final int[] triggerStateChanges;
private final boolean[] triggerStates;
public final boolean getNeedsSync() {
return this.needsSync;
}
public final long[] getTableObservers() {
return this.tableObservers;
}
public final void setNeedsSync(boolean z) {
this.needsSync = z;
}
public ObservedTableTracker(int i) {
this.tableObservers = new long[i];
this.triggerStates = new boolean[i];
this.triggerStateChanges = new int[i];
}
public final boolean onAdded(int... tableIds) {
boolean z;
Intrinsics.checkNotNullParameter(tableIds, "tableIds");
synchronized (this) {
try {
z = false;
for (int i : tableIds) {
long[] jArr = this.tableObservers;
long j = jArr[i];
jArr[i] = 1 + j;
if (j == 0) {
z = true;
this.needsSync = true;
}
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
return z;
}
public final boolean onRemoved(int... tableIds) {
boolean z;
Intrinsics.checkNotNullParameter(tableIds, "tableIds");
synchronized (this) {
try {
z = false;
for (int i : tableIds) {
long[] jArr = this.tableObservers;
long j = jArr[i];
jArr[i] = j - 1;
if (j == 1) {
z = true;
this.needsSync = true;
}
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
return z;
}
public final void resetTriggerState() {
synchronized (this) {
Arrays.fill(this.triggerStates, false);
this.needsSync = true;
Unit unit = Unit.INSTANCE;
}
}
@VisibleForTesting
public final int[] getTablesToSync() {
synchronized (this) {
try {
if (!this.needsSync) {
return null;
}
long[] jArr = this.tableObservers;
int length = jArr.length;
int i = 0;
int i2 = 0;
while (i < length) {
int i3 = i2 + 1;
int i4 = 1;
boolean z = jArr[i] > 0;
boolean[] zArr = this.triggerStates;
if (z != zArr[i2]) {
int[] iArr = this.triggerStateChanges;
if (!z) {
i4 = 2;
}
iArr[i2] = i4;
} else {
this.triggerStateChanges[i2] = 0;
}
zArr[i2] = z;
i++;
i2 = i3;
}
this.needsSync = false;
return (int[]) this.triggerStateChanges.clone();
} catch (Throwable th) {
throw th;
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}
public static final class WeakObserver extends Observer {
private final WeakReference<Observer> delegateRef;
private final InvalidationTracker tracker;
public final WeakReference<Observer> getDelegateRef() {
return this.delegateRef;
}
public final InvalidationTracker getTracker() {
return this.tracker;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public WeakObserver(InvalidationTracker tracker, Observer delegate) {
super(delegate.getTables$room_runtime_release());
Intrinsics.checkNotNullParameter(tracker, "tracker");
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.tracker = tracker;
this.delegateRef = new WeakReference<>(delegate);
}
@Override // androidx.room.InvalidationTracker.Observer
public void onInvalidated(Set<String> tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
Observer observer = this.delegateRef.get();
if (observer == null) {
this.tracker.removeObserver(this);
} else {
observer.onInvalidated(tables);
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@VisibleForTesting
public static /* synthetic */ void getRESET_UPDATED_TABLES_SQL$room_runtime_release$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getSELECT_UPDATED_TABLES_SQL$room_runtime_release$annotations() {
}
private Companion() {
}
public final String getTriggerName$room_runtime_release(String tableName, String triggerType) {
Intrinsics.checkNotNullParameter(tableName, "tableName");
Intrinsics.checkNotNullParameter(triggerType, "triggerType");
return "`room_table_modification_trigger_" + tableName + '_' + triggerType + '`';
}
public final void beginTransactionInternal$room_runtime_release(SupportSQLiteDatabase database) {
Intrinsics.checkNotNullParameter(database, "database");
if (database.isWriteAheadLoggingEnabled()) {
database.beginTransactionNonExclusive();
} else {
database.beginTransaction();
}
}
}
}

View File

@@ -0,0 +1,16 @@
package androidx.room;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Junction {
String entityColumn() default "";
String parentColumn() default "";
Class<?> value();
}

View File

@@ -0,0 +1,15 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE_USE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface MapColumn {
String columnName();
String tableName() default "";
}

View File

@@ -0,0 +1,19 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface MapInfo {
String keyColumn() default "";
String keyTable() default "";
String valueColumn() default "";
String valueTable() default "";
}

View File

@@ -0,0 +1,35 @@
package androidx.room;
import androidx.room.IMultiInstanceInvalidationCallback;
import java.util.Arrays;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class MultiInstanceInvalidationClient$callback$1 extends IMultiInstanceInvalidationCallback.Stub {
final /* synthetic */ MultiInstanceInvalidationClient this$0;
public MultiInstanceInvalidationClient$callback$1(MultiInstanceInvalidationClient multiInstanceInvalidationClient) {
this.this$0 = multiInstanceInvalidationClient;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void onInvalidation$lambda$0(MultiInstanceInvalidationClient this$0, String[] tables) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(tables, "$tables");
this$0.getInvalidationTracker().notifyObserversByTableNames((String[]) Arrays.copyOf(tables, tables.length));
}
@Override // androidx.room.IMultiInstanceInvalidationCallback
public void onInvalidation(final String[] tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
Executor executor = this.this$0.getExecutor();
final MultiInstanceInvalidationClient multiInstanceInvalidationClient = this.this$0;
executor.execute(new Runnable() { // from class: androidx.room.MultiInstanceInvalidationClient$callback$1$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
MultiInstanceInvalidationClient$callback$1.onInvalidation$lambda$0(MultiInstanceInvalidationClient.this, tables);
}
});
}
}

View File

@@ -0,0 +1,197 @@
package androidx.room;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import androidx.room.IMultiInstanceInvalidationService;
import androidx.room.InvalidationTracker;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nMultiInstanceInvalidationClient.kt\nKotlin\n*S Kotlin\n*F\n+ 1 MultiInstanceInvalidationClient.kt\nandroidx/room/MultiInstanceInvalidationClient\n+ 2 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,130:1\n37#2,2:131\n*S KotlinDebug\n*F\n+ 1 MultiInstanceInvalidationClient.kt\nandroidx/room/MultiInstanceInvalidationClient\n*L\n95#1:131,2\n*E\n"})
/* loaded from: classes.dex */
public final class MultiInstanceInvalidationClient {
private final Context appContext;
private final IMultiInstanceInvalidationCallback callback;
private int clientId;
private final Executor executor;
private final InvalidationTracker invalidationTracker;
private final String name;
public InvalidationTracker.Observer observer;
private final Runnable removeObserverRunnable;
private IMultiInstanceInvalidationService service;
private final ServiceConnection serviceConnection;
private final Runnable setUpRunnable;
private final AtomicBoolean stopped;
public final IMultiInstanceInvalidationCallback getCallback() {
return this.callback;
}
public final int getClientId() {
return this.clientId;
}
public final Executor getExecutor() {
return this.executor;
}
public final InvalidationTracker getInvalidationTracker() {
return this.invalidationTracker;
}
public final String getName() {
return this.name;
}
public final Runnable getRemoveObserverRunnable() {
return this.removeObserverRunnable;
}
public final IMultiInstanceInvalidationService getService() {
return this.service;
}
public final ServiceConnection getServiceConnection() {
return this.serviceConnection;
}
public final Runnable getSetUpRunnable() {
return this.setUpRunnable;
}
public final AtomicBoolean getStopped() {
return this.stopped;
}
public final void setClientId(int i) {
this.clientId = i;
}
public final void setObserver(InvalidationTracker.Observer observer) {
Intrinsics.checkNotNullParameter(observer, "<set-?>");
this.observer = observer;
}
public final void setService(IMultiInstanceInvalidationService iMultiInstanceInvalidationService) {
this.service = iMultiInstanceInvalidationService;
}
public MultiInstanceInvalidationClient(Context context, String name, Intent serviceIntent, InvalidationTracker invalidationTracker, Executor executor) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(serviceIntent, "serviceIntent");
Intrinsics.checkNotNullParameter(invalidationTracker, "invalidationTracker");
Intrinsics.checkNotNullParameter(executor, "executor");
this.name = name;
this.invalidationTracker = invalidationTracker;
this.executor = executor;
Context applicationContext = context.getApplicationContext();
this.appContext = applicationContext;
this.callback = new MultiInstanceInvalidationClient$callback$1(this);
this.stopped = new AtomicBoolean(false);
ServiceConnection serviceConnection = new ServiceConnection() { // from class: androidx.room.MultiInstanceInvalidationClient$serviceConnection$1
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName name2, IBinder service) {
Intrinsics.checkNotNullParameter(name2, "name");
Intrinsics.checkNotNullParameter(service, "service");
MultiInstanceInvalidationClient.this.setService(IMultiInstanceInvalidationService.Stub.asInterface(service));
MultiInstanceInvalidationClient.this.getExecutor().execute(MultiInstanceInvalidationClient.this.getSetUpRunnable());
}
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName name2) {
Intrinsics.checkNotNullParameter(name2, "name");
MultiInstanceInvalidationClient.this.getExecutor().execute(MultiInstanceInvalidationClient.this.getRemoveObserverRunnable());
MultiInstanceInvalidationClient.this.setService(null);
}
};
this.serviceConnection = serviceConnection;
this.setUpRunnable = new Runnable() { // from class: androidx.room.MultiInstanceInvalidationClient$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
MultiInstanceInvalidationClient.setUpRunnable$lambda$1(MultiInstanceInvalidationClient.this);
}
};
this.removeObserverRunnable = new Runnable() { // from class: androidx.room.MultiInstanceInvalidationClient$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
MultiInstanceInvalidationClient.removeObserverRunnable$lambda$2(MultiInstanceInvalidationClient.this);
}
};
setObserver(new InvalidationTracker.Observer((String[]) invalidationTracker.getTableIdLookup$room_runtime_release().keySet().toArray(new String[0])) { // from class: androidx.room.MultiInstanceInvalidationClient.1
@Override // androidx.room.InvalidationTracker.Observer
public boolean isRemote$room_runtime_release() {
return true;
}
@Override // androidx.room.InvalidationTracker.Observer
public void onInvalidated(Set<String> tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
if (MultiInstanceInvalidationClient.this.getStopped().get()) {
return;
}
try {
IMultiInstanceInvalidationService service = MultiInstanceInvalidationClient.this.getService();
if (service != null) {
service.broadcastInvalidation(MultiInstanceInvalidationClient.this.getClientId(), (String[]) tables.toArray(new String[0]));
}
} catch (RemoteException e) {
Log.w(Room.LOG_TAG, "Cannot broadcast invalidation", e);
}
}
});
applicationContext.bindService(serviceIntent, serviceConnection, 1);
}
public final InvalidationTracker.Observer getObserver() {
InvalidationTracker.Observer observer = this.observer;
if (observer != null) {
return observer;
}
Intrinsics.throwUninitializedPropertyAccessException("observer");
return null;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void setUpRunnable$lambda$1(MultiInstanceInvalidationClient this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
try {
IMultiInstanceInvalidationService iMultiInstanceInvalidationService = this$0.service;
if (iMultiInstanceInvalidationService != null) {
this$0.clientId = iMultiInstanceInvalidationService.registerCallback(this$0.callback, this$0.name);
this$0.invalidationTracker.addObserver(this$0.getObserver());
}
} catch (RemoteException e) {
Log.w(Room.LOG_TAG, "Cannot register multi-instance invalidation callback", e);
}
}
/* JADX INFO: Access modifiers changed from: private */
public static final void removeObserverRunnable$lambda$2(MultiInstanceInvalidationClient this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.invalidationTracker.removeObserver(this$0.getObserver());
}
public final void stop() {
if (this.stopped.compareAndSet(false, true)) {
this.invalidationTracker.removeObserver(getObserver());
try {
IMultiInstanceInvalidationService iMultiInstanceInvalidationService = this.service;
if (iMultiInstanceInvalidationService != null) {
iMultiInstanceInvalidationService.unregisterCallback(this.callback, this.clientId);
}
} catch (RemoteException e) {
Log.w(Room.LOG_TAG, "Cannot unregister multi-instance invalidation callback", e);
}
this.appContext.unbindService(this.serviceConnection);
}
}
}

View File

@@ -0,0 +1,124 @@
package androidx.room;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.util.Log;
import androidx.room.IMultiInstanceInvalidationService;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
@ExperimentalRoomApi
/* loaded from: classes.dex */
public final class MultiInstanceInvalidationService extends Service {
private int maxClientId;
private final Map<Integer, String> clientNames = new LinkedHashMap();
private final RemoteCallbackList<IMultiInstanceInvalidationCallback> callbackList = new RemoteCallbackList<IMultiInstanceInvalidationCallback>() { // from class: androidx.room.MultiInstanceInvalidationService$callbackList$1
@Override // android.os.RemoteCallbackList
public void onCallbackDied(IMultiInstanceInvalidationCallback callback, Object cookie) {
Intrinsics.checkNotNullParameter(callback, "callback");
Intrinsics.checkNotNullParameter(cookie, "cookie");
MultiInstanceInvalidationService.this.getClientNames$room_runtime_release().remove((Integer) cookie);
}
};
private final IMultiInstanceInvalidationService.Stub binder = new IMultiInstanceInvalidationService.Stub() { // from class: androidx.room.MultiInstanceInvalidationService$binder$1
@Override // androidx.room.IMultiInstanceInvalidationService
public int registerCallback(IMultiInstanceInvalidationCallback callback, String str) {
Intrinsics.checkNotNullParameter(callback, "callback");
int i = 0;
if (str == null) {
return 0;
}
RemoteCallbackList<IMultiInstanceInvalidationCallback> callbackList$room_runtime_release = MultiInstanceInvalidationService.this.getCallbackList$room_runtime_release();
MultiInstanceInvalidationService multiInstanceInvalidationService = MultiInstanceInvalidationService.this;
synchronized (callbackList$room_runtime_release) {
try {
multiInstanceInvalidationService.setMaxClientId$room_runtime_release(multiInstanceInvalidationService.getMaxClientId$room_runtime_release() + 1);
int maxClientId$room_runtime_release = multiInstanceInvalidationService.getMaxClientId$room_runtime_release();
if (multiInstanceInvalidationService.getCallbackList$room_runtime_release().register(callback, Integer.valueOf(maxClientId$room_runtime_release))) {
multiInstanceInvalidationService.getClientNames$room_runtime_release().put(Integer.valueOf(maxClientId$room_runtime_release), str);
i = maxClientId$room_runtime_release;
} else {
multiInstanceInvalidationService.setMaxClientId$room_runtime_release(multiInstanceInvalidationService.getMaxClientId$room_runtime_release() - 1);
multiInstanceInvalidationService.getMaxClientId$room_runtime_release();
}
} catch (Throwable th) {
throw th;
}
}
return i;
}
@Override // androidx.room.IMultiInstanceInvalidationService
public void unregisterCallback(IMultiInstanceInvalidationCallback callback, int i) {
Intrinsics.checkNotNullParameter(callback, "callback");
RemoteCallbackList<IMultiInstanceInvalidationCallback> callbackList$room_runtime_release = MultiInstanceInvalidationService.this.getCallbackList$room_runtime_release();
MultiInstanceInvalidationService multiInstanceInvalidationService = MultiInstanceInvalidationService.this;
synchronized (callbackList$room_runtime_release) {
multiInstanceInvalidationService.getCallbackList$room_runtime_release().unregister(callback);
multiInstanceInvalidationService.getClientNames$room_runtime_release().remove(Integer.valueOf(i));
}
}
@Override // androidx.room.IMultiInstanceInvalidationService
public void broadcastInvalidation(int i, String[] tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
RemoteCallbackList<IMultiInstanceInvalidationCallback> callbackList$room_runtime_release = MultiInstanceInvalidationService.this.getCallbackList$room_runtime_release();
MultiInstanceInvalidationService multiInstanceInvalidationService = MultiInstanceInvalidationService.this;
synchronized (callbackList$room_runtime_release) {
String str = multiInstanceInvalidationService.getClientNames$room_runtime_release().get(Integer.valueOf(i));
if (str == null) {
Log.w(Room.LOG_TAG, "Remote invalidation client ID not registered");
return;
}
int beginBroadcast = multiInstanceInvalidationService.getCallbackList$room_runtime_release().beginBroadcast();
for (int i2 = 0; i2 < beginBroadcast; i2++) {
try {
Object broadcastCookie = multiInstanceInvalidationService.getCallbackList$room_runtime_release().getBroadcastCookie(i2);
Intrinsics.checkNotNull(broadcastCookie, "null cannot be cast to non-null type kotlin.Int");
int intValue = ((Integer) broadcastCookie).intValue();
String str2 = multiInstanceInvalidationService.getClientNames$room_runtime_release().get(Integer.valueOf(intValue));
if (i != intValue && Intrinsics.areEqual(str, str2)) {
try {
multiInstanceInvalidationService.getCallbackList$room_runtime_release().getBroadcastItem(i2).onInvalidation(tables);
} catch (RemoteException e) {
Log.w(Room.LOG_TAG, "Error invoking a remote callback", e);
}
}
} catch (Throwable th) {
multiInstanceInvalidationService.getCallbackList$room_runtime_release().finishBroadcast();
throw th;
}
}
multiInstanceInvalidationService.getCallbackList$room_runtime_release().finishBroadcast();
Unit unit = Unit.INSTANCE;
}
}
};
public final RemoteCallbackList<IMultiInstanceInvalidationCallback> getCallbackList$room_runtime_release() {
return this.callbackList;
}
public final Map<Integer, String> getClientNames$room_runtime_release() {
return this.clientNames;
}
public final int getMaxClientId$room_runtime_release() {
return this.maxClientId;
}
@Override // android.app.Service
public IBinder onBind(Intent intent) {
Intrinsics.checkNotNullParameter(intent, "intent");
return this.binder;
}
public final void setMaxClientId$room_runtime_release(int i) {
this.maxClientId = i;
}
}

View File

@@ -0,0 +1,35 @@
package androidx.room;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface OnConflictStrategy {
public static final int ABORT = 3;
public static final Companion Companion = Companion.$$INSTANCE;
public static final int FAIL = 4;
public static final int IGNORE = 5;
public static final int NONE = 0;
public static final int REPLACE = 1;
public static final int ROLLBACK = 2;
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public static final int ABORT = 3;
public static final int FAIL = 4;
public static final int IGNORE = 5;
public static final int NONE = 0;
public static final int REPLACE = 1;
public static final int ROLLBACK = 2;
public static /* synthetic */ void getFAIL$annotations() {
}
public static /* synthetic */ void getROLLBACK$annotations() {
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,13 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface PrimaryKey {
boolean autoGenerate() default false;
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface ProvidedAutoMigrationSpec {
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface ProvidedTypeConverter {
}

View File

@@ -0,0 +1,13 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Query {
String value();
}

View File

@@ -0,0 +1,431 @@
package androidx.room;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteTransactionListener;
import android.os.CancellationSignal;
import android.util.Pair;
import androidx.annotation.RequiresApi;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.Executor;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nQueryInterceptorDatabase.kt\nKotlin\n*S Kotlin\n*F\n+ 1 QueryInterceptorDatabase.kt\nandroidx/room/QueryInterceptorDatabase\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,146:1\n1#2:147\n37#3,2:148\n*S KotlinDebug\n*F\n+ 1 QueryInterceptorDatabase.kt\nandroidx/room/QueryInterceptorDatabase\n*L\n143#1:148,2\n*E\n"})
/* loaded from: classes.dex */
public final class QueryInterceptorDatabase implements SupportSQLiteDatabase {
private final SupportSQLiteDatabase delegate;
private final RoomDatabase.QueryCallback queryCallback;
private final Executor queryCallbackExecutor;
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.delegate.close();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int delete(String table, String str, Object[] objArr) {
Intrinsics.checkNotNullParameter(table, "table");
return this.delegate.delete(table, str, objArr);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public void disableWriteAheadLogging() {
this.delegate.disableWriteAheadLogging();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean enableWriteAheadLogging() {
return this.delegate.enableWriteAheadLogging();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execPerConnectionSQL(String sql, @SuppressLint({"ArrayReturn"}) Object[] objArr) {
Intrinsics.checkNotNullParameter(sql, "sql");
this.delegate.execPerConnectionSQL(sql, objArr);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public List<Pair<String, String>> getAttachedDbs() {
return this.delegate.getAttachedDbs();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long getMaximumSize() {
return this.delegate.getMaximumSize();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long getPageSize() {
return this.delegate.getPageSize();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public String getPath() {
return this.delegate.getPath();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int getVersion() {
return this.delegate.getVersion();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean inTransaction() {
return this.delegate.inTransaction();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long insert(String table, int i, ContentValues values) {
Intrinsics.checkNotNullParameter(table, "table");
Intrinsics.checkNotNullParameter(values, "values");
return this.delegate.insert(table, i, values);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isDatabaseIntegrityOk() {
return this.delegate.isDatabaseIntegrityOk();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isDbLockedByCurrentThread() {
return this.delegate.isDbLockedByCurrentThread();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isExecPerConnectionSQLSupported() {
return this.delegate.isExecPerConnectionSQLSupported();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isOpen() {
return this.delegate.isOpen();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isReadOnly() {
return this.delegate.isReadOnly();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public boolean isWriteAheadLoggingEnabled() {
return this.delegate.isWriteAheadLoggingEnabled();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean needUpgrade(int i) {
return this.delegate.needUpgrade(i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public void setForeignKeyConstraintsEnabled(boolean z) {
this.delegate.setForeignKeyConstraintsEnabled(z);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setLocale(Locale locale) {
Intrinsics.checkNotNullParameter(locale, "locale");
this.delegate.setLocale(locale);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setMaxSqlCacheSize(int i) {
this.delegate.setMaxSqlCacheSize(i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long setMaximumSize(long j) {
return this.delegate.setMaximumSize(j);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setPageSize(long j) {
this.delegate.setPageSize(j);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setVersion(int i) {
this.delegate.setVersion(i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int update(String table, int i, ContentValues values, String str, Object[] objArr) {
Intrinsics.checkNotNullParameter(table, "table");
Intrinsics.checkNotNullParameter(values, "values");
return this.delegate.update(table, i, values, str, objArr);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean yieldIfContendedSafely() {
return this.delegate.yieldIfContendedSafely();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean yieldIfContendedSafely(long j) {
return this.delegate.yieldIfContendedSafely(j);
}
public QueryInterceptorDatabase(SupportSQLiteDatabase delegate, Executor queryCallbackExecutor, RoomDatabase.QueryCallback queryCallback) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(queryCallbackExecutor, "queryCallbackExecutor");
Intrinsics.checkNotNullParameter(queryCallback, "queryCallback");
this.delegate = delegate;
this.queryCallbackExecutor = queryCallbackExecutor;
this.queryCallback = queryCallback;
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public SupportSQLiteStatement compileStatement(String sql) {
Intrinsics.checkNotNullParameter(sql, "sql");
return new QueryInterceptorStatement(this.delegate.compileStatement(sql), sql, this.queryCallbackExecutor, this.queryCallback);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransaction() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda6
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.beginTransaction$lambda$0(QueryInterceptorDatabase.this);
}
});
this.delegate.beginTransaction();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void beginTransaction$lambda$0(QueryInterceptorDatabase this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery("BEGIN EXCLUSIVE TRANSACTION", CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionNonExclusive() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.beginTransactionNonExclusive$lambda$1(QueryInterceptorDatabase.this);
}
});
this.delegate.beginTransactionNonExclusive();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void beginTransactionNonExclusive$lambda$1(QueryInterceptorDatabase this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery("BEGIN DEFERRED TRANSACTION", CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionWithListener(SQLiteTransactionListener transactionListener) {
Intrinsics.checkNotNullParameter(transactionListener, "transactionListener");
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda11
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.beginTransactionWithListener$lambda$2(QueryInterceptorDatabase.this);
}
});
this.delegate.beginTransactionWithListener(transactionListener);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void beginTransactionWithListener$lambda$2(QueryInterceptorDatabase this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery("BEGIN EXCLUSIVE TRANSACTION", CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionWithListenerNonExclusive(SQLiteTransactionListener transactionListener) {
Intrinsics.checkNotNullParameter(transactionListener, "transactionListener");
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda4
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.beginTransactionWithListenerNonExclusive$lambda$3(QueryInterceptorDatabase.this);
}
});
this.delegate.beginTransactionWithListenerNonExclusive(transactionListener);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void beginTransactionWithListenerNonExclusive$lambda$3(QueryInterceptorDatabase this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery("BEGIN DEFERRED TRANSACTION", CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void endTransaction() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda8
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.endTransaction$lambda$4(QueryInterceptorDatabase.this);
}
});
this.delegate.endTransaction();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void endTransaction$lambda$4(QueryInterceptorDatabase this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery("END TRANSACTION", CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setTransactionSuccessful() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.setTransactionSuccessful$lambda$5(QueryInterceptorDatabase.this);
}
});
this.delegate.setTransactionSuccessful();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void setTransactionSuccessful$lambda$5(QueryInterceptorDatabase this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery("TRANSACTION SUCCESSFUL", CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(final String query) {
Intrinsics.checkNotNullParameter(query, "query");
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda7
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.query$lambda$6(QueryInterceptorDatabase.this, query);
}
});
return this.delegate.query(query);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void query$lambda$6(QueryInterceptorDatabase this$0, String query) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(query, "$query");
this$0.queryCallback.onQuery(query, CollectionsKt__CollectionsKt.emptyList());
}
/* JADX INFO: Access modifiers changed from: private */
public static final void query$lambda$7(QueryInterceptorDatabase this$0, String query, Object[] bindArgs) {
List<? extends Object> list;
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(query, "$query");
Intrinsics.checkNotNullParameter(bindArgs, "$bindArgs");
RoomDatabase.QueryCallback queryCallback = this$0.queryCallback;
list = ArraysKt___ArraysKt.toList(bindArgs);
queryCallback.onQuery(query, list);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(final String query, final Object[] bindArgs) {
Intrinsics.checkNotNullParameter(query, "query");
Intrinsics.checkNotNullParameter(bindArgs, "bindArgs");
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.query$lambda$7(QueryInterceptorDatabase.this, query, bindArgs);
}
});
return this.delegate.query(query, bindArgs);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(final SupportSQLiteQuery query) {
Intrinsics.checkNotNullParameter(query, "query");
final QueryInterceptorProgram queryInterceptorProgram = new QueryInterceptorProgram();
query.bindTo(queryInterceptorProgram);
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda5
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.query$lambda$8(QueryInterceptorDatabase.this, query, queryInterceptorProgram);
}
});
return this.delegate.query(query);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void query$lambda$8(QueryInterceptorDatabase this$0, SupportSQLiteQuery query, QueryInterceptorProgram queryInterceptorProgram) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(query, "$query");
Intrinsics.checkNotNullParameter(queryInterceptorProgram, "$queryInterceptorProgram");
this$0.queryCallback.onQuery(query.getSql(), queryInterceptorProgram.getBindArgsCache$room_runtime_release());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(final SupportSQLiteQuery query, CancellationSignal cancellationSignal) {
Intrinsics.checkNotNullParameter(query, "query");
final QueryInterceptorProgram queryInterceptorProgram = new QueryInterceptorProgram();
query.bindTo(queryInterceptorProgram);
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.query$lambda$9(QueryInterceptorDatabase.this, query, queryInterceptorProgram);
}
});
return this.delegate.query(query);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void query$lambda$9(QueryInterceptorDatabase this$0, SupportSQLiteQuery query, QueryInterceptorProgram queryInterceptorProgram) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(query, "$query");
Intrinsics.checkNotNullParameter(queryInterceptorProgram, "$queryInterceptorProgram");
this$0.queryCallback.onQuery(query.getSql(), queryInterceptorProgram.getBindArgsCache$room_runtime_release());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execSQL(final String sql) {
Intrinsics.checkNotNullParameter(sql, "sql");
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda10
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.execSQL$lambda$10(QueryInterceptorDatabase.this, sql);
}
});
this.delegate.execSQL(sql);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void execSQL$lambda$10(QueryInterceptorDatabase this$0, String sql) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(sql, "$sql");
this$0.queryCallback.onQuery(sql, CollectionsKt__CollectionsKt.emptyList());
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execSQL(final String sql, Object[] bindArgs) {
List createListBuilder;
final List build;
Intrinsics.checkNotNullParameter(sql, "sql");
Intrinsics.checkNotNullParameter(bindArgs, "bindArgs");
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
CollectionsKt__MutableCollectionsKt.addAll(createListBuilder, bindArgs);
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorDatabase$$ExternalSyntheticLambda9
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorDatabase.execSQL$lambda$12(QueryInterceptorDatabase.this, sql, build);
}
});
this.delegate.execSQL(sql, build.toArray(new Object[0]));
}
/* JADX INFO: Access modifiers changed from: private */
public static final void execSQL$lambda$12(QueryInterceptorDatabase this$0, String sql, List inputArguments) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(sql, "$sql");
Intrinsics.checkNotNullParameter(inputArguments, "$inputArguments");
this$0.queryCallback.onQuery(sql, inputArguments);
}
}

View File

@@ -0,0 +1,55 @@
package androidx.room;
import androidx.annotation.RequiresApi;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class QueryInterceptorOpenHelper implements SupportSQLiteOpenHelper, DelegatingOpenHelper {
private final SupportSQLiteOpenHelper delegate;
private final RoomDatabase.QueryCallback queryCallback;
private final Executor queryCallbackExecutor;
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper, java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.delegate.close();
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public String getDatabaseName() {
return this.delegate.getDatabaseName();
}
@Override // androidx.room.DelegatingOpenHelper
public SupportSQLiteOpenHelper getDelegate() {
return this.delegate;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
@RequiresApi(api = 16)
public void setWriteAheadLoggingEnabled(boolean z) {
this.delegate.setWriteAheadLoggingEnabled(z);
}
public QueryInterceptorOpenHelper(SupportSQLiteOpenHelper delegate, Executor queryCallbackExecutor, RoomDatabase.QueryCallback queryCallback) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(queryCallbackExecutor, "queryCallbackExecutor");
Intrinsics.checkNotNullParameter(queryCallback, "queryCallback");
this.delegate = delegate;
this.queryCallbackExecutor = queryCallbackExecutor;
this.queryCallback = queryCallback;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public SupportSQLiteDatabase getWritableDatabase() {
return new QueryInterceptorDatabase(getDelegate().getWritableDatabase(), this.queryCallbackExecutor, this.queryCallback);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public SupportSQLiteDatabase getReadableDatabase() {
return new QueryInterceptorDatabase(getDelegate().getReadableDatabase(), this.queryCallbackExecutor, this.queryCallback);
}
}

View File

@@ -0,0 +1,28 @@
package androidx.room;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class QueryInterceptorOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
private final SupportSQLiteOpenHelper.Factory delegate;
private final RoomDatabase.QueryCallback queryCallback;
private final Executor queryCallbackExecutor;
public QueryInterceptorOpenHelperFactory(SupportSQLiteOpenHelper.Factory delegate, Executor queryCallbackExecutor, RoomDatabase.QueryCallback queryCallback) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(queryCallbackExecutor, "queryCallbackExecutor");
Intrinsics.checkNotNullParameter(queryCallback, "queryCallback");
this.delegate = delegate;
this.queryCallbackExecutor = queryCallbackExecutor;
this.queryCallback = queryCallback;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Factory
public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
return new QueryInterceptorOpenHelper(this.delegate.create(configuration), this.queryCallbackExecutor, this.queryCallback);
}
}

View File

@@ -0,0 +1,67 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteProgram;
import java.util.ArrayList;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class QueryInterceptorProgram implements SupportSQLiteProgram {
private final List<Object> bindArgsCache = new ArrayList();
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
}
public final List<Object> getBindArgsCache$room_runtime_release() {
return this.bindArgsCache;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindNull(int i) {
saveArgsToCache(i, null);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindLong(int i, long j) {
saveArgsToCache(i, Long.valueOf(j));
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindDouble(int i, double d) {
saveArgsToCache(i, Double.valueOf(d));
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindString(int i, String value) {
Intrinsics.checkNotNullParameter(value, "value");
saveArgsToCache(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindBlob(int i, byte[] value) {
Intrinsics.checkNotNullParameter(value, "value");
saveArgsToCache(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void clearBindings() {
this.bindArgsCache.clear();
}
private final void saveArgsToCache(int i, Object obj) {
int size;
int i2 = i - 1;
if (i2 >= this.bindArgsCache.size() && (size = this.bindArgsCache.size()) <= i2) {
while (true) {
this.bindArgsCache.add(null);
if (size == i2) {
break;
} else {
size++;
}
}
}
this.bindArgsCache.set(i2, obj);
}
}

View File

@@ -0,0 +1,168 @@
package androidx.room;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class QueryInterceptorStatement implements SupportSQLiteStatement {
private final List<Object> bindArgsCache;
private final SupportSQLiteStatement delegate;
private final RoomDatabase.QueryCallback queryCallback;
private final Executor queryCallbackExecutor;
private final String sqlStatement;
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.delegate.close();
}
public QueryInterceptorStatement(SupportSQLiteStatement delegate, String sqlStatement, Executor queryCallbackExecutor, RoomDatabase.QueryCallback queryCallback) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(sqlStatement, "sqlStatement");
Intrinsics.checkNotNullParameter(queryCallbackExecutor, "queryCallbackExecutor");
Intrinsics.checkNotNullParameter(queryCallback, "queryCallback");
this.delegate = delegate;
this.sqlStatement = sqlStatement;
this.queryCallbackExecutor = queryCallbackExecutor;
this.queryCallback = queryCallback;
this.bindArgsCache = new ArrayList();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public void execute() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorStatement$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorStatement.execute$lambda$0(QueryInterceptorStatement.this);
}
});
this.delegate.execute();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void execute$lambda$0(QueryInterceptorStatement this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery(this$0.sqlStatement, this$0.bindArgsCache);
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public int executeUpdateDelete() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorStatement$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorStatement.executeUpdateDelete$lambda$1(QueryInterceptorStatement.this);
}
});
return this.delegate.executeUpdateDelete();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void executeUpdateDelete$lambda$1(QueryInterceptorStatement this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery(this$0.sqlStatement, this$0.bindArgsCache);
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public long executeInsert() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorStatement$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorStatement.executeInsert$lambda$2(QueryInterceptorStatement.this);
}
});
return this.delegate.executeInsert();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void executeInsert$lambda$2(QueryInterceptorStatement this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery(this$0.sqlStatement, this$0.bindArgsCache);
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public long simpleQueryForLong() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorStatement$$ExternalSyntheticLambda4
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorStatement.simpleQueryForLong$lambda$3(QueryInterceptorStatement.this);
}
});
return this.delegate.simpleQueryForLong();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void simpleQueryForLong$lambda$3(QueryInterceptorStatement this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery(this$0.sqlStatement, this$0.bindArgsCache);
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public String simpleQueryForString() {
this.queryCallbackExecutor.execute(new Runnable() { // from class: androidx.room.QueryInterceptorStatement$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
QueryInterceptorStatement.simpleQueryForString$lambda$4(QueryInterceptorStatement.this);
}
});
return this.delegate.simpleQueryForString();
}
/* JADX INFO: Access modifiers changed from: private */
public static final void simpleQueryForString$lambda$4(QueryInterceptorStatement this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.queryCallback.onQuery(this$0.sqlStatement, this$0.bindArgsCache);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindNull(int i) {
saveArgsToCache(i, null);
this.delegate.bindNull(i);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindLong(int i, long j) {
saveArgsToCache(i, Long.valueOf(j));
this.delegate.bindLong(i, j);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindDouble(int i, double d) {
saveArgsToCache(i, Double.valueOf(d));
this.delegate.bindDouble(i, d);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindString(int i, String value) {
Intrinsics.checkNotNullParameter(value, "value");
saveArgsToCache(i, value);
this.delegate.bindString(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindBlob(int i, byte[] value) {
Intrinsics.checkNotNullParameter(value, "value");
saveArgsToCache(i, value);
this.delegate.bindBlob(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void clearBindings() {
this.bindArgsCache.clear();
this.delegate.clearBindings();
}
private final void saveArgsToCache(int i, Object obj) {
int i2 = i - 1;
if (i2 >= this.bindArgsCache.size()) {
int size = (i2 - this.bindArgsCache.size()) + 1;
for (int i3 = 0; i3 < size; i3++) {
this.bindArgsCache.add(null);
}
}
this.bindArgsCache.set(i2, obj);
}
}

View File

@@ -0,0 +1,7 @@
package androidx.room;
/* loaded from: classes.dex */
public final class R {
private R() {
}
}

View File

@@ -0,0 +1,13 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface RawQuery {
Class<?>[] observedEntities() default {};
}

View File

@@ -0,0 +1,21 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Relation {
Junction associateBy() default @Junction(Object.class);
Class<?> entity() default Object.class;
String entityColumn();
String parentColumn();
String[] projection() default {};
}

View File

@@ -0,0 +1,26 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Repeatable(Entries.class)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface RenameColumn {
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Entries {
RenameColumn[] value();
}
String fromColumnName();
String tableName();
String toColumnName();
}

View File

@@ -0,0 +1,24 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Repeatable(Entries.class)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface RenameTable {
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Entries {
RenameTable[] value();
}
String fromTableName();
String toTableName();
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface RewriteQueriesToDropUnusedColumns {
}

View File

@@ -0,0 +1,73 @@
package androidx.room;
import android.content.Context;
import androidx.annotation.RestrictTo;
import androidx.room.RoomDatabase;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
/* loaded from: classes.dex */
public final class Room {
private static final String CURSOR_CONV_SUFFIX = "_CursorConverter";
public static final Room INSTANCE = new Room();
public static final String LOG_TAG = "ROOM";
public static final String MASTER_TABLE_NAME = "room_master_table";
private Room() {
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final <T, C> T getGeneratedImplementation(Class<C> klass, String suffix) {
String replace$default;
String str;
Intrinsics.checkNotNullParameter(klass, "klass");
Intrinsics.checkNotNullParameter(suffix, "suffix");
Package r0 = klass.getPackage();
Intrinsics.checkNotNull(r0);
String fullPackage = r0.getName();
String canonicalName = klass.getCanonicalName();
Intrinsics.checkNotNull(canonicalName);
Intrinsics.checkNotNullExpressionValue(fullPackage, "fullPackage");
if (fullPackage.length() != 0) {
canonicalName = canonicalName.substring(fullPackage.length() + 1);
Intrinsics.checkNotNullExpressionValue(canonicalName, "this as java.lang.String).substring(startIndex)");
}
String str2 = canonicalName;
StringBuilder sb = new StringBuilder();
replace$default = StringsKt__StringsJVMKt.replace$default(str2, '.', '_', false, 4, (Object) null);
sb.append(replace$default);
sb.append(suffix);
String sb2 = sb.toString();
try {
if (fullPackage.length() == 0) {
str = sb2;
} else {
str = fullPackage + '.' + sb2;
}
Class<?> cls = Class.forName(str, true, klass.getClassLoader());
Intrinsics.checkNotNull(cls, "null cannot be cast to non-null type java.lang.Class<T of androidx.room.Room.getGeneratedImplementation>");
return (T) cls.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
} catch (ClassNotFoundException unused) {
throw new RuntimeException("Cannot find implementation for " + klass.getCanonicalName() + ". " + sb2 + " does not exist");
} catch (IllegalAccessException unused2) {
throw new RuntimeException("Cannot access the constructor " + klass.getCanonicalName());
} catch (InstantiationException unused3) {
throw new RuntimeException("Failed to create an instance of " + klass.getCanonicalName());
}
}
public static final <T extends RoomDatabase> RoomDatabase.Builder<T> inMemoryDatabaseBuilder(Context context, Class<T> klass) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(klass, "klass");
return new RoomDatabase.Builder<>(context, klass, null);
}
public static final <T extends RoomDatabase> RoomDatabase.Builder<T> databaseBuilder(Context context, Class<T> klass, String str) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(klass, "klass");
if (!(true ^ (str == null || StringsKt__StringsJVMKt.isBlank(str)))) {
throw new IllegalArgumentException("Cannot build a database with null or empty name. If you are trying to create an in memory database, use Room.inMemoryDatabaseBuilder".toString());
}
return new RoomDatabase.Builder<>(context, klass, str);
}
}

View File

@@ -0,0 +1,993 @@
package androidx.room;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.CancellationSignal;
import android.os.Looper;
import android.util.Log;
import androidx.annotation.CallSuper;
import androidx.annotation.IntRange;
import androidx.annotation.RestrictTo;
import androidx.annotation.WorkerThread;
import androidx.arch.core.executor.ArchTaskExecutor;
import androidx.room.migration.AutoMigrationSpec;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SimpleSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteCompat;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import androidx.sqlite.db.SupportSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteStatement;
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nRoomDatabase.kt\nKotlin\n*S Kotlin\n*F\n+ 1 RoomDatabase.kt\nandroidx/room/RoomDatabase\n+ 2 _Maps.kt\nkotlin/collections/MapsKt___MapsKt\n*L\n1#1,1548:1\n215#2,2:1549\n*S KotlinDebug\n*F\n+ 1 RoomDatabase.kt\nandroidx/room/RoomDatabase\n*L\n261#1:1549,2\n*E\n"})
/* loaded from: classes.dex */
public abstract class RoomDatabase {
public static final Companion Companion = new Companion(null);
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public static final int MAX_BIND_PARAMETER_CNT = 999;
private boolean allowMainThreadQueries;
private AutoCloser autoCloser;
private final Map<String, Object> backingFieldMap;
private SupportSQLiteOpenHelper internalOpenHelper;
private Executor internalQueryExecutor;
private Executor internalTransactionExecutor;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
protected List<? extends Callback> mCallbacks;
protected volatile SupportSQLiteDatabase mDatabase;
private final Map<Class<?>, Object> typeConverters;
private boolean writeAheadLoggingEnabled;
private final InvalidationTracker invalidationTracker = createInvalidationTracker();
private Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> autoMigrationSpecs = new LinkedHashMap();
private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
private final ThreadLocal<Integer> suspendingTransactionId = new ThreadLocal<>();
public static abstract class Callback {
public void onCreate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
public void onDestructiveMigration(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
public void onOpen(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
}
public static abstract class PrepackagedDatabaseCallback {
public void onOpenPrepackagedDatabase(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
}
public interface QueryCallback {
void onQuery(String str, List<? extends Object> list);
}
public static /* synthetic */ void getMCallbacks$annotations() {
}
public static /* synthetic */ void getMDatabase$annotations() {
}
public static /* synthetic */ void isOpen$annotations() {
}
public static /* synthetic */ void isOpenInternal$annotations() {
}
@WorkerThread
public abstract void clearAllTables();
public abstract InvalidationTracker createInvalidationTracker();
public abstract SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration databaseConfiguration);
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> getAutoMigrationSpecs() {
return this.autoMigrationSpecs;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final Map<String, Object> getBackingFieldMap() {
return this.backingFieldMap;
}
public InvalidationTracker getInvalidationTracker() {
return this.invalidationTracker;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final ThreadLocal<Integer> getSuspendingTransactionId() {
return this.suspendingTransactionId;
}
public final Cursor query(SupportSQLiteQuery query) {
Intrinsics.checkNotNullParameter(query, "query");
return query$default(this, query, null, 2, null);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final void setAutoMigrationSpecs(Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> map) {
Intrinsics.checkNotNullParameter(map, "<set-?>");
this.autoMigrationSpecs = map;
}
public RoomDatabase() {
Map<String, Object> synchronizedMap = Collections.synchronizedMap(new LinkedHashMap());
Intrinsics.checkNotNullExpressionValue(synchronizedMap, "synchronizedMap(mutableMapOf())");
this.backingFieldMap = synchronizedMap;
this.typeConverters = new LinkedHashMap();
}
public Executor getQueryExecutor() {
Executor executor = this.internalQueryExecutor;
if (executor != null) {
return executor;
}
Intrinsics.throwUninitializedPropertyAccessException("internalQueryExecutor");
return null;
}
public Executor getTransactionExecutor() {
Executor executor = this.internalTransactionExecutor;
if (executor != null) {
return executor;
}
Intrinsics.throwUninitializedPropertyAccessException("internalTransactionExecutor");
return null;
}
public SupportSQLiteOpenHelper getOpenHelper() {
SupportSQLiteOpenHelper supportSQLiteOpenHelper = this.internalOpenHelper;
if (supportSQLiteOpenHelper != null) {
return supportSQLiteOpenHelper;
}
Intrinsics.throwUninitializedPropertyAccessException("internalOpenHelper");
return null;
}
public final Lock getCloseLock$room_runtime_release() {
ReentrantReadWriteLock.ReadLock readLock = this.readWriteLock.readLock();
Intrinsics.checkNotNullExpressionValue(readLock, "readWriteLock.readLock()");
return readLock;
}
public <T> T getTypeConverter(Class<T> klass) {
Intrinsics.checkNotNullParameter(klass, "klass");
return (T) this.typeConverters.get(klass);
}
@CallSuper
public void init(DatabaseConfiguration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
this.internalOpenHelper = createOpenHelper(configuration);
Set<Class<? extends AutoMigrationSpec>> requiredAutoMigrationSpecs = getRequiredAutoMigrationSpecs();
BitSet bitSet = new BitSet();
Iterator<Class<? extends AutoMigrationSpec>> it = requiredAutoMigrationSpecs.iterator();
while (true) {
int i = -1;
if (it.hasNext()) {
Class<? extends AutoMigrationSpec> next = it.next();
int size = configuration.autoMigrationSpecs.size() - 1;
if (size >= 0) {
while (true) {
int i2 = size - 1;
if (next.isAssignableFrom(configuration.autoMigrationSpecs.get(size).getClass())) {
bitSet.set(size);
i = size;
break;
} else if (i2 < 0) {
break;
} else {
size = i2;
}
}
}
if (i < 0) {
throw new IllegalArgumentException(("A required auto migration spec (" + next.getCanonicalName() + ") is missing in the database configuration.").toString());
}
this.autoMigrationSpecs.put(next, configuration.autoMigrationSpecs.get(i));
} else {
int size2 = configuration.autoMigrationSpecs.size() - 1;
if (size2 >= 0) {
while (true) {
int i3 = size2 - 1;
if (!bitSet.get(size2)) {
throw new IllegalArgumentException("Unexpected auto migration specs found. Annotate AutoMigrationSpec implementation with @ProvidedAutoMigrationSpec annotation or remove this spec from the builder.".toString());
}
if (i3 < 0) {
break;
} else {
size2 = i3;
}
}
}
Iterator<Migration> it2 = getAutoMigrations(this.autoMigrationSpecs).iterator();
while (true) {
if (!it2.hasNext()) {
break;
}
Migration next2 = it2.next();
if (!configuration.migrationContainer.contains(next2.startVersion, next2.endVersion)) {
configuration.migrationContainer.addMigrations(next2);
}
}
SQLiteCopyOpenHelper sQLiteCopyOpenHelper = (SQLiteCopyOpenHelper) unwrapOpenHelper(SQLiteCopyOpenHelper.class, getOpenHelper());
if (sQLiteCopyOpenHelper != null) {
sQLiteCopyOpenHelper.setDatabaseConfiguration(configuration);
}
AutoClosingRoomOpenHelper autoClosingRoomOpenHelper = (AutoClosingRoomOpenHelper) unwrapOpenHelper(AutoClosingRoomOpenHelper.class, getOpenHelper());
if (autoClosingRoomOpenHelper != null) {
this.autoCloser = autoClosingRoomOpenHelper.autoCloser;
getInvalidationTracker().setAutoCloser$room_runtime_release(autoClosingRoomOpenHelper.autoCloser);
}
boolean z = configuration.journalMode == JournalMode.WRITE_AHEAD_LOGGING;
getOpenHelper().setWriteAheadLoggingEnabled(z);
this.mCallbacks = configuration.callbacks;
this.internalQueryExecutor = configuration.queryExecutor;
this.internalTransactionExecutor = new TransactionExecutor(configuration.transactionExecutor);
this.allowMainThreadQueries = configuration.allowMainThreadQueries;
this.writeAheadLoggingEnabled = z;
if (configuration.multiInstanceInvalidationServiceIntent != null) {
if (configuration.name == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
getInvalidationTracker().startMultiInstanceInvalidation$room_runtime_release(configuration.context, configuration.name, configuration.multiInstanceInvalidationServiceIntent);
}
Map<Class<?>, List<Class<?>>> requiredTypeConverters = getRequiredTypeConverters();
BitSet bitSet2 = new BitSet();
for (Map.Entry<Class<?>, List<Class<?>>> entry : requiredTypeConverters.entrySet()) {
Class<?> key = entry.getKey();
for (Class<?> cls : entry.getValue()) {
int size3 = configuration.typeConverters.size() - 1;
if (size3 >= 0) {
while (true) {
int i4 = size3 - 1;
if (cls.isAssignableFrom(configuration.typeConverters.get(size3).getClass())) {
bitSet2.set(size3);
break;
} else if (i4 < 0) {
break;
} else {
size3 = i4;
}
}
}
size3 = -1;
if (size3 < 0) {
throw new IllegalArgumentException(("A required type converter (" + cls + ") for " + key.getCanonicalName() + " is missing in the database configuration.").toString());
}
this.typeConverters.put(cls, configuration.typeConverters.get(size3));
}
}
int size4 = configuration.typeConverters.size() - 1;
if (size4 < 0) {
return;
}
while (true) {
int i5 = size4 - 1;
if (!bitSet2.get(size4)) {
throw new IllegalArgumentException("Unexpected type converter " + configuration.typeConverters.get(size4) + ". Annotate TypeConverter class with @ProvidedTypeConverter annotation or remove this converter from the builder.");
}
if (i5 < 0) {
return;
} else {
size4 = i5;
}
}
}
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public List<Migration> getAutoMigrations(Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> autoMigrationSpecs) {
Intrinsics.checkNotNullParameter(autoMigrationSpecs, "autoMigrationSpecs");
return CollectionsKt__CollectionsKt.emptyList();
}
/* JADX WARN: Multi-variable type inference failed */
private final <T> T unwrapOpenHelper(Class<T> cls, SupportSQLiteOpenHelper supportSQLiteOpenHelper) {
if (cls.isInstance(supportSQLiteOpenHelper)) {
return supportSQLiteOpenHelper;
}
if (supportSQLiteOpenHelper instanceof DelegatingOpenHelper) {
return (T) unwrapOpenHelper(cls, ((DelegatingOpenHelper) supportSQLiteOpenHelper).getDelegate());
}
return null;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Map<Class<?>, List<Class<?>>> getRequiredTypeConverters() {
Map<Class<?>, List<Class<?>>> emptyMap;
emptyMap = MapsKt__MapsKt.emptyMap();
return emptyMap;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Set<Class<? extends AutoMigrationSpec>> getRequiredAutoMigrationSpecs() {
Set<Class<? extends AutoMigrationSpec>> emptySet;
emptySet = SetsKt__SetsKt.emptySet();
return emptySet;
}
public boolean isOpen() {
Boolean bool;
boolean isOpen;
AutoCloser autoCloser = this.autoCloser;
if (autoCloser != null) {
isOpen = autoCloser.isActive();
} else {
SupportSQLiteDatabase supportSQLiteDatabase = this.mDatabase;
if (supportSQLiteDatabase == null) {
bool = null;
return Intrinsics.areEqual(bool, Boolean.TRUE);
}
isOpen = supportSQLiteDatabase.isOpen();
}
bool = Boolean.valueOf(isOpen);
return Intrinsics.areEqual(bool, Boolean.TRUE);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final boolean isOpenInternal() {
SupportSQLiteDatabase supportSQLiteDatabase = this.mDatabase;
return supportSQLiteDatabase != null && supportSQLiteDatabase.isOpen();
}
public void close() {
if (isOpen()) {
ReentrantReadWriteLock.WriteLock writeLock = this.readWriteLock.writeLock();
Intrinsics.checkNotNullExpressionValue(writeLock, "readWriteLock.writeLock()");
writeLock.lock();
try {
getInvalidationTracker().stopMultiInstanceInvalidation$room_runtime_release();
getOpenHelper().close();
} finally {
writeLock.unlock();
}
}
}
public final boolean isMainThread$room_runtime_release() {
return Looper.getMainLooper().getThread() == Thread.currentThread();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void assertNotMainThread() {
if (!this.allowMainThreadQueries && !(!isMainThread$room_runtime_release())) {
throw new IllegalStateException("Cannot access database on the main thread since it may potentially lock the UI for a long period of time.".toString());
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public void assertNotSuspendingTransaction() {
if (!inTransaction() && this.suspendingTransactionId.get() != null) {
throw new IllegalStateException("Cannot access database on a different coroutine context inherited from a suspending transaction.".toString());
}
}
public Cursor query(String query, Object[] objArr) {
Intrinsics.checkNotNullParameter(query, "query");
return getOpenHelper().getWritableDatabase().query(new SimpleSQLiteQuery(query, objArr));
}
public static /* synthetic */ Cursor query$default(RoomDatabase roomDatabase, SupportSQLiteQuery supportSQLiteQuery, CancellationSignal cancellationSignal, int i, Object obj) {
if (obj != null) {
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: query");
}
if ((i & 2) != 0) {
cancellationSignal = null;
}
return roomDatabase.query(supportSQLiteQuery, cancellationSignal);
}
public Cursor query(SupportSQLiteQuery query, CancellationSignal cancellationSignal) {
Intrinsics.checkNotNullParameter(query, "query");
assertNotMainThread();
assertNotSuspendingTransaction();
if (cancellationSignal != null) {
return getOpenHelper().getWritableDatabase().query(query, cancellationSignal);
}
return getOpenHelper().getWritableDatabase().query(query);
}
public SupportSQLiteStatement compileStatement(String sql) {
Intrinsics.checkNotNullParameter(sql, "sql");
assertNotMainThread();
assertNotSuspendingTransaction();
return getOpenHelper().getWritableDatabase().compileStatement(sql);
}
public void beginTransaction() {
assertNotMainThread();
AutoCloser autoCloser = this.autoCloser;
if (autoCloser == null) {
internalBeginTransaction();
} else {
autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.RoomDatabase$beginTransaction$1
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase it) {
Intrinsics.checkNotNullParameter(it, "it");
RoomDatabase.this.internalBeginTransaction();
return null;
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
public final void internalBeginTransaction() {
assertNotMainThread();
SupportSQLiteDatabase writableDatabase = getOpenHelper().getWritableDatabase();
getInvalidationTracker().syncTriggers$room_runtime_release(writableDatabase);
if (writableDatabase.isWriteAheadLoggingEnabled()) {
writableDatabase.beginTransactionNonExclusive();
} else {
writableDatabase.beginTransaction();
}
}
public void endTransaction() {
AutoCloser autoCloser = this.autoCloser;
if (autoCloser == null) {
internalEndTransaction();
} else {
autoCloser.executeRefCountingFunction(new Function1() { // from class: androidx.room.RoomDatabase$endTransaction$1
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(SupportSQLiteDatabase it) {
Intrinsics.checkNotNullParameter(it, "it");
RoomDatabase.this.internalEndTransaction();
return null;
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
public final void internalEndTransaction() {
getOpenHelper().getWritableDatabase().endTransaction();
if (inTransaction()) {
return;
}
getInvalidationTracker().refreshVersionsAsync();
}
public void setTransactionSuccessful() {
getOpenHelper().getWritableDatabase().setTransactionSuccessful();
}
public void runInTransaction(Runnable body) {
Intrinsics.checkNotNullParameter(body, "body");
beginTransaction();
try {
body.run();
setTransactionSuccessful();
} finally {
endTransaction();
}
}
public <V> V runInTransaction(Callable<V> body) {
Intrinsics.checkNotNullParameter(body, "body");
beginTransaction();
try {
V call = body.call();
setTransactionSuccessful();
return call;
} finally {
endTransaction();
}
}
public void internalInitInvalidationTracker(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
getInvalidationTracker().internalInit$room_runtime_release(db);
}
public boolean inTransaction() {
return getOpenHelper().getWritableDatabase().inTransaction();
}
public enum JournalMode {
AUTOMATIC,
TRUNCATE,
WRITE_AHEAD_LOGGING;
public final JournalMode resolve$room_runtime_release(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
if (this != AUTOMATIC) {
return this;
}
Object systemService = context.getSystemService("activity");
ActivityManager activityManager = systemService instanceof ActivityManager ? (ActivityManager) systemService : null;
return (activityManager == null || isLowRamDevice(activityManager)) ? TRUNCATE : WRITE_AHEAD_LOGGING;
}
private final boolean isLowRamDevice(ActivityManager activityManager) {
return SupportSQLiteCompat.Api19Impl.isLowRamDevice(activityManager);
}
}
@SourceDebugExtension({"SMAP\nRoomDatabase.kt\nKotlin\n*S Kotlin\n*F\n+ 1 RoomDatabase.kt\nandroidx/room/RoomDatabase$Builder\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,1548:1\n1#2:1549\n*E\n"})
public static class Builder<T extends RoomDatabase> {
private boolean allowDestructiveMigrationOnDowngrade;
private boolean allowMainThreadQueries;
private TimeUnit autoCloseTimeUnit;
private long autoCloseTimeout;
private List<AutoMigrationSpec> autoMigrationSpecs;
private final List<Callback> callbacks;
private final Context context;
private String copyFromAssetPath;
private File copyFromFile;
private Callable<InputStream> copyFromInputStream;
private SupportSQLiteOpenHelper.Factory factory;
private JournalMode journalMode;
private final Class<T> klass;
private final MigrationContainer migrationContainer;
private Set<Integer> migrationStartAndEndVersions;
private Set<Integer> migrationsNotRequiredFrom;
private Intent multiInstanceInvalidationIntent;
private final String name;
private PrepackagedDatabaseCallback prepackagedDatabaseCallback;
private QueryCallback queryCallback;
private Executor queryCallbackExecutor;
private Executor queryExecutor;
private boolean requireMigration;
private Executor transactionExecutor;
private final List<Object> typeConverters;
public Builder<T> allowMainThreadQueries() {
this.allowMainThreadQueries = true;
return this;
}
public Builder<T> createFromAsset(String databaseFilePath) {
Intrinsics.checkNotNullParameter(databaseFilePath, "databaseFilePath");
this.copyFromAssetPath = databaseFilePath;
return this;
}
@SuppressLint({"BuilderSetStyle"})
public Builder<T> createFromAsset(String databaseFilePath, PrepackagedDatabaseCallback callback) {
Intrinsics.checkNotNullParameter(databaseFilePath, "databaseFilePath");
Intrinsics.checkNotNullParameter(callback, "callback");
this.prepackagedDatabaseCallback = callback;
this.copyFromAssetPath = databaseFilePath;
return this;
}
public Builder<T> createFromFile(File databaseFile) {
Intrinsics.checkNotNullParameter(databaseFile, "databaseFile");
this.copyFromFile = databaseFile;
return this;
}
@SuppressLint({"BuilderSetStyle", "StreamFiles"})
public Builder<T> createFromFile(File databaseFile, PrepackagedDatabaseCallback callback) {
Intrinsics.checkNotNullParameter(databaseFile, "databaseFile");
Intrinsics.checkNotNullParameter(callback, "callback");
this.prepackagedDatabaseCallback = callback;
this.copyFromFile = databaseFile;
return this;
}
@SuppressLint({"BuilderSetStyle"})
public Builder<T> createFromInputStream(Callable<InputStream> inputStreamCallable) {
Intrinsics.checkNotNullParameter(inputStreamCallable, "inputStreamCallable");
this.copyFromInputStream = inputStreamCallable;
return this;
}
@SuppressLint({"BuilderSetStyle", "LambdaLast"})
public Builder<T> createFromInputStream(Callable<InputStream> inputStreamCallable, PrepackagedDatabaseCallback callback) {
Intrinsics.checkNotNullParameter(inputStreamCallable, "inputStreamCallable");
Intrinsics.checkNotNullParameter(callback, "callback");
this.prepackagedDatabaseCallback = callback;
this.copyFromInputStream = inputStreamCallable;
return this;
}
public Builder<T> fallbackToDestructiveMigration() {
this.requireMigration = false;
this.allowDestructiveMigrationOnDowngrade = true;
return this;
}
public Builder<T> fallbackToDestructiveMigrationOnDowngrade() {
this.requireMigration = true;
this.allowDestructiveMigrationOnDowngrade = true;
return this;
}
public Builder<T> openHelperFactory(SupportSQLiteOpenHelper.Factory factory) {
this.factory = factory;
return this;
}
public Builder<T> setJournalMode(JournalMode journalMode) {
Intrinsics.checkNotNullParameter(journalMode, "journalMode");
this.journalMode = journalMode;
return this;
}
@ExperimentalRoomApi
public Builder<T> setMultiInstanceInvalidationServiceIntent(Intent invalidationServiceIntent) {
Intrinsics.checkNotNullParameter(invalidationServiceIntent, "invalidationServiceIntent");
if (this.name == null) {
invalidationServiceIntent = null;
}
this.multiInstanceInvalidationIntent = invalidationServiceIntent;
return this;
}
public Builder<T> setQueryCallback(QueryCallback queryCallback, Executor executor) {
Intrinsics.checkNotNullParameter(queryCallback, "queryCallback");
Intrinsics.checkNotNullParameter(executor, "executor");
this.queryCallback = queryCallback;
this.queryCallbackExecutor = executor;
return this;
}
public Builder<T> setQueryExecutor(Executor executor) {
Intrinsics.checkNotNullParameter(executor, "executor");
this.queryExecutor = executor;
return this;
}
public Builder<T> setTransactionExecutor(Executor executor) {
Intrinsics.checkNotNullParameter(executor, "executor");
this.transactionExecutor = executor;
return this;
}
public Builder(Context context, Class<T> klass, String str) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(klass, "klass");
this.context = context;
this.klass = klass;
this.name = str;
this.callbacks = new ArrayList();
this.typeConverters = new ArrayList();
this.autoMigrationSpecs = new ArrayList();
this.journalMode = JournalMode.AUTOMATIC;
this.requireMigration = true;
this.autoCloseTimeout = -1L;
this.migrationContainer = new MigrationContainer();
this.migrationsNotRequiredFrom = new LinkedHashSet();
}
public Builder<T> addMigrations(Migration... migrations) {
Intrinsics.checkNotNullParameter(migrations, "migrations");
if (this.migrationStartAndEndVersions == null) {
this.migrationStartAndEndVersions = new HashSet();
}
for (Migration migration : migrations) {
Set<Integer> set = this.migrationStartAndEndVersions;
Intrinsics.checkNotNull(set);
set.add(Integer.valueOf(migration.startVersion));
Set<Integer> set2 = this.migrationStartAndEndVersions;
Intrinsics.checkNotNull(set2);
set2.add(Integer.valueOf(migration.endVersion));
}
this.migrationContainer.addMigrations((Migration[]) Arrays.copyOf(migrations, migrations.length));
return this;
}
public Builder<T> addAutoMigrationSpec(AutoMigrationSpec autoMigrationSpec) {
Intrinsics.checkNotNullParameter(autoMigrationSpec, "autoMigrationSpec");
this.autoMigrationSpecs.add(autoMigrationSpec);
return this;
}
public Builder<T> enableMultiInstanceInvalidation() {
this.multiInstanceInvalidationIntent = this.name != null ? new Intent(this.context, (Class<?>) MultiInstanceInvalidationService.class) : null;
return this;
}
public Builder<T> fallbackToDestructiveMigrationFrom(int... startVersions) {
Intrinsics.checkNotNullParameter(startVersions, "startVersions");
for (int i : startVersions) {
this.migrationsNotRequiredFrom.add(Integer.valueOf(i));
}
return this;
}
public Builder<T> addCallback(Callback callback) {
Intrinsics.checkNotNullParameter(callback, "callback");
this.callbacks.add(callback);
return this;
}
public Builder<T> addTypeConverter(Object typeConverter) {
Intrinsics.checkNotNullParameter(typeConverter, "typeConverter");
this.typeConverters.add(typeConverter);
return this;
}
@ExperimentalRoomApi
public Builder<T> setAutoCloseTimeout(@IntRange(from = 0) long j, TimeUnit autoCloseTimeUnit) {
Intrinsics.checkNotNullParameter(autoCloseTimeUnit, "autoCloseTimeUnit");
if (j < 0) {
throw new IllegalArgumentException("autoCloseTimeout must be >= 0".toString());
}
this.autoCloseTimeout = j;
this.autoCloseTimeUnit = autoCloseTimeUnit;
return this;
}
public T build() {
SupportSQLiteOpenHelper.Factory factory;
Executor executor = this.queryExecutor;
if (executor == null && this.transactionExecutor == null) {
Executor iOThreadExecutor = ArchTaskExecutor.getIOThreadExecutor();
this.transactionExecutor = iOThreadExecutor;
this.queryExecutor = iOThreadExecutor;
} else if (executor != null && this.transactionExecutor == null) {
this.transactionExecutor = executor;
} else if (executor == null) {
this.queryExecutor = this.transactionExecutor;
}
Set<Integer> set = this.migrationStartAndEndVersions;
if (set != null) {
Intrinsics.checkNotNull(set);
Iterator<Integer> it = set.iterator();
while (it.hasNext()) {
int intValue = it.next().intValue();
if (!(!this.migrationsNotRequiredFrom.contains(Integer.valueOf(intValue)))) {
throw new IllegalArgumentException(("Inconsistency detected. A Migration was supplied to addMigration(Migration... migrations) that has a start or end version equal to a start version supplied to fallbackToDestructiveMigrationFrom(int... startVersions). Start version: " + intValue).toString());
}
}
}
SupportSQLiteOpenHelper.Factory factory2 = this.factory;
if (factory2 == null) {
factory2 = new FrameworkSQLiteOpenHelperFactory();
}
if (factory2 != null) {
if (this.autoCloseTimeout > 0) {
if (this.name == null) {
throw new IllegalArgumentException("Cannot create auto-closing database for an in-memory database.".toString());
}
long j = this.autoCloseTimeout;
TimeUnit timeUnit = this.autoCloseTimeUnit;
if (timeUnit == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
Executor executor2 = this.queryExecutor;
if (executor2 == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
factory2 = new AutoClosingRoomOpenHelperFactory(factory2, new AutoCloser(j, timeUnit, executor2));
}
String str = this.copyFromAssetPath;
if (str != null || this.copyFromFile != null || this.copyFromInputStream != null) {
if (this.name == null) {
throw new IllegalArgumentException("Cannot create from asset or file for an in-memory database.".toString());
}
int i = str == null ? 0 : 1;
File file = this.copyFromFile;
int i2 = file == null ? 0 : 1;
Callable<InputStream> callable = this.copyFromInputStream;
if (i + i2 + (callable != null ? 1 : 0) != 1) {
throw new IllegalArgumentException("More than one of createFromAsset(), createFromInputStream(), and createFromFile() were called on this Builder, but the database can only be created using one of the three configurations.".toString());
}
factory2 = new SQLiteCopyOpenHelperFactory(str, file, callable, factory2);
}
} else {
factory2 = null;
}
if (factory2 == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
QueryCallback queryCallback = this.queryCallback;
if (queryCallback != null) {
Executor executor3 = this.queryCallbackExecutor;
if (executor3 == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
if (queryCallback != null) {
factory = new QueryInterceptorOpenHelperFactory(factory2, executor3, queryCallback);
} else {
throw new IllegalArgumentException("Required value was null.".toString());
}
} else {
factory = factory2;
}
Context context = this.context;
String str2 = this.name;
MigrationContainer migrationContainer = this.migrationContainer;
List<Callback> list = this.callbacks;
boolean z = this.allowMainThreadQueries;
JournalMode resolve$room_runtime_release = this.journalMode.resolve$room_runtime_release(context);
Executor executor4 = this.queryExecutor;
if (executor4 == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
Executor executor5 = this.transactionExecutor;
if (executor5 != null) {
DatabaseConfiguration databaseConfiguration = new DatabaseConfiguration(context, str2, factory, migrationContainer, list, z, resolve$room_runtime_release, executor4, executor5, this.multiInstanceInvalidationIntent, this.requireMigration, this.allowDestructiveMigrationOnDowngrade, this.migrationsNotRequiredFrom, this.copyFromAssetPath, this.copyFromFile, this.copyFromInputStream, this.prepackagedDatabaseCallback, (List<? extends Object>) this.typeConverters, this.autoMigrationSpecs);
T t = (T) Room.getGeneratedImplementation(this.klass, "_Impl");
t.init(databaseConfiguration);
return t;
}
throw new IllegalArgumentException("Required value was null.".toString());
}
}
@SourceDebugExtension({"SMAP\nRoomDatabase.kt\nKotlin\n*S Kotlin\n*F\n+ 1 RoomDatabase.kt\nandroidx/room/RoomDatabase$MigrationContainer\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 4 Maps.kt\nkotlin/collections/MapsKt__MapsKt\n*L\n1#1,1548:1\n13579#2,2:1549\n1855#3,2:1551\n361#4,7:1553\n*S KotlinDebug\n*F\n+ 1 RoomDatabase.kt\nandroidx/room/RoomDatabase$MigrationContainer\n*L\n1371#1:1549,2\n1381#1:1551,2\n1387#1:1553,7\n*E\n"})
public static class MigrationContainer {
private final Map<Integer, TreeMap<Integer, Migration>> migrations = new LinkedHashMap();
public Map<Integer, Map<Integer, Migration>> getMigrations() {
return this.migrations;
}
public void addMigrations(List<? extends Migration> migrations) {
Intrinsics.checkNotNullParameter(migrations, "migrations");
Iterator<T> it = migrations.iterator();
while (it.hasNext()) {
addMigration((Migration) it.next());
}
}
private final void addMigration(Migration migration) {
int i = migration.startVersion;
int i2 = migration.endVersion;
Map<Integer, TreeMap<Integer, Migration>> map = this.migrations;
Integer valueOf = Integer.valueOf(i);
TreeMap<Integer, Migration> treeMap = map.get(valueOf);
if (treeMap == null) {
treeMap = new TreeMap<>();
map.put(valueOf, treeMap);
}
TreeMap<Integer, Migration> treeMap2 = treeMap;
if (treeMap2.containsKey(Integer.valueOf(i2))) {
Log.w(Room.LOG_TAG, "Overriding migration " + treeMap2.get(Integer.valueOf(i2)) + " with " + migration);
}
treeMap2.put(Integer.valueOf(i2), migration);
}
public List<Migration> findMigrationPath(int i, int i2) {
if (i == i2) {
return CollectionsKt__CollectionsKt.emptyList();
}
return findUpMigrationPath(new ArrayList(), i2 > i, i, i2);
}
/* JADX WARN: Removed duplicated region for block: B:40:0x0016 A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:5:0x0017 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private final java.util.List<androidx.room.migration.Migration> findUpMigrationPath(java.util.List<androidx.room.migration.Migration> r7, boolean r8, int r9, int r10) {
/*
r6 = this;
L0:
if (r8 == 0) goto L5
if (r9 >= r10) goto L63
goto L7
L5:
if (r9 <= r10) goto L63
L7:
java.util.Map<java.lang.Integer, java.util.TreeMap<java.lang.Integer, androidx.room.migration.Migration>> r0 = r6.migrations
java.lang.Integer r1 = java.lang.Integer.valueOf(r9)
java.lang.Object r0 = r0.get(r1)
java.util.TreeMap r0 = (java.util.TreeMap) r0
r1 = 0
if (r0 != 0) goto L17
return r1
L17:
if (r8 == 0) goto L1e
java.util.NavigableSet r2 = r0.descendingKeySet()
goto L22
L1e:
java.util.Set r2 = r0.keySet()
L22:
java.util.Iterator r2 = r2.iterator()
L26:
boolean r3 = r2.hasNext()
if (r3 == 0) goto L5f
java.lang.Object r3 = r2.next()
java.lang.Integer r3 = (java.lang.Integer) r3
java.lang.String r4 = "targetVersion"
if (r8 == 0) goto L44
int r5 = r9 + 1
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r3, r4)
int r4 = r3.intValue()
if (r5 > r4) goto L26
if (r4 > r10) goto L26
goto L4f
L44:
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r3, r4)
int r4 = r3.intValue()
if (r10 > r4) goto L26
if (r4 >= r9) goto L26
L4f:
java.lang.Object r9 = r0.get(r3)
kotlin.jvm.internal.Intrinsics.checkNotNull(r9)
r7.add(r9)
int r9 = r3.intValue()
r0 = 1
goto L60
L5f:
r0 = 0
L60:
if (r0 != 0) goto L0
return r1
L63:
return r7
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.RoomDatabase.MigrationContainer.findUpMigrationPath(java.util.List, boolean, int, int):java.util.List");
}
public final boolean contains(int i, int i2) {
Map<Integer, Map<Integer, Migration>> migrations = getMigrations();
if (!migrations.containsKey(Integer.valueOf(i))) {
return false;
}
Map<Integer, Migration> map = migrations.get(Integer.valueOf(i));
if (map == null) {
map = MapsKt__MapsKt.emptyMap();
}
return map.containsKey(Integer.valueOf(i2));
}
public void addMigrations(Migration... migrations) {
Intrinsics.checkNotNullParameter(migrations, "migrations");
for (Migration migration : migrations) {
addMigration(migration);
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,82 @@
package androidx.room;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.KotlinNothingValueException;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.DelayKt;
import kotlinx.coroutines.channels.ProducerScope;
@DebugMetadata(c = "androidx.room.RoomDatabaseKt$invalidationTrackerFlow$1$job$1", f = "RoomDatabaseExt.kt", l = {230}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class RoomDatabaseKt$invalidationTrackerFlow$1$job$1 extends SuspendLambda implements Function2 {
final /* synthetic */ ProducerScope $$this$callbackFlow;
final /* synthetic */ boolean $emitInitialState;
final /* synthetic */ AtomicBoolean $ignoreInvalidation;
final /* synthetic */ RoomDatabaseKt$invalidationTrackerFlow$1$observer$1 $observer;
final /* synthetic */ String[] $tables;
final /* synthetic */ RoomDatabase $this_invalidationTrackerFlow;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RoomDatabaseKt$invalidationTrackerFlow$1$job$1(RoomDatabase roomDatabase, RoomDatabaseKt$invalidationTrackerFlow$1$observer$1 roomDatabaseKt$invalidationTrackerFlow$1$observer$1, boolean z, ProducerScope producerScope, String[] strArr, AtomicBoolean atomicBoolean, Continuation continuation) {
super(2, continuation);
this.$this_invalidationTrackerFlow = roomDatabase;
this.$observer = roomDatabaseKt$invalidationTrackerFlow$1$observer$1;
this.$emitInitialState = z;
this.$$this$callbackFlow = producerScope;
this.$tables = strArr;
this.$ignoreInvalidation = atomicBoolean;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new RoomDatabaseKt$invalidationTrackerFlow$1$job$1(this.$this_invalidationTrackerFlow, this.$observer, this.$emitInitialState, this.$$this$callbackFlow, this.$tables, this.$ignoreInvalidation, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((RoomDatabaseKt$invalidationTrackerFlow$1$job$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
Set set;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
try {
if (i == 0) {
ResultKt.throwOnFailure(obj);
this.$this_invalidationTrackerFlow.getInvalidationTracker().addObserver(this.$observer);
if (this.$emitInitialState) {
ProducerScope producerScope = this.$$this$callbackFlow;
set = ArraysKt___ArraysKt.toSet(this.$tables);
producerScope.mo4126trySendJP2dKIU(set);
}
this.$ignoreInvalidation.set(false);
this.label = 1;
if (DelayKt.awaitCancellation(this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
throw new KotlinNothingValueException();
} catch (Throwable th) {
this.$this_invalidationTrackerFlow.getInvalidationTracker().removeObserver(this.$observer);
throw th;
}
}
}

View File

@@ -0,0 +1,104 @@
package androidx.room;
import androidx.room.InvalidationTracker;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.channels.ProduceKt;
import kotlinx.coroutines.channels.ProducerScope;
@DebugMetadata(c = "androidx.room.RoomDatabaseKt$invalidationTrackerFlow$1", f = "RoomDatabaseExt.kt", l = {235}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class RoomDatabaseKt$invalidationTrackerFlow$1 extends SuspendLambda implements Function2 {
final /* synthetic */ boolean $emitInitialState;
final /* synthetic */ String[] $tables;
final /* synthetic */ RoomDatabase $this_invalidationTrackerFlow;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RoomDatabaseKt$invalidationTrackerFlow$1(boolean z, RoomDatabase roomDatabase, String[] strArr, Continuation continuation) {
super(2, continuation);
this.$emitInitialState = z;
this.$this_invalidationTrackerFlow = roomDatabase;
this.$tables = strArr;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
RoomDatabaseKt$invalidationTrackerFlow$1 roomDatabaseKt$invalidationTrackerFlow$1 = new RoomDatabaseKt$invalidationTrackerFlow$1(this.$emitInitialState, this.$this_invalidationTrackerFlow, this.$tables, continuation);
roomDatabaseKt$invalidationTrackerFlow$1.L$0 = obj;
return roomDatabaseKt$invalidationTrackerFlow$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(ProducerScope producerScope, Continuation continuation) {
return ((RoomDatabaseKt$invalidationTrackerFlow$1) create(producerScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Type inference failed for: r5v0, types: [androidx.room.RoomDatabaseKt$invalidationTrackerFlow$1$observer$1] */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
ContinuationInterceptor queryDispatcher;
final Job launch$default;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
final ProducerScope producerScope = (ProducerScope) this.L$0;
final AtomicBoolean atomicBoolean = new AtomicBoolean(this.$emitInitialState);
final String[] strArr = this.$tables;
?? r5 = new InvalidationTracker.Observer(strArr) { // from class: androidx.room.RoomDatabaseKt$invalidationTrackerFlow$1$observer$1
@Override // androidx.room.InvalidationTracker.Observer
public void onInvalidated(Set<String> set) {
if (atomicBoolean.get()) {
return;
}
producerScope.mo4126trySendJP2dKIU(set);
}
};
TransactionElement transactionElement = (TransactionElement) producerScope.getCoroutineContext().get(TransactionElement.Key);
if (transactionElement == null || (queryDispatcher = transactionElement.getTransactionDispatcher$room_ktx_release()) == null) {
queryDispatcher = CoroutinesRoomKt.getQueryDispatcher(this.$this_invalidationTrackerFlow);
}
launch$default = BuildersKt__Builders_commonKt.launch$default(producerScope, queryDispatcher, null, new RoomDatabaseKt$invalidationTrackerFlow$1$job$1(this.$this_invalidationTrackerFlow, r5, this.$emitInitialState, producerScope, this.$tables, atomicBoolean, null), 2, null);
Function0 function0 = new Function0() { // from class: androidx.room.RoomDatabaseKt$invalidationTrackerFlow$1.1
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public /* bridge */ /* synthetic */ Object invoke() {
m173invoke();
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: collision with other method in class */
public final void m173invoke() {
Job.DefaultImpls.cancel$default(Job.this, null, 1, null);
}
};
this.label = 1;
if (ProduceKt.awaitClose(producerScope, function0, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,103 @@
package androidx.room;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;
@DebugMetadata(c = "androidx.room.RoomDatabaseKt$withTransaction$transactionBlock$1", f = "RoomDatabaseExt.kt", l = {62}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class RoomDatabaseKt$withTransaction$transactionBlock$1 extends SuspendLambda implements Function2 {
final /* synthetic */ Function1 $block;
final /* synthetic */ RoomDatabase $this_withTransaction;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RoomDatabaseKt$withTransaction$transactionBlock$1(RoomDatabase roomDatabase, Function1 function1, Continuation continuation) {
super(2, continuation);
this.$this_withTransaction = roomDatabase;
this.$block = function1;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
RoomDatabaseKt$withTransaction$transactionBlock$1 roomDatabaseKt$withTransaction$transactionBlock$1 = new RoomDatabaseKt$withTransaction$transactionBlock$1(this.$this_withTransaction, this.$block, continuation);
roomDatabaseKt$withTransaction$transactionBlock$1.L$0 = obj;
return roomDatabaseKt$withTransaction$transactionBlock$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((RoomDatabaseKt$withTransaction$transactionBlock$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object] */
/* JADX WARN: Type inference failed for: r0v3 */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
TransactionElement coroutine_suspended;
Throwable th;
TransactionElement transactionElement;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
try {
if (i == 0) {
ResultKt.throwOnFailure(obj);
CoroutineContext.Element element = ((CoroutineScope) this.L$0).getCoroutineContext().get(TransactionElement.Key);
Intrinsics.checkNotNull(element);
TransactionElement transactionElement2 = (TransactionElement) element;
transactionElement2.acquire();
try {
this.$this_withTransaction.beginTransaction();
try {
Function1 function1 = this.$block;
this.L$0 = transactionElement2;
this.label = 1;
Object invoke = function1.invoke(this);
if (invoke == coroutine_suspended) {
return coroutine_suspended;
}
transactionElement = transactionElement2;
obj = invoke;
} catch (Throwable th2) {
th = th2;
this.$this_withTransaction.endTransaction();
throw th;
}
} catch (Throwable th3) {
coroutine_suspended = transactionElement2;
th = th3;
coroutine_suspended.release();
throw th;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
transactionElement = (TransactionElement) this.L$0;
try {
ResultKt.throwOnFailure(obj);
} catch (Throwable th4) {
th = th4;
this.$this_withTransaction.endTransaction();
throw th;
}
}
this.$this_withTransaction.setTransactionSuccessful();
this.$this_withTransaction.endTransaction();
transactionElement.release();
return obj;
} catch (Throwable th5) {
th = th5;
}
}
}

View File

@@ -0,0 +1,149 @@
package androidx.room;
import java.util.concurrent.RejectedExecutionException;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.DebugProbesKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CancellableContinuation;
import kotlinx.coroutines.CancellableContinuationImpl;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.ThreadContextElementKt;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowKt;
@SourceDebugExtension({"SMAP\nRoomDatabaseExt.kt\nKotlin\n*S Kotlin\n*F\n+ 1 RoomDatabaseExt.kt\nandroidx/room/RoomDatabaseKt\n+ 2 CancellableContinuation.kt\nkotlinx/coroutines/CancellableContinuationKt\n*L\n1#1,239:1\n314#2,11:240\n*S KotlinDebug\n*F\n+ 1 RoomDatabaseExt.kt\nandroidx/room/RoomDatabaseKt\n*L\n92#1:240,11\n*E\n"})
/* loaded from: classes.dex */
public final class RoomDatabaseKt {
public static final <R> Object withTransaction(RoomDatabase roomDatabase, Function1 function1, Continuation continuation) {
RoomDatabaseKt$withTransaction$transactionBlock$1 roomDatabaseKt$withTransaction$transactionBlock$1 = new RoomDatabaseKt$withTransaction$transactionBlock$1(roomDatabase, function1, null);
TransactionElement transactionElement = (TransactionElement) continuation.getContext().get(TransactionElement.Key);
ContinuationInterceptor transactionDispatcher$room_ktx_release = transactionElement != null ? transactionElement.getTransactionDispatcher$room_ktx_release() : null;
if (transactionDispatcher$room_ktx_release != null) {
return BuildersKt.withContext(transactionDispatcher$room_ktx_release, roomDatabaseKt$withTransaction$transactionBlock$1, continuation);
}
return startTransactionCoroutine(roomDatabase, continuation.getContext(), roomDatabaseKt$withTransaction$transactionBlock$1, continuation);
}
/* JADX INFO: Access modifiers changed from: private */
public static final CoroutineContext createTransactionContext(RoomDatabase roomDatabase, ContinuationInterceptor continuationInterceptor) {
TransactionElement transactionElement = new TransactionElement(continuationInterceptor);
return continuationInterceptor.plus(transactionElement).plus(ThreadContextElementKt.asContextElement(roomDatabase.getSuspendingTransactionId(), Integer.valueOf(System.identityHashCode(transactionElement))));
}
public static /* synthetic */ Flow invalidationTrackerFlow$default(RoomDatabase roomDatabase, String[] strArr, boolean z, int i, Object obj) {
if ((i & 2) != 0) {
z = true;
}
return invalidationTrackerFlow(roomDatabase, strArr, z);
}
public static final Flow invalidationTrackerFlow(RoomDatabase roomDatabase, String[] strArr, boolean z) {
return FlowKt.callbackFlow(new RoomDatabaseKt$invalidationTrackerFlow$1(z, roomDatabase, strArr, null));
}
/* JADX INFO: Access modifiers changed from: private */
public static final <R> Object startTransactionCoroutine(final RoomDatabase roomDatabase, final CoroutineContext coroutineContext, final Function2 function2, Continuation continuation) {
Continuation intercepted;
Object coroutine_suspended;
intercepted = IntrinsicsKt__IntrinsicsJvmKt.intercepted(continuation);
final CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(intercepted, 1);
cancellableContinuationImpl.initCancellability();
try {
roomDatabase.getTransactionExecutor().execute(new Runnable() { // from class: androidx.room.RoomDatabaseKt$startTransactionCoroutine$2$1
@DebugMetadata(c = "androidx.room.RoomDatabaseKt$startTransactionCoroutine$2$1$1", f = "RoomDatabaseExt.kt", l = {103}, m = "invokeSuspend")
/* renamed from: androidx.room.RoomDatabaseKt$startTransactionCoroutine$2$1$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
final /* synthetic */ CancellableContinuation $continuation;
final /* synthetic */ RoomDatabase $this_startTransactionCoroutine;
final /* synthetic */ Function2 $transactionBlock;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AnonymousClass1(RoomDatabase roomDatabase, CancellableContinuation cancellableContinuation, Function2 function2, Continuation continuation) {
super(2, continuation);
this.$this_startTransactionCoroutine = roomDatabase;
this.$continuation = cancellableContinuation;
this.$transactionBlock = function2;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$this_startTransactionCoroutine, this.$continuation, this.$transactionBlock, continuation);
anonymousClass1.L$0 = obj;
return anonymousClass1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
CoroutineContext createTransactionContext;
Continuation continuation;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
CoroutineContext.Element element = ((CoroutineScope) this.L$0).getCoroutineContext().get(ContinuationInterceptor.Key);
Intrinsics.checkNotNull(element);
createTransactionContext = RoomDatabaseKt.createTransactionContext(this.$this_startTransactionCoroutine, (ContinuationInterceptor) element);
CancellableContinuation cancellableContinuation = this.$continuation;
Result.Companion companion = Result.Companion;
Function2 function2 = this.$transactionBlock;
this.L$0 = cancellableContinuation;
this.label = 1;
obj = BuildersKt.withContext(createTransactionContext, function2, this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
continuation = cancellableContinuation;
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
continuation = (Continuation) this.L$0;
ResultKt.throwOnFailure(obj);
}
continuation.resumeWith(Result.m4060constructorimpl(obj));
return Unit.INSTANCE;
}
}
@Override // java.lang.Runnable
public final void run() {
try {
BuildersKt.runBlocking(CoroutineContext.this.minusKey(ContinuationInterceptor.Key), new AnonymousClass1(roomDatabase, cancellableContinuationImpl, function2, null));
} catch (Throwable th) {
cancellableContinuationImpl.cancel(th);
}
}
});
} catch (RejectedExecutionException e) {
cancellableContinuationImpl.cancel(new IllegalStateException("Unable to acquire a thread to perform the database transaction.", e));
}
Object result = cancellableContinuationImpl.getResult();
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (result == coroutine_suspended) {
DebugProbesKt.probeCoroutineSuspended(continuation);
}
return result;
}
}

View File

@@ -0,0 +1,25 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class RoomMasterTable {
private static final String COLUMN_ID = "id";
private static final String COLUMN_IDENTITY_HASH = "identity_hash";
public static final String CREATE_QUERY = "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)";
public static final String DEFAULT_ID = "42";
public static final RoomMasterTable INSTANCE = new RoomMasterTable();
public static final String NAME = "room_master_table";
public static final String READ_QUERY = "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1";
public static final String TABLE_NAME = "room_master_table";
private RoomMasterTable() {
}
public static final String createInsertQuery(String hash) {
Intrinsics.checkNotNullParameter(hash, "hash");
return "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '" + hash + "')";
}
}

View File

@@ -0,0 +1,237 @@
package androidx.room;
import android.database.Cursor;
import androidx.annotation.RestrictTo;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SimpleSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.util.Iterator;
import java.util.List;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nRoomOpenHelper.kt\nKotlin\n*S Kotlin\n*F\n+ 1 RoomOpenHelper.kt\nandroidx/room/RoomOpenHelper\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 3 CursorUtil.kt\nandroidx/room/util/CursorUtil\n*L\n1#1,245:1\n1855#2,2:246\n145#3,7:248\n*S KotlinDebug\n*F\n+ 1 RoomOpenHelper.kt\nandroidx/room/RoomOpenHelper\n*L\n90#1:246,2\n137#1:248,7\n*E\n"})
/* loaded from: classes.dex */
public class RoomOpenHelper extends SupportSQLiteOpenHelper.Callback {
public static final Companion Companion = new Companion(null);
private DatabaseConfiguration configuration;
private final Delegate delegate;
private final String identityHash;
private final String legacyHash;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RoomOpenHelper(DatabaseConfiguration configuration, Delegate delegate, String identityHash, String legacyHash) {
super(delegate.version);
Intrinsics.checkNotNullParameter(configuration, "configuration");
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(identityHash, "identityHash");
Intrinsics.checkNotNullParameter(legacyHash, "legacyHash");
this.configuration = configuration;
this.delegate = delegate;
this.identityHash = identityHash;
this.legacyHash = legacyHash;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public RoomOpenHelper(DatabaseConfiguration configuration, Delegate delegate, String legacyHash) {
this(configuration, delegate, "", legacyHash);
Intrinsics.checkNotNullParameter(configuration, "configuration");
Intrinsics.checkNotNullParameter(delegate, "delegate");
Intrinsics.checkNotNullParameter(legacyHash, "legacyHash");
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onConfigure(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
super.onConfigure(db);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onCreate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
boolean hasEmptySchema$room_runtime_release = Companion.hasEmptySchema$room_runtime_release(db);
this.delegate.createAllTables(db);
if (!hasEmptySchema$room_runtime_release) {
ValidationResult onValidateSchema = this.delegate.onValidateSchema(db);
if (!onValidateSchema.isValid) {
throw new IllegalStateException("Pre-packaged database has an invalid schema: " + onValidateSchema.expectedFoundMsg);
}
}
updateIdentity(db);
this.delegate.onCreate(db);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onUpgrade(SupportSQLiteDatabase db, int i, int i2) {
List<Migration> findMigrationPath;
Intrinsics.checkNotNullParameter(db, "db");
DatabaseConfiguration databaseConfiguration = this.configuration;
if (databaseConfiguration != null && (findMigrationPath = databaseConfiguration.migrationContainer.findMigrationPath(i, i2)) != null) {
this.delegate.onPreMigrate(db);
Iterator<T> it = findMigrationPath.iterator();
while (it.hasNext()) {
((Migration) it.next()).migrate(db);
}
ValidationResult onValidateSchema = this.delegate.onValidateSchema(db);
if (!onValidateSchema.isValid) {
throw new IllegalStateException("Migration didn't properly handle: " + onValidateSchema.expectedFoundMsg);
}
this.delegate.onPostMigrate(db);
updateIdentity(db);
return;
}
DatabaseConfiguration databaseConfiguration2 = this.configuration;
if (databaseConfiguration2 != null && !databaseConfiguration2.isMigrationRequired(i, i2)) {
this.delegate.dropAllTables(db);
this.delegate.createAllTables(db);
return;
}
throw new IllegalStateException("A migration from " + i + " to " + i2 + " was required but not found. Please provide the necessary Migration path via RoomDatabase.Builder.addMigration(Migration ...) or allow for destructive migrations via one of the RoomDatabase.Builder.fallbackToDestructiveMigration* methods.");
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onDowngrade(SupportSQLiteDatabase db, int i, int i2) {
Intrinsics.checkNotNullParameter(db, "db");
onUpgrade(db, i, i2);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onOpen(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
super.onOpen(db);
checkIdentity(db);
this.delegate.onOpen(db);
this.configuration = null;
}
private final void checkIdentity(SupportSQLiteDatabase supportSQLiteDatabase) {
if (!Companion.hasRoomMasterTable$room_runtime_release(supportSQLiteDatabase)) {
ValidationResult onValidateSchema = this.delegate.onValidateSchema(supportSQLiteDatabase);
if (onValidateSchema.isValid) {
this.delegate.onPostMigrate(supportSQLiteDatabase);
updateIdentity(supportSQLiteDatabase);
return;
} else {
throw new IllegalStateException("Pre-packaged database has an invalid schema: " + onValidateSchema.expectedFoundMsg);
}
}
Cursor query = supportSQLiteDatabase.query(new SimpleSQLiteQuery(RoomMasterTable.READ_QUERY));
try {
String string = query.moveToFirst() ? query.getString(0) : null;
CloseableKt.closeFinally(query, null);
if (Intrinsics.areEqual(this.identityHash, string) || Intrinsics.areEqual(this.legacyHash, string)) {
return;
}
throw new IllegalStateException("Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number. Expected identity hash: " + this.identityHash + ", found: " + string);
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
CloseableKt.closeFinally(query, th);
throw th2;
}
}
}
private final void updateIdentity(SupportSQLiteDatabase supportSQLiteDatabase) {
createMasterTableIfNotExists(supportSQLiteDatabase);
supportSQLiteDatabase.execSQL(RoomMasterTable.createInsertQuery(this.identityHash));
}
private final void createMasterTableIfNotExists(SupportSQLiteDatabase supportSQLiteDatabase) {
supportSQLiteDatabase.execSQL(RoomMasterTable.CREATE_QUERY);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public static abstract class Delegate {
public final int version;
public abstract void createAllTables(SupportSQLiteDatabase supportSQLiteDatabase);
public abstract void dropAllTables(SupportSQLiteDatabase supportSQLiteDatabase);
public abstract void onCreate(SupportSQLiteDatabase supportSQLiteDatabase);
public abstract void onOpen(SupportSQLiteDatabase supportSQLiteDatabase);
public void onPostMigrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
public void onPreMigrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
public Delegate(int i) {
this.version = i;
}
public void validateMigration(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
throw new UnsupportedOperationException("validateMigration is deprecated");
}
public ValidationResult onValidateSchema(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
validateMigration(db);
return new ValidationResult(true, null);
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public static class ValidationResult {
public final String expectedFoundMsg;
public final boolean isValid;
public ValidationResult(boolean z, String str) {
this.isValid = z;
this.expectedFoundMsg = str;
}
}
@SourceDebugExtension({"SMAP\nRoomOpenHelper.kt\nKotlin\n*S Kotlin\n*F\n+ 1 RoomOpenHelper.kt\nandroidx/room/RoomOpenHelper$Companion\n+ 2 CursorUtil.kt\nandroidx/room/util/CursorUtil\n*L\n1#1,245:1\n145#2,7:246\n145#2,7:253\n*S KotlinDebug\n*F\n+ 1 RoomOpenHelper.kt\nandroidx/room/RoomOpenHelper$Companion\n*L\n231#1:246,7\n239#1:253,7\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final boolean hasRoomMasterTable$room_runtime_release(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
Cursor query = db.query("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name='room_master_table'");
try {
boolean z = false;
if (query.moveToFirst()) {
if (query.getInt(0) != 0) {
z = true;
}
}
CloseableKt.closeFinally(query, null);
return z;
} finally {
}
}
public final boolean hasEmptySchema$room_runtime_release(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
Cursor query = db.query("SELECT count(*) FROM sqlite_master WHERE name != 'android_metadata'");
try {
boolean z = false;
if (query.moveToFirst()) {
if (query.getInt(0) == 0) {
z = true;
}
}
CloseableKt.closeFinally(query, null);
return z;
} finally {
}
}
}
}

View File

@@ -0,0 +1,310 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.sqlite.db.SupportSQLiteProgram;
import androidx.sqlite.db.SupportSQLiteQuery;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import kotlin.Unit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram {
private static final int BLOB = 5;
public static final int DESIRED_POOL_SIZE = 10;
private static final int DOUBLE = 3;
private static final int LONG = 2;
private static final int NULL = 1;
public static final int POOL_LIMIT = 15;
private static final int STRING = 4;
private int argCount;
private final int[] bindingTypes;
public final byte[][] blobBindings;
@VisibleForTesting
private final int capacity;
public final double[] doubleBindings;
public final long[] longBindings;
private volatile String query;
public final String[] stringBindings;
public static final Companion Companion = new Companion(null);
public static final TreeMap<Integer, RoomSQLiteQuery> queryPool = new TreeMap<>();
@Retention(RetentionPolicy.SOURCE)
public @interface Binding {
}
public /* synthetic */ RoomSQLiteQuery(int i, DefaultConstructorMarker defaultConstructorMarker) {
this(i);
}
public static final RoomSQLiteQuery acquire(String str, int i) {
return Companion.acquire(str, i);
}
public static final RoomSQLiteQuery copyFrom(SupportSQLiteQuery supportSQLiteQuery) {
return Companion.copyFrom(supportSQLiteQuery);
}
private static /* synthetic */ void getBindingTypes$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getBlobBindings$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getDoubleBindings$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getLongBindings$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getStringBindings$annotations() {
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
}
@Override // androidx.sqlite.db.SupportSQLiteQuery
public int getArgCount() {
return this.argCount;
}
public final int getCapacity() {
return this.capacity;
}
public final void init(String query, int i) {
Intrinsics.checkNotNullParameter(query, "query");
this.query = query;
this.argCount = i;
}
private RoomSQLiteQuery(int i) {
this.capacity = i;
int i2 = i + 1;
this.bindingTypes = new int[i2];
this.longBindings = new long[i2];
this.doubleBindings = new double[i2];
this.stringBindings = new String[i2];
this.blobBindings = new byte[i2][];
}
public final void release() {
TreeMap<Integer, RoomSQLiteQuery> treeMap = queryPool;
synchronized (treeMap) {
treeMap.put(Integer.valueOf(this.capacity), this);
Companion.prunePoolLocked$room_runtime_release();
Unit unit = Unit.INSTANCE;
}
}
@Override // androidx.sqlite.db.SupportSQLiteQuery
public String getSql() {
String str = this.query;
if (str != null) {
return str;
}
throw new IllegalStateException("Required value was null.".toString());
}
@Override // androidx.sqlite.db.SupportSQLiteQuery
public void bindTo(SupportSQLiteProgram statement) {
Intrinsics.checkNotNullParameter(statement, "statement");
int argCount = getArgCount();
if (1 > argCount) {
return;
}
int i = 1;
while (true) {
int i2 = this.bindingTypes[i];
if (i2 == 1) {
statement.bindNull(i);
} else if (i2 == 2) {
statement.bindLong(i, this.longBindings[i]);
} else if (i2 == 3) {
statement.bindDouble(i, this.doubleBindings[i]);
} else if (i2 == 4) {
String str = this.stringBindings[i];
if (str == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
statement.bindString(i, str);
} else if (i2 == 5) {
byte[] bArr = this.blobBindings[i];
if (bArr == null) {
throw new IllegalArgumentException("Required value was null.".toString());
}
statement.bindBlob(i, bArr);
}
if (i == argCount) {
return;
} else {
i++;
}
}
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindNull(int i) {
this.bindingTypes[i] = 1;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindLong(int i, long j) {
this.bindingTypes[i] = 2;
this.longBindings[i] = j;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindDouble(int i, double d) {
this.bindingTypes[i] = 3;
this.doubleBindings[i] = d;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindString(int i, String value) {
Intrinsics.checkNotNullParameter(value, "value");
this.bindingTypes[i] = 4;
this.stringBindings[i] = value;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindBlob(int i, byte[] value) {
Intrinsics.checkNotNullParameter(value, "value");
this.bindingTypes[i] = 5;
this.blobBindings[i] = value;
}
public final void copyArgumentsFrom(RoomSQLiteQuery other) {
Intrinsics.checkNotNullParameter(other, "other");
int argCount = other.getArgCount() + 1;
System.arraycopy(other.bindingTypes, 0, this.bindingTypes, 0, argCount);
System.arraycopy(other.longBindings, 0, this.longBindings, 0, argCount);
System.arraycopy(other.stringBindings, 0, this.stringBindings, 0, argCount);
System.arraycopy(other.blobBindings, 0, this.blobBindings, 0, argCount);
System.arraycopy(other.doubleBindings, 0, this.doubleBindings, 0, argCount);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void clearBindings() {
Arrays.fill(this.bindingTypes, 1);
Arrays.fill(this.stringBindings, (Object) null);
Arrays.fill(this.blobBindings, (Object) null);
this.query = null;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@VisibleForTesting
public static /* synthetic */ void getDESIRED_POOL_SIZE$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getPOOL_LIMIT$annotations() {
}
@VisibleForTesting
public static /* synthetic */ void getQueryPool$annotations() {
}
private Companion() {
}
public final RoomSQLiteQuery copyFrom(SupportSQLiteQuery supportSQLiteQuery) {
Intrinsics.checkNotNullParameter(supportSQLiteQuery, "supportSQLiteQuery");
final RoomSQLiteQuery acquire = acquire(supportSQLiteQuery.getSql(), supportSQLiteQuery.getArgCount());
supportSQLiteQuery.bindTo(new SupportSQLiteProgram() { // from class: androidx.room.RoomSQLiteQuery$Companion$copyFrom$1
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindBlob(int i, byte[] value) {
Intrinsics.checkNotNullParameter(value, "value");
RoomSQLiteQuery.this.bindBlob(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindDouble(int i, double d) {
RoomSQLiteQuery.this.bindDouble(i, d);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindLong(int i, long j) {
RoomSQLiteQuery.this.bindLong(i, j);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindNull(int i) {
RoomSQLiteQuery.this.bindNull(i);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindString(int i, String value) {
Intrinsics.checkNotNullParameter(value, "value");
RoomSQLiteQuery.this.bindString(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void clearBindings() {
RoomSQLiteQuery.this.clearBindings();
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
RoomSQLiteQuery.this.close();
}
});
return acquire;
}
public final RoomSQLiteQuery acquire(String query, int i) {
Intrinsics.checkNotNullParameter(query, "query");
TreeMap<Integer, RoomSQLiteQuery> treeMap = RoomSQLiteQuery.queryPool;
synchronized (treeMap) {
Map.Entry<Integer, RoomSQLiteQuery> ceilingEntry = treeMap.ceilingEntry(Integer.valueOf(i));
if (ceilingEntry != null) {
treeMap.remove(ceilingEntry.getKey());
RoomSQLiteQuery sqliteQuery = ceilingEntry.getValue();
sqliteQuery.init(query, i);
Intrinsics.checkNotNullExpressionValue(sqliteQuery, "sqliteQuery");
return sqliteQuery;
}
Unit unit = Unit.INSTANCE;
RoomSQLiteQuery roomSQLiteQuery = new RoomSQLiteQuery(i, null);
roomSQLiteQuery.init(query, i);
return roomSQLiteQuery;
}
}
public final void prunePoolLocked$room_runtime_release() {
TreeMap<Integer, RoomSQLiteQuery> treeMap = RoomSQLiteQuery.queryPool;
if (treeMap.size() <= 15) {
return;
}
int size = treeMap.size() - 10;
Iterator<Integer> it = treeMap.descendingKeySet().iterator();
Intrinsics.checkNotNullExpressionValue(it, "queryPool.descendingKeySet().iterator()");
while (true) {
int i = size - 1;
if (size <= 0) {
return;
}
it.next();
it.remove();
size = i;
}
}
}
}

View File

@@ -0,0 +1,158 @@
package androidx.room;
import android.annotation.SuppressLint;
import androidx.arch.core.executor.ArchTaskExecutor;
import androidx.lifecycle.LiveData;
import androidx.room.InvalidationTracker;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.Intrinsics;
@SuppressLint({"RestrictedApi"})
/* loaded from: classes.dex */
public final class RoomTrackingLiveData<T> extends LiveData<T> {
private final Callable<T> computeFunction;
private final AtomicBoolean computing;
private final InvalidationLiveDataContainer container;
private final RoomDatabase database;
private final boolean inTransaction;
private final AtomicBoolean invalid;
private final Runnable invalidationRunnable;
private final InvalidationTracker.Observer observer;
private final Runnable refreshRunnable;
private final AtomicBoolean registeredObserver;
public final Callable<T> getComputeFunction() {
return this.computeFunction;
}
public final AtomicBoolean getComputing() {
return this.computing;
}
public final RoomDatabase getDatabase() {
return this.database;
}
public final boolean getInTransaction() {
return this.inTransaction;
}
public final AtomicBoolean getInvalid() {
return this.invalid;
}
public final Runnable getInvalidationRunnable() {
return this.invalidationRunnable;
}
public final InvalidationTracker.Observer getObserver() {
return this.observer;
}
public final Runnable getRefreshRunnable() {
return this.refreshRunnable;
}
public final AtomicBoolean getRegisteredObserver() {
return this.registeredObserver;
}
public RoomTrackingLiveData(RoomDatabase database, InvalidationLiveDataContainer container, boolean z, Callable<T> computeFunction, final String[] tableNames) {
Intrinsics.checkNotNullParameter(database, "database");
Intrinsics.checkNotNullParameter(container, "container");
Intrinsics.checkNotNullParameter(computeFunction, "computeFunction");
Intrinsics.checkNotNullParameter(tableNames, "tableNames");
this.database = database;
this.container = container;
this.inTransaction = z;
this.computeFunction = computeFunction;
this.observer = new InvalidationTracker.Observer(tableNames) { // from class: androidx.room.RoomTrackingLiveData$observer$1
@Override // androidx.room.InvalidationTracker.Observer
public void onInvalidated(Set<String> tables) {
Intrinsics.checkNotNullParameter(tables, "tables");
ArchTaskExecutor.getInstance().executeOnMainThread(this.getInvalidationRunnable());
}
};
this.invalid = new AtomicBoolean(true);
this.computing = new AtomicBoolean(false);
this.registeredObserver = new AtomicBoolean(false);
this.refreshRunnable = new Runnable() { // from class: androidx.room.RoomTrackingLiveData$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
RoomTrackingLiveData.refreshRunnable$lambda$0(RoomTrackingLiveData.this);
}
};
this.invalidationRunnable = new Runnable() { // from class: androidx.room.RoomTrackingLiveData$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
RoomTrackingLiveData.invalidationRunnable$lambda$1(RoomTrackingLiveData.this);
}
};
}
/* JADX INFO: Access modifiers changed from: private */
public static final void refreshRunnable$lambda$0(RoomTrackingLiveData this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (this$0.registeredObserver.compareAndSet(false, true)) {
this$0.database.getInvalidationTracker().addWeakObserver(this$0.observer);
}
while (this$0.computing.compareAndSet(false, true)) {
T t = null;
boolean z = false;
while (this$0.invalid.compareAndSet(true, false)) {
try {
try {
t = this$0.computeFunction.call();
z = true;
} catch (Exception e) {
throw new RuntimeException("Exception while computing database live data.", e);
}
} finally {
this$0.computing.set(false);
}
}
if (z) {
this$0.postValue(t);
}
if (!z || !this$0.invalid.get()) {
return;
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public static final void invalidationRunnable$lambda$1(RoomTrackingLiveData this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
boolean hasActiveObservers = this$0.hasActiveObservers();
if (this$0.invalid.compareAndSet(false, true) && hasActiveObservers) {
this$0.getQueryExecutor().execute(this$0.refreshRunnable);
}
}
@Override // androidx.lifecycle.LiveData
public void onActive() {
super.onActive();
InvalidationLiveDataContainer invalidationLiveDataContainer = this.container;
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type androidx.lifecycle.LiveData<kotlin.Any>");
invalidationLiveDataContainer.onActive(this);
getQueryExecutor().execute(this.refreshRunnable);
}
@Override // androidx.lifecycle.LiveData
public void onInactive() {
super.onInactive();
InvalidationLiveDataContainer invalidationLiveDataContainer = this.container;
Intrinsics.checkNotNull(this, "null cannot be cast to non-null type androidx.lifecycle.LiveData<kotlin.Any>");
invalidationLiveDataContainer.onInactive(this);
}
public final Executor getQueryExecutor() {
if (this.inTransaction) {
return this.database.getTransactionExecutor();
}
return this.database.getQueryExecutor();
}
}

View File

@@ -0,0 +1,36 @@
package androidx.room;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes.dex */
public class RoomWarnings {
public static final String AMBIGUOUS_COLUMN_IN_RESULT = "ROOM_AMBIGUOUS_COLUMN_IN_RESULT";
public static final String CANNOT_CREATE_VERIFICATION_DATABASE = "ROOM_CANNOT_CREATE_VERIFICATION_DATABASE";
public static final String CURSOR_MISMATCH = "ROOM_CURSOR_MISMATCH";
public static final Companion Companion = new Companion(null);
public static final String DEFAULT_CONSTRUCTOR = "ROOM_DEFAULT_CONSTRUCTOR";
public static final String DOES_NOT_IMPLEMENT_EQUALS_HASHCODE = "ROOM_TYPE_DOES_NOT_IMPLEMENT_EQUALS_HASHCODE";
public static final String INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED = "ROOM_EMBEDDED_ENTITY_INDEX_IS_DROPPED";
public static final String INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED = "ROOM_EMBEDDED_INDEX_IS_DROPPED";
public static final String INDEX_FROM_PARENT_FIELD_IS_DROPPED = "ROOM_PARENT_FIELD_INDEX_IS_DROPPED";
public static final String INDEX_FROM_PARENT_IS_DROPPED = "ROOM_PARENT_INDEX_IS_DROPPED";
public static final String MISMATCHED_GETTER = "ROOM_MISMATCHED_GETTER_TYPE";
public static final String MISMATCHED_SETTER = "ROOM_MISMATCHED_SETTER_TYPE";
public static final String MISSING_INDEX_ON_FOREIGN_KEY_CHILD = "ROOM_MISSING_FOREIGN_KEY_CHILD_INDEX";
public static final String MISSING_INDEX_ON_JUNCTION = "MISSING_INDEX_ON_JUNCTION";
public static final String MISSING_JAVA_TMP_DIR = "ROOM_MISSING_JAVA_TMP_DIR";
public static final String MISSING_SCHEMA_LOCATION = "ROOM_MISSING_SCHEMA_LOCATION";
public static final String PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED = "ROOM_EMBEDDED_PRIMARY_KEY_IS_DROPPED";
public static final String RELATION_QUERY_WITHOUT_TRANSACTION = "ROOM_RELATION_QUERY_WITHOUT_TRANSACTION";
public static final String RELATION_TYPE_MISMATCH = "ROOM_RELATION_TYPE_MISMATCH";
public static final String UNNECESSARY_NULLABILITY_IN_DAO_RETURN_TYPE = "ROOM_UNNECESSARY_NULLABILITY_IN_DAO_RETURN_TYPE";
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,255 @@
package androidx.room;
import android.content.Context;
import android.util.Log;
import androidx.annotation.RequiresApi;
import androidx.room.RoomDatabase;
import androidx.room.util.DBUtil;
import androidx.room.util.FileUtil;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory;
import androidx.sqlite.util.ProcessLock;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.util.concurrent.Callable;
import kotlin.Unit;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.ranges.RangesKt___RangesKt;
/* loaded from: classes.dex */
public final class SQLiteCopyOpenHelper implements SupportSQLiteOpenHelper, DelegatingOpenHelper {
private final Context context;
private final String copyFromAssetPath;
private final File copyFromFile;
private final Callable<InputStream> copyFromInputStream;
private DatabaseConfiguration databaseConfiguration;
private final int databaseVersion;
private final SupportSQLiteOpenHelper delegate;
private boolean verified;
@Override // androidx.room.DelegatingOpenHelper
public SupportSQLiteOpenHelper getDelegate() {
return this.delegate;
}
public final void setDatabaseConfiguration(DatabaseConfiguration databaseConfiguration) {
Intrinsics.checkNotNullParameter(databaseConfiguration, "databaseConfiguration");
this.databaseConfiguration = databaseConfiguration;
}
public SQLiteCopyOpenHelper(Context context, String str, File file, Callable<InputStream> callable, int i, SupportSQLiteOpenHelper delegate) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.context = context;
this.copyFromAssetPath = str;
this.copyFromFile = file;
this.copyFromInputStream = callable;
this.databaseVersion = i;
this.delegate = delegate;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public String getDatabaseName() {
return getDelegate().getDatabaseName();
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
@RequiresApi(api = 16)
public void setWriteAheadLoggingEnabled(boolean z) {
getDelegate().setWriteAheadLoggingEnabled(z);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public SupportSQLiteDatabase getWritableDatabase() {
if (!this.verified) {
verifyDatabaseFile(true);
this.verified = true;
}
return getDelegate().getWritableDatabase();
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public SupportSQLiteDatabase getReadableDatabase() {
if (!this.verified) {
verifyDatabaseFile(false);
this.verified = true;
}
return getDelegate().getReadableDatabase();
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper, java.io.Closeable, java.lang.AutoCloseable
public synchronized void close() {
getDelegate().close();
this.verified = false;
}
private final void verifyDatabaseFile(boolean z) {
String databaseName = getDatabaseName();
if (databaseName == null) {
throw new IllegalStateException("Required value was null.".toString());
}
File databaseFile = this.context.getDatabasePath(databaseName);
DatabaseConfiguration databaseConfiguration = this.databaseConfiguration;
DatabaseConfiguration databaseConfiguration2 = null;
if (databaseConfiguration == null) {
Intrinsics.throwUninitializedPropertyAccessException("databaseConfiguration");
databaseConfiguration = null;
}
ProcessLock processLock = new ProcessLock(databaseName, this.context.getFilesDir(), databaseConfiguration.multiInstanceInvalidation);
try {
ProcessLock.lock$default(processLock, false, 1, null);
if (!databaseFile.exists()) {
try {
Intrinsics.checkNotNullExpressionValue(databaseFile, "databaseFile");
copyDatabaseFile(databaseFile, z);
processLock.unlock();
return;
} catch (IOException e) {
throw new RuntimeException("Unable to copy database file.", e);
}
}
try {
Intrinsics.checkNotNullExpressionValue(databaseFile, "databaseFile");
int readVersion = DBUtil.readVersion(databaseFile);
if (readVersion == this.databaseVersion) {
processLock.unlock();
return;
}
DatabaseConfiguration databaseConfiguration3 = this.databaseConfiguration;
if (databaseConfiguration3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("databaseConfiguration");
} else {
databaseConfiguration2 = databaseConfiguration3;
}
if (databaseConfiguration2.isMigrationRequired(readVersion, this.databaseVersion)) {
processLock.unlock();
return;
}
if (this.context.deleteDatabase(databaseName)) {
try {
copyDatabaseFile(databaseFile, z);
} catch (IOException e2) {
Log.w(Room.LOG_TAG, "Unable to copy database file.", e2);
}
} else {
Log.w(Room.LOG_TAG, "Failed to delete database file (" + databaseName + ") for a copy destructive migration.");
}
processLock.unlock();
return;
} catch (IOException e3) {
Log.w(Room.LOG_TAG, "Unable to read database version.", e3);
processLock.unlock();
return;
}
} catch (Throwable th) {
processLock.unlock();
throw th;
}
processLock.unlock();
throw th;
}
private final void copyDatabaseFile(File file, boolean z) throws IOException {
ReadableByteChannel newChannel;
if (this.copyFromAssetPath != null) {
newChannel = Channels.newChannel(this.context.getAssets().open(this.copyFromAssetPath));
Intrinsics.checkNotNullExpressionValue(newChannel, "newChannel(context.assets.open(copyFromAssetPath))");
} else if (this.copyFromFile != null) {
newChannel = new FileInputStream(this.copyFromFile).getChannel();
Intrinsics.checkNotNullExpressionValue(newChannel, "FileInputStream(copyFromFile).channel");
} else {
Callable<InputStream> callable = this.copyFromInputStream;
if (callable != null) {
try {
newChannel = Channels.newChannel(callable.call());
Intrinsics.checkNotNullExpressionValue(newChannel, "newChannel(inputStream)");
} catch (Exception e) {
throw new IOException("inputStreamCallable exception on call", e);
}
} else {
throw new IllegalStateException("copyFromAssetPath, copyFromFile and copyFromInputStream are all null!");
}
}
File intermediateFile = File.createTempFile("room-copy-helper", ".tmp", this.context.getCacheDir());
intermediateFile.deleteOnExit();
FileChannel output = new FileOutputStream(intermediateFile).getChannel();
Intrinsics.checkNotNullExpressionValue(output, "output");
FileUtil.copy(newChannel, output);
File parentFile = file.getParentFile();
if (parentFile != null && !parentFile.exists() && !parentFile.mkdirs()) {
throw new IOException("Failed to create directories for " + file.getAbsolutePath());
}
Intrinsics.checkNotNullExpressionValue(intermediateFile, "intermediateFile");
dispatchOnOpenPrepackagedDatabase(intermediateFile, z);
if (intermediateFile.renameTo(file)) {
return;
}
throw new IOException("Failed to move intermediate file (" + intermediateFile.getAbsolutePath() + ") to destination (" + file.getAbsolutePath() + ").");
}
private final void dispatchOnOpenPrepackagedDatabase(File file, boolean z) {
DatabaseConfiguration databaseConfiguration = this.databaseConfiguration;
if (databaseConfiguration == null) {
Intrinsics.throwUninitializedPropertyAccessException("databaseConfiguration");
databaseConfiguration = null;
}
if (databaseConfiguration.prepackagedDatabaseCallback == null) {
return;
}
SupportSQLiteOpenHelper createFrameworkOpenHelper = createFrameworkOpenHelper(file);
try {
SupportSQLiteDatabase writableDatabase = z ? createFrameworkOpenHelper.getWritableDatabase() : createFrameworkOpenHelper.getReadableDatabase();
DatabaseConfiguration databaseConfiguration2 = this.databaseConfiguration;
if (databaseConfiguration2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("databaseConfiguration");
databaseConfiguration2 = null;
}
RoomDatabase.PrepackagedDatabaseCallback prepackagedDatabaseCallback = databaseConfiguration2.prepackagedDatabaseCallback;
Intrinsics.checkNotNull(prepackagedDatabaseCallback);
prepackagedDatabaseCallback.onOpenPrepackagedDatabase(writableDatabase);
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(createFrameworkOpenHelper, null);
} finally {
}
}
private final SupportSQLiteOpenHelper createFrameworkOpenHelper(File file) {
final int coerceAtLeast;
try {
final int readVersion = DBUtil.readVersion(file);
FrameworkSQLiteOpenHelperFactory frameworkSQLiteOpenHelperFactory = new FrameworkSQLiteOpenHelperFactory();
SupportSQLiteOpenHelper.Configuration.Builder name = SupportSQLiteOpenHelper.Configuration.Companion.builder(this.context).name(file.getAbsolutePath());
coerceAtLeast = RangesKt___RangesKt.coerceAtLeast(readVersion, 1);
return frameworkSQLiteOpenHelperFactory.create(name.callback(new SupportSQLiteOpenHelper.Callback(coerceAtLeast) { // from class: androidx.room.SQLiteCopyOpenHelper$createFrameworkOpenHelper$configuration$1
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onCreate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onUpgrade(SupportSQLiteDatabase db, int i, int i2) {
Intrinsics.checkNotNullParameter(db, "db");
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Callback
public void onOpen(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
int i = readVersion;
if (i < 1) {
db.setVersion(i);
}
}
}).build());
} catch (IOException e) {
throw new RuntimeException("Malformed database file, unable to read version.", e);
}
}
}

View File

@@ -0,0 +1,29 @@
package androidx.room;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.io.File;
import java.io.InputStream;
import java.util.concurrent.Callable;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class SQLiteCopyOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
private final String mCopyFromAssetPath;
private final File mCopyFromFile;
private final Callable<InputStream> mCopyFromInputStream;
private final SupportSQLiteOpenHelper.Factory mDelegate;
public SQLiteCopyOpenHelperFactory(String str, File file, Callable<InputStream> callable, SupportSQLiteOpenHelper.Factory mDelegate) {
Intrinsics.checkNotNullParameter(mDelegate, "mDelegate");
this.mCopyFromAssetPath = str;
this.mCopyFromFile = file;
this.mCopyFromInputStream = callable;
this.mDelegate = mDelegate;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Factory
public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
return new SQLiteCopyOpenHelper(configuration.context, this.mCopyFromAssetPath, this.mCopyFromFile, this.mCopyFromInputStream, configuration.callback.version, this.mDelegate.create(configuration));
}
}

View File

@@ -0,0 +1,71 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public abstract class SharedSQLiteStatement {
private final RoomDatabase database;
private final AtomicBoolean lock;
private final Lazy stmt$delegate;
public abstract String createQuery();
public SharedSQLiteStatement(RoomDatabase database) {
Lazy lazy;
Intrinsics.checkNotNullParameter(database, "database");
this.database = database;
this.lock = new AtomicBoolean(false);
lazy = LazyKt__LazyJVMKt.lazy(new Function0() { // from class: androidx.room.SharedSQLiteStatement$stmt$2
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final SupportSQLiteStatement invoke() {
SupportSQLiteStatement createNewStatement;
createNewStatement = SharedSQLiteStatement.this.createNewStatement();
return createNewStatement;
}
});
this.stmt$delegate = lazy;
}
private final SupportSQLiteStatement getStmt() {
return (SupportSQLiteStatement) this.stmt$delegate.getValue();
}
public void assertNotMainThread() {
this.database.assertNotMainThread();
}
/* JADX INFO: Access modifiers changed from: private */
public final SupportSQLiteStatement createNewStatement() {
return this.database.compileStatement(createQuery());
}
private final SupportSQLiteStatement getStmt(boolean z) {
if (z) {
return getStmt();
}
return createNewStatement();
}
public SupportSQLiteStatement acquire() {
assertNotMainThread();
return getStmt(this.lock.compareAndSet(false, true));
}
public void release(SupportSQLiteStatement statement) {
Intrinsics.checkNotNullParameter(statement, "statement");
if (statement == getStmt()) {
this.lock.set(false);
}
}
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface SkipQueryVerification {
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Transaction {
}

View File

@@ -0,0 +1,68 @@
package androidx.room;
import androidx.annotation.RestrictTo;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public final class TransactionElement implements CoroutineContext.Element {
public static final Key Key = new Key(null);
private final AtomicInteger referenceCount = new AtomicInteger(0);
private final ContinuationInterceptor transactionDispatcher;
@Override // kotlin.coroutines.CoroutineContext.Element
public CoroutineContext.Key getKey() {
return Key;
}
public final ContinuationInterceptor getTransactionDispatcher$room_ktx_release() {
return this.transactionDispatcher;
}
public TransactionElement(ContinuationInterceptor continuationInterceptor) {
this.transactionDispatcher = continuationInterceptor;
}
@Override // kotlin.coroutines.CoroutineContext
public <R> R fold(R r, Function2 function2) {
return (R) CoroutineContext.Element.DefaultImpls.fold(this, r, function2);
}
@Override // kotlin.coroutines.CoroutineContext.Element, kotlin.coroutines.CoroutineContext
public <E extends CoroutineContext.Element> E get(CoroutineContext.Key key) {
return (E) CoroutineContext.Element.DefaultImpls.get(this, key);
}
@Override // kotlin.coroutines.CoroutineContext
public CoroutineContext minusKey(CoroutineContext.Key key) {
return CoroutineContext.Element.DefaultImpls.minusKey(this, key);
}
@Override // kotlin.coroutines.CoroutineContext
public CoroutineContext plus(CoroutineContext coroutineContext) {
return CoroutineContext.Element.DefaultImpls.plus(this, coroutineContext);
}
public static final class Key implements CoroutineContext.Key {
public /* synthetic */ Key(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Key() {
}
}
public final void acquire() {
this.referenceCount.incrementAndGet();
}
public final void release() {
if (this.referenceCount.decrementAndGet() < 0) {
throw new IllegalStateException("Transaction was never started or was already released.");
}
}
}

View File

@@ -0,0 +1,71 @@
package androidx.room;
import java.util.ArrayDeque;
import java.util.concurrent.Executor;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nTransactionExecutor.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TransactionExecutor.kt\nandroidx/room/TransactionExecutor\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,55:1\n1#2:56\n*E\n"})
/* loaded from: classes.dex */
public final class TransactionExecutor implements Executor {
private Runnable active;
private final Executor executor;
private final Object syncLock;
private final ArrayDeque<Runnable> tasks;
public TransactionExecutor(Executor executor) {
Intrinsics.checkNotNullParameter(executor, "executor");
this.executor = executor;
this.tasks = new ArrayDeque<>();
this.syncLock = new Object();
}
@Override // java.util.concurrent.Executor
public void execute(final Runnable command) {
Intrinsics.checkNotNullParameter(command, "command");
synchronized (this.syncLock) {
try {
this.tasks.offer(new Runnable() { // from class: androidx.room.TransactionExecutor$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
TransactionExecutor.execute$lambda$1$lambda$0(command, this);
}
});
if (this.active == null) {
scheduleNext();
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public static final void execute$lambda$1$lambda$0(Runnable command, TransactionExecutor this$0) {
Intrinsics.checkNotNullParameter(command, "$command");
Intrinsics.checkNotNullParameter(this$0, "this$0");
try {
command.run();
} finally {
this$0.scheduleNext();
}
}
public final void scheduleNext() {
synchronized (this.syncLock) {
try {
Runnable poll = this.tasks.poll();
Runnable runnable = poll;
this.active = runnable;
if (poll != null) {
this.executor.execute(runnable);
}
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,12 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface TypeConverter {
}

View File

@@ -0,0 +1,15 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface TypeConverters {
BuiltInTypeConverters builtInTypeConverters() default @BuiltInTypeConverters;
Class<?>[] value() default {};
}

View File

@@ -0,0 +1,16 @@
package androidx.room;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Update {
Class<?> entity() default Object.class;
@OnConflictStrategy
int onConflict() default 3;
}

View File

@@ -0,0 +1,15 @@
package androidx.room;
import androidx.annotation.RequiresApi;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@RequiresApi(16)
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface Upsert {
Class<?> entity() default Object.class;
}

View File

@@ -0,0 +1,7 @@
package androidx.room.ktx;
/* loaded from: classes.dex */
public final class R {
private R() {
}
}

View File

@@ -0,0 +1,11 @@
package androidx.room.migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public interface AutoMigrationSpec {
default void onPostMigrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
}
}

View File

@@ -0,0 +1,16 @@
package androidx.room.migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
/* loaded from: classes.dex */
public abstract class Migration {
public final int endVersion;
public final int startVersion;
public abstract void migrate(SupportSQLiteDatabase supportSQLiteDatabase);
public Migration(int i, int i2) {
this.startVersion = i;
this.endVersion = i2;
}
}

View File

@@ -0,0 +1,23 @@
package androidx.room.migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.functions.Function1;
/* loaded from: classes.dex */
final class MigrationImpl extends Migration {
private final Function1 migrateCallback;
public final Function1 getMigrateCallback() {
return this.migrateCallback;
}
public MigrationImpl(int i, int i2, Function1 function1) {
super(i, i2);
this.migrateCallback = function1;
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase supportSQLiteDatabase) {
this.migrateCallback.invoke(supportSQLiteDatabase);
}
}

View File

@@ -0,0 +1,10 @@
package androidx.room.migration;
import kotlin.jvm.functions.Function1;
/* loaded from: classes.dex */
public final class MigrationKt {
public static final Migration Migration(int i, int i2, Function1 function1) {
return new MigrationImpl(i, i2, function1);
}
}

View File

@@ -0,0 +1,178 @@
package androidx.room.paging;
import android.database.Cursor;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.paging.PositionalDataSource;
import androidx.room.InvalidationTracker;
import androidx.room.RoomDatabase;
import androidx.room.RoomSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteQuery;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public abstract class LimitOffsetDataSource<T> extends PositionalDataSource<T> {
private final String mCountQuery;
private final RoomDatabase mDb;
private final boolean mInTransaction;
private final String mLimitOffsetQuery;
private final InvalidationTracker.Observer mObserver;
private final AtomicBoolean mRegisteredObserver;
private final RoomSQLiteQuery mSourceQuery;
@NonNull
public abstract List<T> convertRows(@NonNull Cursor cursor);
public LimitOffsetDataSource(@NonNull RoomDatabase roomDatabase, @NonNull SupportSQLiteQuery supportSQLiteQuery, boolean z, @NonNull String... strArr) {
this(roomDatabase, RoomSQLiteQuery.copyFrom(supportSQLiteQuery), z, strArr);
}
public LimitOffsetDataSource(@NonNull RoomDatabase roomDatabase, @NonNull SupportSQLiteQuery supportSQLiteQuery, boolean z, boolean z2, @NonNull String... strArr) {
this(roomDatabase, RoomSQLiteQuery.copyFrom(supportSQLiteQuery), z, z2, strArr);
}
public LimitOffsetDataSource(@NonNull RoomDatabase roomDatabase, @NonNull RoomSQLiteQuery roomSQLiteQuery, boolean z, @NonNull String... strArr) {
this(roomDatabase, roomSQLiteQuery, z, true, strArr);
}
public LimitOffsetDataSource(@NonNull RoomDatabase roomDatabase, @NonNull RoomSQLiteQuery roomSQLiteQuery, boolean z, boolean z2, @NonNull String... strArr) {
this.mRegisteredObserver = new AtomicBoolean(false);
this.mDb = roomDatabase;
this.mSourceQuery = roomSQLiteQuery;
this.mInTransaction = z;
this.mCountQuery = "SELECT COUNT(*) FROM ( " + roomSQLiteQuery.getSql() + " )";
this.mLimitOffsetQuery = "SELECT * FROM ( " + roomSQLiteQuery.getSql() + " ) LIMIT ? OFFSET ?";
this.mObserver = new InvalidationTracker.Observer(strArr) { // from class: androidx.room.paging.LimitOffsetDataSource.1
@Override // androidx.room.InvalidationTracker.Observer
public void onInvalidated(@NonNull Set<String> set) {
LimitOffsetDataSource.this.invalidate();
}
};
if (z2) {
registerObserverIfNecessary();
}
}
private void registerObserverIfNecessary() {
if (this.mRegisteredObserver.compareAndSet(false, true)) {
this.mDb.getInvalidationTracker().addWeakObserver(this.mObserver);
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY})
public int countItems() {
registerObserverIfNecessary();
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(this.mCountQuery, this.mSourceQuery.getArgCount());
acquire.copyArgumentsFrom(this.mSourceQuery);
Cursor query = this.mDb.query(acquire);
try {
if (query.moveToFirst()) {
return query.getInt(0);
}
return 0;
} finally {
query.close();
acquire.release();
}
}
public boolean isInvalid() {
registerObserverIfNecessary();
this.mDb.getInvalidationTracker().refreshVersionsSync();
return super.isInvalid();
}
public void loadInitial(@NonNull PositionalDataSource.LoadInitialParams loadInitialParams, @NonNull PositionalDataSource.LoadInitialCallback<T> loadInitialCallback) {
RoomSQLiteQuery roomSQLiteQuery;
int i;
RoomSQLiteQuery roomSQLiteQuery2;
registerObserverIfNecessary();
List<T> emptyList = Collections.emptyList();
this.mDb.beginTransaction();
Cursor cursor = null;
try {
int countItems = countItems();
if (countItems != 0) {
int computeInitialLoadPosition = computeInitialLoadPosition(loadInitialParams, countItems);
roomSQLiteQuery = getSQLiteQuery(computeInitialLoadPosition, computeInitialLoadSize(loadInitialParams, computeInitialLoadPosition, countItems));
try {
cursor = this.mDb.query(roomSQLiteQuery);
List<T> convertRows = convertRows(cursor);
this.mDb.setTransactionSuccessful();
roomSQLiteQuery2 = roomSQLiteQuery;
i = computeInitialLoadPosition;
emptyList = convertRows;
} catch (Throwable th) {
th = th;
if (cursor != null) {
cursor.close();
}
this.mDb.endTransaction();
if (roomSQLiteQuery != null) {
roomSQLiteQuery.release();
}
throw th;
}
} else {
i = 0;
roomSQLiteQuery2 = null;
}
if (cursor != null) {
cursor.close();
}
this.mDb.endTransaction();
if (roomSQLiteQuery2 != null) {
roomSQLiteQuery2.release();
}
loadInitialCallback.onResult(emptyList, i, countItems);
} catch (Throwable th2) {
th = th2;
roomSQLiteQuery = null;
}
}
public void loadRange(@NonNull PositionalDataSource.LoadRangeParams loadRangeParams, @NonNull PositionalDataSource.LoadRangeCallback<T> loadRangeCallback) {
loadRangeCallback.onResult(loadRange(loadRangeParams.startPosition, loadRangeParams.loadSize));
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY})
public List<T> loadRange(int i, int i2) {
RoomSQLiteQuery sQLiteQuery = getSQLiteQuery(i, i2);
if (this.mInTransaction) {
this.mDb.beginTransaction();
Cursor cursor = null;
try {
cursor = this.mDb.query(sQLiteQuery);
List<T> convertRows = convertRows(cursor);
this.mDb.setTransactionSuccessful();
return convertRows;
} finally {
if (cursor != null) {
cursor.close();
}
this.mDb.endTransaction();
sQLiteQuery.release();
}
}
Cursor query = this.mDb.query(sQLiteQuery);
try {
return convertRows(query);
} finally {
query.close();
sQLiteQuery.release();
}
}
private RoomSQLiteQuery getSQLiteQuery(int i, int i2) {
RoomSQLiteQuery acquire = RoomSQLiteQuery.acquire(this.mLimitOffsetQuery, this.mSourceQuery.getArgCount() + 2);
acquire.copyArgumentsFrom(this.mSourceQuery);
acquire.bindLong(acquire.getArgCount() - 1, i2);
acquire.bindLong(acquire.getArgCount(), i);
return acquire;
}
}

View File

@@ -0,0 +1,153 @@
package androidx.room.util;
import android.database.Cursor;
import android.database.CursorWrapper;
import android.database.MatrixCursor;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsJVMKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nCursorUtil.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CursorUtil.kt\nandroidx/room/util/CursorUtil\n+ 2 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,184:1\n145#1,7:185\n13644#2,3:192\n1#3:195\n*S KotlinDebug\n*F\n+ 1 CursorUtil.kt\nandroidx/room/util/CursorUtil\n*L\n39#1:185,7\n127#1:192,3\n*E\n"})
/* loaded from: classes.dex */
public final class CursorUtil {
private static final int findColumnIndexBySuffix(Cursor cursor, String str) {
return -1;
}
public static final Cursor copyAndClose(Cursor c) {
Intrinsics.checkNotNullParameter(c, "c");
try {
MatrixCursor matrixCursor = new MatrixCursor(c.getColumnNames(), c.getCount());
while (c.moveToNext()) {
Object[] objArr = new Object[c.getColumnCount()];
int columnCount = c.getColumnCount();
for (int i = 0; i < columnCount; i++) {
int type = c.getType(i);
if (type == 0) {
objArr[i] = null;
} else if (type == 1) {
objArr[i] = Long.valueOf(c.getLong(i));
} else if (type == 2) {
objArr[i] = Double.valueOf(c.getDouble(i));
} else if (type == 3) {
objArr[i] = c.getString(i);
} else if (type == 4) {
objArr[i] = c.getBlob(i);
} else {
throw new IllegalStateException();
}
}
matrixCursor.addRow(objArr);
}
CloseableKt.closeFinally(c, null);
return matrixCursor;
} finally {
}
}
public static final int getColumnIndex(Cursor c, String name) {
Intrinsics.checkNotNullParameter(c, "c");
Intrinsics.checkNotNullParameter(name, "name");
int columnIndex = c.getColumnIndex(name);
if (columnIndex >= 0) {
return columnIndex;
}
int columnIndex2 = c.getColumnIndex('`' + name + '`');
return columnIndex2 >= 0 ? columnIndex2 : findColumnIndexBySuffix(c, name);
}
public static final int getColumnIndexOrThrow(Cursor c, String name) {
String str;
Intrinsics.checkNotNullParameter(c, "c");
Intrinsics.checkNotNullParameter(name, "name");
int columnIndex = getColumnIndex(c, name);
if (columnIndex >= 0) {
return columnIndex;
}
try {
String[] columnNames = c.getColumnNames();
Intrinsics.checkNotNullExpressionValue(columnNames, "c.columnNames");
str = ArraysKt___ArraysKt.joinToString$default(columnNames, (CharSequence) null, (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (Function1) null, 63, (Object) null);
} catch (Exception unused) {
str = "unknown";
}
throw new IllegalArgumentException("column '" + name + "' does not exist. Available columns: " + str);
}
@VisibleForTesting
public static final int findColumnIndexBySuffix(String[] columnNames, String name) {
Intrinsics.checkNotNullParameter(columnNames, "columnNames");
Intrinsics.checkNotNullParameter(name, "name");
String str = '.' + name;
String str2 = '.' + name + '`';
int length = columnNames.length;
int i = 0;
int i2 = 0;
while (i < length) {
String str3 = columnNames[i];
int i3 = i2 + 1;
if (str3.length() >= name.length() + 2) {
if (StringsKt__StringsJVMKt.endsWith$default(str3, str, false, 2, null)) {
return i2;
}
if (str3.charAt(0) == '`' && StringsKt__StringsJVMKt.endsWith$default(str3, str2, false, 2, null)) {
return i2;
}
}
i++;
i2 = i3;
}
return -1;
}
public static final <R> R useCursor(Cursor cursor, Function1 block) {
Intrinsics.checkNotNullParameter(cursor, "<this>");
Intrinsics.checkNotNullParameter(block, "block");
try {
R r = (R) block.invoke(cursor);
InlineMarker.finallyStart(1);
CloseableKt.closeFinally(cursor, null);
InlineMarker.finallyEnd(1);
return r;
} finally {
}
}
public static final Cursor wrapMappedColumns(final Cursor cursor, final String[] columnNames, final int[] mapping) {
Intrinsics.checkNotNullParameter(cursor, "cursor");
Intrinsics.checkNotNullParameter(columnNames, "columnNames");
Intrinsics.checkNotNullParameter(mapping, "mapping");
if (columnNames.length != mapping.length) {
throw new IllegalStateException("Expected columnNames.length == mapping.length".toString());
}
return new CursorWrapper(cursor) { // from class: androidx.room.util.CursorUtil$wrapMappedColumns$2
@Override // android.database.CursorWrapper, android.database.Cursor
public int getColumnIndex(String columnName) {
boolean equals;
Intrinsics.checkNotNullParameter(columnName, "columnName");
String[] strArr = columnNames;
int[] iArr = mapping;
int length = strArr.length;
int i = 0;
int i2 = 0;
while (i < length) {
int i3 = i2 + 1;
equals = StringsKt__StringsJVMKt.equals(strArr[i], columnName, true);
if (equals) {
return iArr[i2];
}
i++;
i2 = i3;
}
return super.getColumnIndex(columnName);
}
};
}
}

View File

@@ -0,0 +1,158 @@
package androidx.room.util;
import android.database.AbstractWindowedCursor;
import android.database.Cursor;
import android.database.sqlite.SQLiteConstraintException;
import android.os.CancellationSignal;
import androidx.annotation.RestrictTo;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteCompat;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteQuery;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsJVMKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nDBUtil.kt\nKotlin\n*S Kotlin\n*F\n+ 1 DBUtil.kt\nandroidx/room/util/DBUtil\n+ 2 CursorUtil.kt\nandroidx/room/util/CursorUtil\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,214:1\n145#2,7:215\n145#2,7:224\n1855#3,2:222\n*S KotlinDebug\n*F\n+ 1 DBUtil.kt\nandroidx/room/util/DBUtil\n*L\n100#1:215,7\n121#1:224,7\n107#1:222,2\n*E\n"})
/* loaded from: classes.dex */
public final class DBUtil {
public static final Cursor query(RoomDatabase db, SupportSQLiteQuery sqLiteQuery, boolean z) {
Intrinsics.checkNotNullParameter(db, "db");
Intrinsics.checkNotNullParameter(sqLiteQuery, "sqLiteQuery");
return query(db, sqLiteQuery, z, null);
}
public static final Cursor query(RoomDatabase db, SupportSQLiteQuery sqLiteQuery, boolean z, CancellationSignal cancellationSignal) {
Intrinsics.checkNotNullParameter(db, "db");
Intrinsics.checkNotNullParameter(sqLiteQuery, "sqLiteQuery");
Cursor query = db.query(sqLiteQuery, cancellationSignal);
if (!z || !(query instanceof AbstractWindowedCursor)) {
return query;
}
AbstractWindowedCursor abstractWindowedCursor = (AbstractWindowedCursor) query;
int count = abstractWindowedCursor.getCount();
return (abstractWindowedCursor.hasWindow() ? abstractWindowedCursor.getWindow().getNumRows() : count) < count ? CursorUtil.copyAndClose(query) : query;
}
public static final void dropFtsSyncTriggers(SupportSQLiteDatabase db) {
List createListBuilder;
List<String> build;
Intrinsics.checkNotNullParameter(db, "db");
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
Cursor query = db.query("SELECT name FROM sqlite_master WHERE type = 'trigger'");
while (query.moveToNext()) {
try {
createListBuilder.add(query.getString(0));
} finally {
}
}
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(query, null);
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
for (String triggerName : build) {
Intrinsics.checkNotNullExpressionValue(triggerName, "triggerName");
if (StringsKt__StringsJVMKt.startsWith$default(triggerName, "room_fts_content_sync_", false, 2, null)) {
db.execSQL("DROP TRIGGER IF EXISTS " + triggerName);
}
}
}
public static final void foreignKeyCheck(SupportSQLiteDatabase db, String tableName) {
Intrinsics.checkNotNullParameter(db, "db");
Intrinsics.checkNotNullParameter(tableName, "tableName");
Cursor query = db.query("PRAGMA foreign_key_check(`" + tableName + "`)");
try {
if (query.getCount() > 0) {
throw new SQLiteConstraintException(processForeignKeyCheckFailure(query));
}
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(query, null);
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
CloseableKt.closeFinally(query, th);
throw th2;
}
}
}
public static final int readVersion(File databaseFile) throws IOException {
Intrinsics.checkNotNullParameter(databaseFile, "databaseFile");
FileChannel channel = new FileInputStream(databaseFile).getChannel();
try {
ByteBuffer allocate = ByteBuffer.allocate(4);
channel.tryLock(60L, 4L, true);
channel.position(60L);
if (channel.read(allocate) != 4) {
throw new IOException("Bad database header, unable to read 4 bytes at offset 60");
}
allocate.rewind();
int i = allocate.getInt();
CloseableKt.closeFinally(channel, null);
return i;
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
CloseableKt.closeFinally(channel, th);
throw th2;
}
}
}
public static final CancellationSignal createCancellationSignal() {
return SupportSQLiteCompat.Api16Impl.createCancellationSignal();
}
private static final String processForeignKeyCheckFailure(Cursor cursor) {
StringBuilder sb = new StringBuilder();
int count = cursor.getCount();
LinkedHashMap linkedHashMap = new LinkedHashMap();
while (cursor.moveToNext()) {
if (cursor.isFirst()) {
sb.append("Foreign key violation(s) detected in '");
sb.append(cursor.getString(0));
sb.append("'.\n");
}
String constraintIndex = cursor.getString(3);
if (!linkedHashMap.containsKey(constraintIndex)) {
Intrinsics.checkNotNullExpressionValue(constraintIndex, "constraintIndex");
String string = cursor.getString(2);
Intrinsics.checkNotNullExpressionValue(string, "cursor.getString(2)");
linkedHashMap.put(constraintIndex, string);
}
}
sb.append("Number of different violations discovered: ");
sb.append(linkedHashMap.keySet().size());
sb.append("\n");
sb.append("Number of rows in violation: ");
sb.append(count);
sb.append("\n");
sb.append("Violation(s) detected in the following constraint(s):\n");
for (Map.Entry entry : linkedHashMap.entrySet()) {
String str = (String) entry.getKey();
String str2 = (String) entry.getValue();
sb.append("\tParent Table = ");
sb.append(str2);
sb.append(", Foreign Key Constraint Index = ");
sb.append(str);
sb.append("\n");
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder().apply(builderAction).toString()");
return sb2;
}
}

View File

@@ -0,0 +1,27 @@
package androidx.room.util;
import android.annotation.SuppressLint;
import androidx.annotation.RestrictTo;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nFileUtil.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FileUtil.kt\nandroidx/room/util/FileUtil\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,59:1\n1#2:60\n*E\n"})
/* loaded from: classes.dex */
public final class FileUtil {
@SuppressLint({"LambdaLast"})
public static final void copy(ReadableByteChannel input, FileChannel output) throws IOException {
Intrinsics.checkNotNullParameter(input, "input");
Intrinsics.checkNotNullParameter(output, "output");
try {
output.transferFrom(input, 0L, Long.MAX_VALUE);
output.force(false);
} finally {
input.close();
output.close();
}
}
}

View File

@@ -0,0 +1,214 @@
package androidx.room.util;
import android.database.Cursor;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.sqlite.db.SupportSQLiteDatabase;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Set;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.SetsKt__SetsJVMKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class FtsTableInfo {
public static final Companion Companion = new Companion(null);
private static final String[] FTS_OPTIONS = {"tokenize=", "compress=", "content=", "languageid=", "matchinfo=", "notindexed=", "order=", "prefix=", "uncompress="};
public final Set<String> columns;
public final String name;
public final Set<String> options;
@VisibleForTesting
public static final Set<String> parseOptions(String str) {
return Companion.parseOptions(str);
}
public static final FtsTableInfo read(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
return Companion.read(supportSQLiteDatabase, str);
}
public FtsTableInfo(String name, Set<String> columns, Set<String> options) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(columns, "columns");
Intrinsics.checkNotNullParameter(options, "options");
this.name = name;
this.columns = columns;
this.options = options;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public FtsTableInfo(String name, Set<String> columns, String createSql) {
this(name, columns, Companion.parseOptions(createSql));
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(columns, "columns");
Intrinsics.checkNotNullParameter(createSql, "createSql");
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof FtsTableInfo)) {
return false;
}
FtsTableInfo ftsTableInfo = (FtsTableInfo) obj;
if (Intrinsics.areEqual(this.name, ftsTableInfo.name) && Intrinsics.areEqual(this.columns, ftsTableInfo.columns)) {
return Intrinsics.areEqual(this.options, ftsTableInfo.options);
}
return false;
}
public int hashCode() {
return (((this.name.hashCode() * 31) + this.columns.hashCode()) * 31) + this.options.hashCode();
}
public String toString() {
return "FtsTableInfo{name='" + this.name + "', columns=" + this.columns + ", options=" + this.options + "'}";
}
@SourceDebugExtension({"SMAP\nFtsTableInfo.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FtsTableInfo.kt\nandroidx/room/util/FtsTableInfo$Companion\n+ 2 CursorUtil.kt\nandroidx/room/util/CursorUtil\n+ 3 _Strings.kt\nkotlin/text/StringsKt___StringsKt\n+ 4 Strings.kt\nkotlin/text/StringsKt__StringsKt\n+ 5 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 6 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,182:1\n145#2,7:183\n145#2,7:190\n1183#3,2:197\n1185#3:222\n107#4:199\n79#4,22:200\n766#5:223\n857#5:224\n858#5:227\n12744#6,2:225\n*S KotlinDebug\n*F\n+ 1 FtsTableInfo.kt\nandroidx/room/util/FtsTableInfo$Companion\n*L\n94#1:183,7\n108#1:190,7\n148#1:197,2\n148#1:222\n163#1:199\n163#1:200,22\n173#1:223\n173#1:224\n173#1:227\n174#1:225,2\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final FtsTableInfo read(SupportSQLiteDatabase database, String tableName) {
Intrinsics.checkNotNullParameter(database, "database");
Intrinsics.checkNotNullParameter(tableName, "tableName");
return new FtsTableInfo(tableName, readColumns(database, tableName), readOptions(database, tableName));
}
private final Set<String> readColumns(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
Set createSetBuilder;
Set<String> build;
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
Cursor query = supportSQLiteDatabase.query("PRAGMA table_info(`" + str + "`)");
try {
if (query.getColumnCount() > 0) {
int columnIndex = query.getColumnIndex("name");
while (query.moveToNext()) {
String string = query.getString(columnIndex);
Intrinsics.checkNotNullExpressionValue(string, "cursor.getString(nameIndex)");
createSetBuilder.add(string);
}
}
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(query, null);
build = SetsKt__SetsJVMKt.build(createSetBuilder);
return build;
} finally {
}
}
private final Set<String> readOptions(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
Cursor query = supportSQLiteDatabase.query("SELECT * FROM sqlite_master WHERE `name` = '" + str + '\'');
try {
String sql = query.moveToFirst() ? query.getString(query.getColumnIndexOrThrow("sql")) : "";
CloseableKt.closeFinally(query, null);
Intrinsics.checkNotNullExpressionValue(sql, "sql");
return parseOptions(sql);
} finally {
}
}
@VisibleForTesting
public final Set<String> parseOptions(String createStatement) {
CharSequence trim;
Set<String> set;
Character ch;
Set<String> emptySet;
Intrinsics.checkNotNullParameter(createStatement, "createStatement");
if (createStatement.length() == 0) {
emptySet = SetsKt__SetsKt.emptySet();
return emptySet;
}
String substring = createStatement.substring(StringsKt__StringsKt.indexOf$default((CharSequence) createStatement, '(', 0, false, 6, (Object) null) + 1, StringsKt__StringsKt.lastIndexOf$default((CharSequence) createStatement, ')', 0, false, 6, (Object) null));
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
ArrayList arrayList = new ArrayList();
ArrayDeque arrayDeque = new ArrayDeque();
int i = -1;
int i2 = 0;
int i3 = 0;
while (i2 < substring.length()) {
char charAt = substring.charAt(i2);
int i4 = i3 + 1;
if (charAt == '\'' || charAt == '\"' || charAt == '`') {
if (arrayDeque.isEmpty()) {
arrayDeque.push(Character.valueOf(charAt));
} else {
Character ch2 = (Character) arrayDeque.peek();
if (ch2 != null && ch2.charValue() == charAt) {
arrayDeque.pop();
}
}
} else if (charAt == '[') {
if (arrayDeque.isEmpty()) {
arrayDeque.push(Character.valueOf(charAt));
}
} else if (charAt == ']') {
if (!arrayDeque.isEmpty() && (ch = (Character) arrayDeque.peek()) != null && ch.charValue() == '[') {
arrayDeque.pop();
}
} else if (charAt == ',' && arrayDeque.isEmpty()) {
String substring2 = substring.substring(i + 1, i3);
Intrinsics.checkNotNullExpressionValue(substring2, "this as java.lang.String…ing(startIndex, endIndex)");
int length = substring2.length() - 1;
int i5 = 0;
boolean z = false;
while (i5 <= length) {
boolean z2 = Intrinsics.compare((int) substring2.charAt(!z ? i5 : length), 32) <= 0;
if (z) {
if (!z2) {
break;
}
length--;
} else if (z2) {
i5++;
} else {
z = true;
}
}
arrayList.add(substring2.subSequence(i5, length + 1).toString());
i = i3;
}
i2++;
i3 = i4;
}
String substring3 = substring.substring(i + 1);
Intrinsics.checkNotNullExpressionValue(substring3, "this as java.lang.String).substring(startIndex)");
trim = StringsKt__StringsKt.trim(substring3);
arrayList.add(trim.toString());
ArrayList arrayList2 = new ArrayList();
for (Object obj : arrayList) {
String str = (String) obj;
String[] strArr = FtsTableInfo.FTS_OPTIONS;
int length2 = strArr.length;
int i6 = 0;
while (true) {
if (i6 >= length2) {
break;
}
if (StringsKt__StringsJVMKt.startsWith$default(str, strArr[i6], false, 2, null)) {
arrayList2.add(obj);
break;
}
i6++;
}
}
set = CollectionsKt___CollectionsKt.toSet(arrayList2);
return set;
}
}
}

View File

@@ -0,0 +1,114 @@
package androidx.room.util;
import androidx.annotation.RestrictTo;
import androidx.collection.ArrayMap;
import androidx.collection.LongSparseArray;
import java.util.HashMap;
import java.util.Map;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class RelationUtil {
public static final <K, V> void recursiveFetchHashMap(HashMap<K, V> map, boolean z, Function1 fetchBlock) {
int i;
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(fetchBlock, "fetchBlock");
HashMap hashMap = new HashMap(999);
loop0: while (true) {
i = 0;
for (K key : map.keySet()) {
if (z) {
Intrinsics.checkNotNullExpressionValue(key, "key");
hashMap.put(key, map.get(key));
} else {
Intrinsics.checkNotNullExpressionValue(key, "key");
hashMap.put(key, null);
}
i++;
if (i == 999) {
fetchBlock.invoke(hashMap);
if (!z) {
map.putAll(hashMap);
}
hashMap.clear();
}
}
break loop0;
}
if (i > 0) {
fetchBlock.invoke(hashMap);
if (z) {
return;
}
map.putAll(hashMap);
}
}
public static final <V> void recursiveFetchLongSparseArray(LongSparseArray<V> map, boolean z, Function1 fetchBlock) {
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(fetchBlock, "fetchBlock");
LongSparseArray<? extends V> longSparseArray = new LongSparseArray<>(999);
int size = map.size();
int i = 0;
int i2 = 0;
while (i < size) {
if (z) {
longSparseArray.put(map.keyAt(i), map.valueAt(i));
} else {
longSparseArray.put(map.keyAt(i), null);
}
i++;
i2++;
if (i2 == 999) {
fetchBlock.invoke(longSparseArray);
if (!z) {
map.putAll(longSparseArray);
}
longSparseArray.clear();
i2 = 0;
}
}
if (i2 > 0) {
fetchBlock.invoke(longSparseArray);
if (z) {
return;
}
map.putAll(longSparseArray);
}
}
public static final <K, V> void recursiveFetchArrayMap(ArrayMap<K, V> map, boolean z, Function1 fetchBlock) {
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(fetchBlock, "fetchBlock");
ArrayMap arrayMap = new ArrayMap(999);
int size = map.size();
int i = 0;
int i2 = 0;
while (i < size) {
if (z) {
arrayMap.put(map.keyAt(i), map.valueAt(i));
} else {
arrayMap.put(map.keyAt(i), null);
}
i++;
i2++;
if (i2 == 999) {
fetchBlock.invoke(arrayMap);
if (!z) {
map.putAll((Map) arrayMap);
}
arrayMap.clear();
i2 = 0;
}
}
if (i2 > 0) {
fetchBlock.invoke(arrayMap);
if (z) {
return;
}
map.putAll((Map) arrayMap);
}
}
}

View File

@@ -0,0 +1,94 @@
package androidx.room.util;
import androidx.annotation.RestrictTo;
import java.util.List;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nStringUtil.kt\nKotlin\n*S Kotlin\n*F\n+ 1 StringUtil.kt\nandroidx/room/util/StringUtil\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,86:1\n1603#2,9:87\n1855#2:96\n1856#2:98\n1612#2:99\n1#3:97\n*S KotlinDebug\n*F\n+ 1 StringUtil.kt\nandroidx/room/util/StringUtil\n*L\n66#1:87,9\n66#1:96\n66#1:98\n66#1:99\n66#1:97\n*E\n"})
/* loaded from: classes.dex */
public final class StringUtil {
public static final String[] EMPTY_STRING_ARRAY = new String[0];
public static /* synthetic */ void getEMPTY_STRING_ARRAY$annotations() {
}
public static final StringBuilder newStringBuilder() {
return new StringBuilder();
}
public static final void appendPlaceholders(StringBuilder builder, int i) {
Intrinsics.checkNotNullParameter(builder, "builder");
for (int i2 = 0; i2 < i; i2++) {
builder.append("?");
if (i2 < i - 1) {
builder.append(",");
}
}
}
/* JADX WARN: Code restructure failed: missing block: B:3:0x0003, code lost:
r8 = kotlin.text.StringsKt__StringsKt.split$default((java.lang.CharSequence) r8, new char[]{','}, false, 0, 6, (java.lang.Object) null);
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.util.List<java.lang.Integer> splitToIntList(java.lang.String r8) {
/*
r0 = 0
if (r8 == 0) goto L46
r1 = 1
char[] r3 = new char[r1]
r1 = 0
r2 = 44
r3[r1] = r2
r4 = 0
r5 = 0
r6 = 6
r7 = 0
r2 = r8
java.util.List r8 = kotlin.text.StringsKt.split$default(r2, r3, r4, r5, r6, r7)
if (r8 == 0) goto L46
java.lang.Iterable r8 = (java.lang.Iterable) r8
java.util.ArrayList r1 = new java.util.ArrayList
r1.<init>()
java.util.Iterator r8 = r8.iterator()
L21:
boolean r2 = r8.hasNext()
if (r2 == 0) goto L45
java.lang.Object r2 = r8.next()
java.lang.String r2 = (java.lang.String) r2
int r2 = java.lang.Integer.parseInt(r2) // Catch: java.lang.NumberFormatException -> L36
java.lang.Integer r2 = java.lang.Integer.valueOf(r2) // Catch: java.lang.NumberFormatException -> L36
goto L3f
L36:
r2 = move-exception
java.lang.String r3 = "ROOM"
java.lang.String r4 = "Malformed integer list"
android.util.Log.e(r3, r4, r2)
r2 = r0
L3f:
if (r2 == 0) goto L21
r1.add(r2)
goto L21
L45:
r0 = r1
L46:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.util.StringUtil.splitToIntList(java.lang.String):java.util.List");
}
public static final String joinIntoString(List<Integer> list) {
String joinToString$default;
if (list == null) {
return null;
}
joinToString$default = CollectionsKt___CollectionsKt.joinToString$default(list, ",", null, null, 0, null, null, 62, null);
return joinToString$default;
}
}

View File

@@ -0,0 +1,489 @@
package androidx.room.util;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.room.ColumnInfo;
import androidx.room.Index;
import androidx.sqlite.db.SupportSQLiteDatabase;
import com.google.android.gms.ads.AdError;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class TableInfo {
public static final int CREATED_FROM_DATABASE = 2;
public static final int CREATED_FROM_ENTITY = 1;
public static final int CREATED_FROM_UNKNOWN = 0;
public static final Companion Companion = new Companion(null);
public final Map<String, Column> columns;
public final Set<ForeignKey> foreignKeys;
public final Set<Index> indices;
public final String name;
@Retention(RetentionPolicy.SOURCE)
public @interface CreatedFrom {
}
public static final TableInfo read(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
return Companion.read(supportSQLiteDatabase, str);
}
public TableInfo(String name, Map<String, Column> columns, Set<ForeignKey> foreignKeys, Set<Index> set) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(columns, "columns");
Intrinsics.checkNotNullParameter(foreignKeys, "foreignKeys");
this.name = name;
this.columns = columns;
this.foreignKeys = foreignKeys;
this.indices = set;
}
public /* synthetic */ TableInfo(String str, Map map, Set set, Set set2, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(str, map, set, (i & 8) != 0 ? null : set2);
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public TableInfo(java.lang.String r2, java.util.Map<java.lang.String, androidx.room.util.TableInfo.Column> r3, java.util.Set<androidx.room.util.TableInfo.ForeignKey> r4) {
/*
r1 = this;
java.lang.String r0 = "name"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r2, r0)
java.lang.String r0 = "columns"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r3, r0)
java.lang.String r0 = "foreignKeys"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r4, r0)
java.util.Set r0 = kotlin.collections.SetsKt.emptySet()
r1.<init>(r2, r3, r4, r0)
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.util.TableInfo.<init>(java.lang.String, java.util.Map, java.util.Set):void");
}
public boolean equals(Object obj) {
Set<Index> set;
if (this == obj) {
return true;
}
if (!(obj instanceof TableInfo)) {
return false;
}
TableInfo tableInfo = (TableInfo) obj;
if (!Intrinsics.areEqual(this.name, tableInfo.name) || !Intrinsics.areEqual(this.columns, tableInfo.columns) || !Intrinsics.areEqual(this.foreignKeys, tableInfo.foreignKeys)) {
return false;
}
Set<Index> set2 = this.indices;
if (set2 == null || (set = tableInfo.indices) == null) {
return true;
}
return Intrinsics.areEqual(set2, set);
}
public int hashCode() {
return (((this.name.hashCode() * 31) + this.columns.hashCode()) * 31) + this.foreignKeys.hashCode();
}
public String toString() {
return "TableInfo{name='" + this.name + "', columns=" + this.columns + ", foreignKeys=" + this.foreignKeys + ", indices=" + this.indices + '}';
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final TableInfo read(SupportSQLiteDatabase database, String tableName) {
Intrinsics.checkNotNullParameter(database, "database");
Intrinsics.checkNotNullParameter(tableName, "tableName");
return TableInfoKt.readTableInfo(database, tableName);
}
}
public static final class Column {
public static final Companion Companion = new Companion(null);
public final int affinity;
public final int createdFrom;
public final String defaultValue;
public final String name;
public final boolean notNull;
public final int primaryKeyPosition;
public final String type;
@VisibleForTesting
public static final boolean defaultValueEquals(String str, String str2) {
return Companion.defaultValueEquals(str, str2);
}
@ColumnInfo.SQLiteTypeAffinity
public static /* synthetic */ void getAffinity$annotations() {
}
public final boolean isPrimaryKey() {
return this.primaryKeyPosition > 0;
}
public Column(String name, String type, boolean z, int i, String str, int i2) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(type, "type");
this.name = name;
this.type = type;
this.notNull = z;
this.primaryKeyPosition = i;
this.defaultValue = str;
this.createdFrom = i2;
this.affinity = findAffinity(type);
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public Column(String name, String type, boolean z, int i) {
this(name, type, z, i, null, 0);
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(type, "type");
}
@ColumnInfo.SQLiteTypeAffinity
private final int findAffinity(String str) {
boolean contains$default;
boolean contains$default2;
boolean contains$default3;
boolean contains$default4;
boolean contains$default5;
boolean contains$default6;
boolean contains$default7;
boolean contains$default8;
if (str == null) {
return 5;
}
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String upperCase = str.toUpperCase(US);
Intrinsics.checkNotNullExpressionValue(upperCase, "this as java.lang.String).toUpperCase(locale)");
contains$default = StringsKt__StringsKt.contains$default(upperCase, "INT", false, 2, null);
if (contains$default) {
return 3;
}
contains$default2 = StringsKt__StringsKt.contains$default(upperCase, "CHAR", false, 2, null);
if (!contains$default2) {
contains$default3 = StringsKt__StringsKt.contains$default(upperCase, "CLOB", false, 2, null);
if (!contains$default3) {
contains$default4 = StringsKt__StringsKt.contains$default(upperCase, "TEXT", false, 2, null);
if (!contains$default4) {
contains$default5 = StringsKt__StringsKt.contains$default(upperCase, "BLOB", false, 2, null);
if (contains$default5) {
return 5;
}
contains$default6 = StringsKt__StringsKt.contains$default(upperCase, "REAL", false, 2, null);
if (contains$default6) {
return 4;
}
contains$default7 = StringsKt__StringsKt.contains$default(upperCase, "FLOA", false, 2, null);
if (contains$default7) {
return 4;
}
contains$default8 = StringsKt__StringsKt.contains$default(upperCase, "DOUB", false, 2, null);
return contains$default8 ? 4 : 1;
}
}
}
return 2;
}
@SourceDebugExtension({"SMAP\nTableInfo.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TableInfo.kt\nandroidx/room/util/TableInfo$Column$Companion\n+ 2 _Strings.kt\nkotlin/text/StringsKt___StringsKt\n*L\n1#1,646:1\n1183#2,3:647\n*S KotlinDebug\n*F\n+ 1 TableInfo.kt\nandroidx/room/util/TableInfo$Column$Companion\n*L\n249#1:647,3\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
@VisibleForTesting
public final boolean defaultValueEquals(String current, String str) {
CharSequence trim;
Intrinsics.checkNotNullParameter(current, "current");
if (Intrinsics.areEqual(current, str)) {
return true;
}
if (!containsSurroundingParenthesis(current)) {
return false;
}
String substring = current.substring(1, current.length() - 1);
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
trim = StringsKt__StringsKt.trim(substring);
return Intrinsics.areEqual(trim.toString(), str);
}
private final boolean containsSurroundingParenthesis(String str) {
if (str.length() == 0) {
return false;
}
int i = 0;
int i2 = 0;
int i3 = 0;
while (i < str.length()) {
char charAt = str.charAt(i);
int i4 = i3 + 1;
if (i3 == 0 && charAt != '(') {
return false;
}
if (charAt == '(') {
i2++;
} else if (charAt == ')' && i2 - 1 == 0 && i3 != str.length() - 1) {
return false;
}
i++;
i3 = i4;
}
return i2 == 0;
}
}
public boolean equals(Object obj) {
String str;
String str2;
String str3;
if (this == obj) {
return true;
}
if (!(obj instanceof Column) || this.primaryKeyPosition != ((Column) obj).primaryKeyPosition) {
return false;
}
Column column = (Column) obj;
if (!Intrinsics.areEqual(this.name, column.name) || this.notNull != column.notNull) {
return false;
}
if (this.createdFrom == 1 && column.createdFrom == 2 && (str3 = this.defaultValue) != null && !Companion.defaultValueEquals(str3, column.defaultValue)) {
return false;
}
if (this.createdFrom == 2 && column.createdFrom == 1 && (str2 = column.defaultValue) != null && !Companion.defaultValueEquals(str2, this.defaultValue)) {
return false;
}
int i = this.createdFrom;
return (i == 0 || i != column.createdFrom || ((str = this.defaultValue) == null ? column.defaultValue == null : Companion.defaultValueEquals(str, column.defaultValue))) && this.affinity == column.affinity;
}
public int hashCode() {
return (((((this.name.hashCode() * 31) + this.affinity) * 31) + (this.notNull ? 1231 : 1237)) * 31) + this.primaryKeyPosition;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Column{name='");
sb.append(this.name);
sb.append("', type='");
sb.append(this.type);
sb.append("', affinity='");
sb.append(this.affinity);
sb.append("', notNull=");
sb.append(this.notNull);
sb.append(", primaryKeyPosition=");
sb.append(this.primaryKeyPosition);
sb.append(", defaultValue='");
String str = this.defaultValue;
if (str == null) {
str = AdError.UNDEFINED_DOMAIN;
}
sb.append(str);
sb.append("'}");
return sb.toString();
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public static final class ForeignKey {
public final List<String> columnNames;
public final String onDelete;
public final String onUpdate;
public final List<String> referenceColumnNames;
public final String referenceTable;
public ForeignKey(String referenceTable, String onDelete, String onUpdate, List<String> columnNames, List<String> referenceColumnNames) {
Intrinsics.checkNotNullParameter(referenceTable, "referenceTable");
Intrinsics.checkNotNullParameter(onDelete, "onDelete");
Intrinsics.checkNotNullParameter(onUpdate, "onUpdate");
Intrinsics.checkNotNullParameter(columnNames, "columnNames");
Intrinsics.checkNotNullParameter(referenceColumnNames, "referenceColumnNames");
this.referenceTable = referenceTable;
this.onDelete = onDelete;
this.onUpdate = onUpdate;
this.columnNames = columnNames;
this.referenceColumnNames = referenceColumnNames;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ForeignKey)) {
return false;
}
ForeignKey foreignKey = (ForeignKey) obj;
if (Intrinsics.areEqual(this.referenceTable, foreignKey.referenceTable) && Intrinsics.areEqual(this.onDelete, foreignKey.onDelete) && Intrinsics.areEqual(this.onUpdate, foreignKey.onUpdate) && Intrinsics.areEqual(this.columnNames, foreignKey.columnNames)) {
return Intrinsics.areEqual(this.referenceColumnNames, foreignKey.referenceColumnNames);
}
return false;
}
public int hashCode() {
return (((((((this.referenceTable.hashCode() * 31) + this.onDelete.hashCode()) * 31) + this.onUpdate.hashCode()) * 31) + this.columnNames.hashCode()) * 31) + this.referenceColumnNames.hashCode();
}
public String toString() {
return "ForeignKey{referenceTable='" + this.referenceTable + "', onDelete='" + this.onDelete + " +', onUpdate='" + this.onUpdate + "', columnNames=" + this.columnNames + ", referenceColumnNames=" + this.referenceColumnNames + '}';
}
}
public static final class ForeignKeyWithSequence implements Comparable<ForeignKeyWithSequence> {
private final String from;
private final int id;
private final int sequence;
private final String to;
public final String getFrom() {
return this.from;
}
public final int getId() {
return this.id;
}
public final int getSequence() {
return this.sequence;
}
public final String getTo() {
return this.to;
}
public ForeignKeyWithSequence(int i, int i2, String from, String to) {
Intrinsics.checkNotNullParameter(from, "from");
Intrinsics.checkNotNullParameter(to, "to");
this.id = i;
this.sequence = i2;
this.from = from;
this.to = to;
}
@Override // java.lang.Comparable
public int compareTo(ForeignKeyWithSequence other) {
Intrinsics.checkNotNullParameter(other, "other");
int i = this.id - other.id;
return i == 0 ? this.sequence - other.sequence : i;
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@SourceDebugExtension({"SMAP\nTableInfo.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TableInfo.kt\nandroidx/room/util/TableInfo$Index\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,646:1\n1#2:647\n*E\n"})
public static final class Index {
public static final Companion Companion = new Companion(null);
public static final String DEFAULT_PREFIX = "index_";
public final List<String> columns;
public final String name;
public List<String> orders;
public final boolean unique;
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r5v1, types: [java.util.Collection] */
/* JADX WARN: Type inference failed for: r5v2 */
/* JADX WARN: Type inference failed for: r5v4, types: [java.util.ArrayList] */
public Index(String name, boolean z, List<String> columns, List<String> orders) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(columns, "columns");
Intrinsics.checkNotNullParameter(orders, "orders");
this.name = name;
this.unique = z;
this.columns = columns;
this.orders = orders;
List<String> list = orders;
if (list.isEmpty()) {
int size = columns.size();
list = new ArrayList(size);
for (int i = 0; i < size; i++) {
list.add(Index.Order.ASC.name());
}
}
this.orders = (List) list;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public Index(java.lang.String r5, boolean r6, java.util.List<java.lang.String> r7) {
/*
r4 = this;
java.lang.String r0 = "name"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r5, r0)
java.lang.String r0 = "columns"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r7, r0)
int r0 = r7.size()
java.util.ArrayList r1 = new java.util.ArrayList
r1.<init>(r0)
r2 = 0
L14:
if (r2 >= r0) goto L22
androidx.room.Index$Order r3 = androidx.room.Index.Order.ASC
java.lang.String r3 = r3.name()
r1.add(r3)
int r2 = r2 + 1
goto L14
L22:
r4.<init>(r5, r6, r7, r1)
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.room.util.TableInfo.Index.<init>(java.lang.String, boolean, java.util.List):void");
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Index)) {
return false;
}
Index index = (Index) obj;
if (this.unique != index.unique || !Intrinsics.areEqual(this.columns, index.columns) || !Intrinsics.areEqual(this.orders, index.orders)) {
return false;
}
if (StringsKt__StringsJVMKt.startsWith$default(this.name, DEFAULT_PREFIX, false, 2, null)) {
return StringsKt__StringsJVMKt.startsWith$default(index.name, DEFAULT_PREFIX, false, 2, null);
}
return Intrinsics.areEqual(this.name, index.name);
}
public int hashCode() {
return ((((((StringsKt__StringsJVMKt.startsWith$default(this.name, DEFAULT_PREFIX, false, 2, null) ? -1184239155 : this.name.hashCode()) * 31) + (this.unique ? 1 : 0)) * 31) + this.columns.hashCode()) * 31) + this.orders.hashCode();
}
public String toString() {
return "Index{name='" + this.name + "', unique=" + this.unique + ", columns=" + this.columns + ", orders=" + this.orders + "'}";
}
}
}

View File

@@ -0,0 +1,211 @@
package androidx.room.util;
import android.database.Cursor;
import androidx.room.util.TableInfo;
import androidx.sqlite.db.SupportSQLiteDatabase;
import com.ironsource.nb;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.mbbid.common.BidResponsedEx;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.collections.SetsKt__SetsJVMKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nTableInfo.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TableInfo.kt\nandroidx/room/util/TableInfoKt\n+ 2 CursorUtil.kt\nandroidx/room/util/CursorUtil\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,646:1\n145#2,2:647\n148#2,2:654\n151#2:660\n145#2,7:661\n145#2,7:668\n145#2,7:675\n766#3:649\n857#3,2:650\n1855#3,2:652\n857#3,2:656\n1855#3,2:658\n*S KotlinDebug\n*F\n+ 1 TableInfo.kt\nandroidx/room/util/TableInfoKt\n*L\n477#1:647,2\n477#1:654,2\n477#1:660\n542#1:661,7\n580#1:668,7\n613#1:675,7\n497#1:649\n497#1:650,2\n499#1:652,2\n497#1:656,2\n499#1:658,2\n*E\n"})
/* loaded from: classes.dex */
public final class TableInfoKt {
public static final TableInfo readTableInfo(SupportSQLiteDatabase database, String tableName) {
Intrinsics.checkNotNullParameter(database, "database");
Intrinsics.checkNotNullParameter(tableName, "tableName");
return new TableInfo(tableName, readColumns(database, tableName), readForeignKeys(database, tableName), readIndices(database, tableName));
}
private static final Set<TableInfo.ForeignKey> readForeignKeys(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
Set createSetBuilder;
Set<TableInfo.ForeignKey> build;
Cursor query = supportSQLiteDatabase.query("PRAGMA foreign_key_list(`" + str + "`)");
try {
int columnIndex = query.getColumnIndex("id");
int columnIndex2 = query.getColumnIndex("seq");
int columnIndex3 = query.getColumnIndex(nb.Q);
int columnIndex4 = query.getColumnIndex("on_delete");
int columnIndex5 = query.getColumnIndex("on_update");
List<TableInfo.ForeignKeyWithSequence> readForeignKeyFieldMappings = readForeignKeyFieldMappings(query);
query.moveToPosition(-1);
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
while (query.moveToNext()) {
if (query.getInt(columnIndex2) == 0) {
int i = query.getInt(columnIndex);
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
ArrayList<TableInfo.ForeignKeyWithSequence> arrayList3 = new ArrayList();
for (Object obj : readForeignKeyFieldMappings) {
if (((TableInfo.ForeignKeyWithSequence) obj).getId() == i) {
arrayList3.add(obj);
}
}
for (TableInfo.ForeignKeyWithSequence foreignKeyWithSequence : arrayList3) {
arrayList.add(foreignKeyWithSequence.getFrom());
arrayList2.add(foreignKeyWithSequence.getTo());
}
String string = query.getString(columnIndex3);
Intrinsics.checkNotNullExpressionValue(string, "cursor.getString(tableColumnIndex)");
String string2 = query.getString(columnIndex4);
Intrinsics.checkNotNullExpressionValue(string2, "cursor.getString(onDeleteColumnIndex)");
String string3 = query.getString(columnIndex5);
Intrinsics.checkNotNullExpressionValue(string3, "cursor.getString(onUpdateColumnIndex)");
createSetBuilder.add(new TableInfo.ForeignKey(string, string2, string3, arrayList, arrayList2));
}
}
build = SetsKt__SetsJVMKt.build(createSetBuilder);
CloseableKt.closeFinally(query, null);
return build;
} finally {
}
}
private static final List<TableInfo.ForeignKeyWithSequence> readForeignKeyFieldMappings(Cursor cursor) {
List createListBuilder;
List build;
List<TableInfo.ForeignKeyWithSequence> sorted;
int columnIndex = cursor.getColumnIndex("id");
int columnIndex2 = cursor.getColumnIndex("seq");
int columnIndex3 = cursor.getColumnIndex("from");
int columnIndex4 = cursor.getColumnIndex("to");
createListBuilder = CollectionsKt__CollectionsJVMKt.createListBuilder();
while (cursor.moveToNext()) {
int i = cursor.getInt(columnIndex);
int i2 = cursor.getInt(columnIndex2);
String string = cursor.getString(columnIndex3);
Intrinsics.checkNotNullExpressionValue(string, "cursor.getString(fromColumnIndex)");
String string2 = cursor.getString(columnIndex4);
Intrinsics.checkNotNullExpressionValue(string2, "cursor.getString(toColumnIndex)");
createListBuilder.add(new TableInfo.ForeignKeyWithSequence(i, i2, string, string2));
}
build = CollectionsKt__CollectionsJVMKt.build(createListBuilder);
sorted = CollectionsKt___CollectionsKt.sorted(build);
return sorted;
}
private static final Map<String, TableInfo.Column> readColumns(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
Map createMapBuilder;
Map<String, TableInfo.Column> build;
Map<String, TableInfo.Column> emptyMap;
Cursor query = supportSQLiteDatabase.query("PRAGMA table_info(`" + str + "`)");
try {
if (query.getColumnCount() <= 0) {
emptyMap = MapsKt__MapsKt.emptyMap();
CloseableKt.closeFinally(query, null);
return emptyMap;
}
int columnIndex = query.getColumnIndex("name");
int columnIndex2 = query.getColumnIndex("type");
int columnIndex3 = query.getColumnIndex("notnull");
int columnIndex4 = query.getColumnIndex("pk");
int columnIndex5 = query.getColumnIndex("dflt_value");
createMapBuilder = MapsKt__MapsJVMKt.createMapBuilder();
while (query.moveToNext()) {
String name = query.getString(columnIndex);
String type = query.getString(columnIndex2);
boolean z = query.getInt(columnIndex3) != 0;
int i = query.getInt(columnIndex4);
String string = query.getString(columnIndex5);
Intrinsics.checkNotNullExpressionValue(name, "name");
Intrinsics.checkNotNullExpressionValue(type, "type");
createMapBuilder.put(name, new TableInfo.Column(name, type, z, i, string, 2));
}
build = MapsKt__MapsJVMKt.build(createMapBuilder);
CloseableKt.closeFinally(query, null);
return build;
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
CloseableKt.closeFinally(query, th);
throw th2;
}
}
}
private static final Set<TableInfo.Index> readIndices(SupportSQLiteDatabase supportSQLiteDatabase, String str) {
Set createSetBuilder;
Set<TableInfo.Index> build;
Cursor query = supportSQLiteDatabase.query("PRAGMA index_list(`" + str + "`)");
try {
int columnIndex = query.getColumnIndex("name");
int columnIndex2 = query.getColumnIndex("origin");
int columnIndex3 = query.getColumnIndex("unique");
if (columnIndex != -1 && columnIndex2 != -1 && columnIndex3 != -1) {
createSetBuilder = SetsKt__SetsJVMKt.createSetBuilder();
while (query.moveToNext()) {
if (Intrinsics.areEqual("c", query.getString(columnIndex2))) {
String name = query.getString(columnIndex);
boolean z = true;
if (query.getInt(columnIndex3) != 1) {
z = false;
}
Intrinsics.checkNotNullExpressionValue(name, "name");
TableInfo.Index readIndex = readIndex(supportSQLiteDatabase, name, z);
if (readIndex == null) {
CloseableKt.closeFinally(query, null);
return null;
}
createSetBuilder.add(readIndex);
}
}
build = SetsKt__SetsJVMKt.build(createSetBuilder);
CloseableKt.closeFinally(query, null);
return build;
}
CloseableKt.closeFinally(query, null);
return null;
} finally {
}
}
private static final TableInfo.Index readIndex(SupportSQLiteDatabase supportSQLiteDatabase, String str, boolean z) {
Cursor query = supportSQLiteDatabase.query("PRAGMA index_xinfo(`" + str + "`)");
try {
int columnIndex = query.getColumnIndex("seqno");
int columnIndex2 = query.getColumnIndex(BidResponsedEx.KEY_CID);
int columnIndex3 = query.getColumnIndex("name");
int columnIndex4 = query.getColumnIndex(CampaignEx.JSON_KEY_DESC);
if (columnIndex != -1 && columnIndex2 != -1 && columnIndex3 != -1 && columnIndex4 != -1) {
TreeMap treeMap = new TreeMap();
TreeMap treeMap2 = new TreeMap();
while (query.moveToNext()) {
if (query.getInt(columnIndex2) >= 0) {
int i = query.getInt(columnIndex);
String columnName = query.getString(columnIndex3);
String str2 = query.getInt(columnIndex4) > 0 ? "DESC" : "ASC";
Integer valueOf = Integer.valueOf(i);
Intrinsics.checkNotNullExpressionValue(columnName, "columnName");
treeMap.put(valueOf, columnName);
treeMap2.put(Integer.valueOf(i), str2);
}
}
Collection values = treeMap.values();
Intrinsics.checkNotNullExpressionValue(values, "columnsMap.values");
List list = CollectionsKt___CollectionsKt.toList(values);
Collection values2 = treeMap2.values();
Intrinsics.checkNotNullExpressionValue(values2, "ordersMap.values");
TableInfo.Index index = new TableInfo.Index(str, z, list, CollectionsKt___CollectionsKt.toList(values2));
CloseableKt.closeFinally(query, null);
return index;
}
CloseableKt.closeFinally(query, null);
return null;
} finally {
}
}
}

View File

@@ -0,0 +1,26 @@
package androidx.room.util;
import androidx.annotation.RestrictTo;
import java.nio.ByteBuffer;
import java.util.UUID;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class UUIDUtil {
public static final UUID convertByteToUUID(byte[] bytes) {
Intrinsics.checkNotNullParameter(bytes, "bytes");
ByteBuffer wrap = ByteBuffer.wrap(bytes);
return new UUID(wrap.getLong(), wrap.getLong());
}
public static final byte[] convertUUIDToByte(UUID uuid) {
Intrinsics.checkNotNullParameter(uuid, "uuid");
ByteBuffer wrap = ByteBuffer.wrap(new byte[16]);
wrap.putLong(uuid.getMostSignificantBits());
wrap.putLong(uuid.getLeastSignificantBits());
byte[] array = wrap.array();
Intrinsics.checkNotNullExpressionValue(array, "buffer.array()");
return array;
}
}

Some files were not shown because too many files have changed in this diff Show More