*
This commit is contained in:
@@ -0,0 +1 @@
|
||||
o/classes
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
o/bundleLibRuntimeToDirDebug
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,176 @@
|
||||
package com.stec.cmd.core.database;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.DatabaseConfiguration;
|
||||
import androidx.room.InvalidationTracker;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.RoomOpenHelper;
|
||||
import androidx.room.migration.AutoMigrationSpec;
|
||||
import androidx.room.migration.Migration;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.room.util.TableInfo;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated("androidx.room.RoomProcessor")
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class AppDatabase_Impl extends AppDatabase {
|
||||
private volatile UploadQueueDao _uploadQueueDao;
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected SupportSQLiteOpenHelper createOpenHelper(@NonNull final DatabaseConfiguration config) {
|
||||
final SupportSQLiteOpenHelper.Callback _openCallback = new RoomOpenHelper(config, new RoomOpenHelper.Delegate(1) {
|
||||
@Override
|
||||
public void createAllTables(@NonNull final SupportSQLiteDatabase db) {
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS `upload_queue` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `device_type` TEXT NOT NULL, `device_id` TEXT NOT NULL, `data_type` TEXT NOT NULL, `payload_json` TEXT NOT NULL, `status` INTEGER NOT NULL, `retry_count` INTEGER NOT NULL, `created_at` INTEGER NOT NULL, `uploaded_at` INTEGER)");
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
|
||||
db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '507a3c1e322961dd534ec0d1e6f8b5f6')");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAllTables(@NonNull final SupportSQLiteDatabase db) {
|
||||
db.execSQL("DROP TABLE IF EXISTS `upload_queue`");
|
||||
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
|
||||
if (_callbacks != null) {
|
||||
for (RoomDatabase.Callback _callback : _callbacks) {
|
||||
_callback.onDestructiveMigration(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull final SupportSQLiteDatabase db) {
|
||||
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
|
||||
if (_callbacks != null) {
|
||||
for (RoomDatabase.Callback _callback : _callbacks) {
|
||||
_callback.onCreate(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(@NonNull final SupportSQLiteDatabase db) {
|
||||
mDatabase = db;
|
||||
internalInitInvalidationTracker(db);
|
||||
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
|
||||
if (_callbacks != null) {
|
||||
for (RoomDatabase.Callback _callback : _callbacks) {
|
||||
_callback.onOpen(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreMigrate(@NonNull final SupportSQLiteDatabase db) {
|
||||
DBUtil.dropFtsSyncTriggers(db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostMigrate(@NonNull final SupportSQLiteDatabase db) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public RoomOpenHelper.ValidationResult onValidateSchema(
|
||||
@NonNull final SupportSQLiteDatabase db) {
|
||||
final HashMap<String, TableInfo.Column> _columnsUploadQueue = new HashMap<String, TableInfo.Column>(9);
|
||||
_columnsUploadQueue.put("id", new TableInfo.Column("id", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("device_type", new TableInfo.Column("device_type", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("device_id", new TableInfo.Column("device_id", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("data_type", new TableInfo.Column("data_type", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("payload_json", new TableInfo.Column("payload_json", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("status", new TableInfo.Column("status", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("retry_count", new TableInfo.Column("retry_count", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("created_at", new TableInfo.Column("created_at", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsUploadQueue.put("uploaded_at", new TableInfo.Column("uploaded_at", "INTEGER", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
final HashSet<TableInfo.ForeignKey> _foreignKeysUploadQueue = new HashSet<TableInfo.ForeignKey>(0);
|
||||
final HashSet<TableInfo.Index> _indicesUploadQueue = new HashSet<TableInfo.Index>(0);
|
||||
final TableInfo _infoUploadQueue = new TableInfo("upload_queue", _columnsUploadQueue, _foreignKeysUploadQueue, _indicesUploadQueue);
|
||||
final TableInfo _existingUploadQueue = TableInfo.read(db, "upload_queue");
|
||||
if (!_infoUploadQueue.equals(_existingUploadQueue)) {
|
||||
return new RoomOpenHelper.ValidationResult(false, "upload_queue(com.stec.cmd.core.database.UploadQueueEntity).\n"
|
||||
+ " Expected:\n" + _infoUploadQueue + "\n"
|
||||
+ " Found:\n" + _existingUploadQueue);
|
||||
}
|
||||
return new RoomOpenHelper.ValidationResult(true, null);
|
||||
}
|
||||
}, "507a3c1e322961dd534ec0d1e6f8b5f6", "95887a821e8b5909963f6bb84235afd2");
|
||||
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(config.context).name(config.name).callback(_openCallback).build();
|
||||
final SupportSQLiteOpenHelper _helper = config.sqliteOpenHelperFactory.create(_sqliteConfig);
|
||||
return _helper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected InvalidationTracker createInvalidationTracker() {
|
||||
final HashMap<String, String> _shadowTablesMap = new HashMap<String, String>(0);
|
||||
final HashMap<String, Set<String>> _viewTables = new HashMap<String, Set<String>>(0);
|
||||
return new InvalidationTracker(this, _shadowTablesMap, _viewTables, "upload_queue");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllTables() {
|
||||
super.assertNotMainThread();
|
||||
final SupportSQLiteDatabase _db = super.getOpenHelper().getWritableDatabase();
|
||||
try {
|
||||
super.beginTransaction();
|
||||
_db.execSQL("DELETE FROM `upload_queue`");
|
||||
super.setTransactionSuccessful();
|
||||
} finally {
|
||||
super.endTransaction();
|
||||
_db.query("PRAGMA wal_checkpoint(FULL)").close();
|
||||
if (!_db.inTransaction()) {
|
||||
_db.execSQL("VACUUM");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected Map<Class<?>, List<Class<?>>> getRequiredTypeConverters() {
|
||||
final HashMap<Class<?>, List<Class<?>>> _typeConvertersMap = new HashMap<Class<?>, List<Class<?>>>();
|
||||
_typeConvertersMap.put(UploadQueueDao.class, UploadQueueDao_Impl.getRequiredConverters());
|
||||
return _typeConvertersMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Set<Class<? extends AutoMigrationSpec>> getRequiredAutoMigrationSpecs() {
|
||||
final HashSet<Class<? extends AutoMigrationSpec>> _autoMigrationSpecsSet = new HashSet<Class<? extends AutoMigrationSpec>>();
|
||||
return _autoMigrationSpecsSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public List<Migration> getAutoMigrations(
|
||||
@NonNull final Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> autoMigrationSpecs) {
|
||||
final List<Migration> _autoMigrations = new ArrayList<Migration>();
|
||||
return _autoMigrations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadQueueDao uploadQueueDao() {
|
||||
if (_uploadQueueDao != null) {
|
||||
return _uploadQueueDao;
|
||||
} else {
|
||||
synchronized(this) {
|
||||
if(_uploadQueueDao == null) {
|
||||
_uploadQueueDao = new UploadQueueDao_Impl(this);
|
||||
}
|
||||
return _uploadQueueDao;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.stec.cmd.core.database;
|
||||
|
||||
import android.content.Context;
|
||||
import dagger.internal.DaggerGenerated;
|
||||
import dagger.internal.Factory;
|
||||
import dagger.internal.Preconditions;
|
||||
import dagger.internal.QualifierMetadata;
|
||||
import dagger.internal.ScopeMetadata;
|
||||
import javax.annotation.processing.Generated;
|
||||
import javax.inject.Provider;
|
||||
|
||||
@ScopeMetadata("javax.inject.Singleton")
|
||||
@QualifierMetadata("dagger.hilt.android.qualifiers.ApplicationContext")
|
||||
@DaggerGenerated
|
||||
@Generated(
|
||||
value = "dagger.internal.codegen.ComponentProcessor",
|
||||
comments = "https://dagger.dev"
|
||||
)
|
||||
@SuppressWarnings({
|
||||
"unchecked",
|
||||
"rawtypes",
|
||||
"KotlinInternal",
|
||||
"KotlinInternalInJava",
|
||||
"cast",
|
||||
"deprecation"
|
||||
})
|
||||
public final class DatabaseModule_ProvideAppDatabaseFactory implements Factory<AppDatabase> {
|
||||
private final Provider<Context> contextProvider;
|
||||
|
||||
public DatabaseModule_ProvideAppDatabaseFactory(Provider<Context> contextProvider) {
|
||||
this.contextProvider = contextProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppDatabase get() {
|
||||
return provideAppDatabase(contextProvider.get());
|
||||
}
|
||||
|
||||
public static DatabaseModule_ProvideAppDatabaseFactory create(Provider<Context> contextProvider) {
|
||||
return new DatabaseModule_ProvideAppDatabaseFactory(contextProvider);
|
||||
}
|
||||
|
||||
public static AppDatabase provideAppDatabase(Context context) {
|
||||
return Preconditions.checkNotNullFromProvides(DatabaseModule.INSTANCE.provideAppDatabase(context));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.stec.cmd.core.database;
|
||||
|
||||
import dagger.internal.DaggerGenerated;
|
||||
import dagger.internal.Factory;
|
||||
import dagger.internal.Preconditions;
|
||||
import dagger.internal.QualifierMetadata;
|
||||
import dagger.internal.ScopeMetadata;
|
||||
import javax.annotation.processing.Generated;
|
||||
import javax.inject.Provider;
|
||||
|
||||
@ScopeMetadata("javax.inject.Singleton")
|
||||
@QualifierMetadata
|
||||
@DaggerGenerated
|
||||
@Generated(
|
||||
value = "dagger.internal.codegen.ComponentProcessor",
|
||||
comments = "https://dagger.dev"
|
||||
)
|
||||
@SuppressWarnings({
|
||||
"unchecked",
|
||||
"rawtypes",
|
||||
"KotlinInternal",
|
||||
"KotlinInternalInJava",
|
||||
"cast",
|
||||
"deprecation"
|
||||
})
|
||||
public final class DatabaseModule_ProvideUploadQueueDaoFactory implements Factory<UploadQueueDao> {
|
||||
private final Provider<AppDatabase> databaseProvider;
|
||||
|
||||
public DatabaseModule_ProvideUploadQueueDaoFactory(Provider<AppDatabase> databaseProvider) {
|
||||
this.databaseProvider = databaseProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UploadQueueDao get() {
|
||||
return provideUploadQueueDao(databaseProvider.get());
|
||||
}
|
||||
|
||||
public static DatabaseModule_ProvideUploadQueueDaoFactory create(
|
||||
Provider<AppDatabase> databaseProvider) {
|
||||
return new DatabaseModule_ProvideUploadQueueDaoFactory(databaseProvider);
|
||||
}
|
||||
|
||||
public static UploadQueueDao provideUploadQueueDao(AppDatabase database) {
|
||||
return Preconditions.checkNotNullFromProvides(DatabaseModule.INSTANCE.provideUploadQueueDao(database));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
package com.stec.cmd.core.database;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.os.CancellationSignal;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.CoroutinesRoom;
|
||||
import androidx.room.EntityInsertionAdapter;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.RoomSQLiteQuery;
|
||||
import androidx.room.SharedSQLiteStatement;
|
||||
import androidx.room.util.CursorUtil;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.room.util.StringUtil;
|
||||
import androidx.sqlite.db.SupportSQLiteStatement;
|
||||
import java.lang.Class;
|
||||
import java.lang.Exception;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Long;
|
||||
import java.lang.Object;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.StringBuilder;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import javax.annotation.processing.Generated;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlinx.coroutines.flow.Flow;
|
||||
|
||||
@Generated("androidx.room.RoomProcessor")
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class UploadQueueDao_Impl implements UploadQueueDao {
|
||||
private final RoomDatabase __db;
|
||||
|
||||
private final EntityInsertionAdapter<UploadQueueEntity> __insertionAdapterOfUploadQueueEntity;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfUpdateStatus;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfMarkSuccess;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfMarkRetry;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfPurgeSuccessBefore;
|
||||
|
||||
public UploadQueueDao_Impl(@NonNull final RoomDatabase __db) {
|
||||
this.__db = __db;
|
||||
this.__insertionAdapterOfUploadQueueEntity = new EntityInsertionAdapter<UploadQueueEntity>(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
protected String createQuery() {
|
||||
return "INSERT OR ABORT INTO `upload_queue` (`id`,`device_type`,`device_id`,`data_type`,`payload_json`,`status`,`retry_count`,`created_at`,`uploaded_at`) VALUES (nullif(?, 0),?,?,?,?,?,?,?,?)";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bind(@NonNull final SupportSQLiteStatement statement,
|
||||
@NonNull final UploadQueueEntity entity) {
|
||||
statement.bindLong(1, entity.getId());
|
||||
statement.bindString(2, entity.getDeviceType());
|
||||
statement.bindString(3, entity.getDeviceId());
|
||||
statement.bindString(4, entity.getDataType());
|
||||
statement.bindString(5, entity.getPayloadJson());
|
||||
statement.bindLong(6, entity.getStatus());
|
||||
statement.bindLong(7, entity.getRetryCount());
|
||||
statement.bindLong(8, entity.getCreatedAt());
|
||||
if (entity.getUploadedAt() == null) {
|
||||
statement.bindNull(9);
|
||||
} else {
|
||||
statement.bindLong(9, entity.getUploadedAt());
|
||||
}
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfUpdateStatus = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "UPDATE upload_queue SET status = ? WHERE id = ?";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfMarkSuccess = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "UPDATE upload_queue SET status = ?, uploaded_at = ? WHERE id = ?";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfMarkRetry = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "UPDATE upload_queue SET status = ?, retry_count = retry_count + 1 WHERE id = ?";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfPurgeSuccessBefore = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM upload_queue WHERE status = ? AND uploaded_at IS NOT NULL AND uploaded_at < ?";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object enqueue(final UploadQueueEntity entity,
|
||||
final Continuation<? super Long> $completion) {
|
||||
return CoroutinesRoom.execute(__db, true, new Callable<Long>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public Long call() throws Exception {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
final Long _result = __insertionAdapterOfUploadQueueEntity.insertAndReturnId(entity);
|
||||
__db.setTransactionSuccessful();
|
||||
return _result;
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
}, $completion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object updateStatus(final long id, final int status,
|
||||
final Continuation<? super Unit> $completion) {
|
||||
return CoroutinesRoom.execute(__db, true, new Callable<Unit>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public Unit call() throws Exception {
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfUpdateStatus.acquire();
|
||||
int _argIndex = 1;
|
||||
_stmt.bindLong(_argIndex, status);
|
||||
_argIndex = 2;
|
||||
_stmt.bindLong(_argIndex, id);
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
return Unit.INSTANCE;
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfUpdateStatus.release(_stmt);
|
||||
}
|
||||
}
|
||||
}, $completion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object markSuccess(final long id, final int status, final long uploadedAt,
|
||||
final Continuation<? super Unit> $completion) {
|
||||
return CoroutinesRoom.execute(__db, true, new Callable<Unit>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public Unit call() throws Exception {
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfMarkSuccess.acquire();
|
||||
int _argIndex = 1;
|
||||
_stmt.bindLong(_argIndex, status);
|
||||
_argIndex = 2;
|
||||
_stmt.bindLong(_argIndex, uploadedAt);
|
||||
_argIndex = 3;
|
||||
_stmt.bindLong(_argIndex, id);
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
return Unit.INSTANCE;
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfMarkSuccess.release(_stmt);
|
||||
}
|
||||
}
|
||||
}, $completion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object markRetry(final long id, final int status,
|
||||
final Continuation<? super Unit> $completion) {
|
||||
return CoroutinesRoom.execute(__db, true, new Callable<Unit>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public Unit call() throws Exception {
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfMarkRetry.acquire();
|
||||
int _argIndex = 1;
|
||||
_stmt.bindLong(_argIndex, status);
|
||||
_argIndex = 2;
|
||||
_stmt.bindLong(_argIndex, id);
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
return Unit.INSTANCE;
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfMarkRetry.release(_stmt);
|
||||
}
|
||||
}
|
||||
}, $completion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object purgeSuccessBefore(final int status, final long before,
|
||||
final Continuation<? super Integer> $completion) {
|
||||
return CoroutinesRoom.execute(__db, true, new Callable<Integer>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public Integer call() throws Exception {
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfPurgeSuccessBefore.acquire();
|
||||
int _argIndex = 1;
|
||||
_stmt.bindLong(_argIndex, status);
|
||||
_argIndex = 2;
|
||||
_stmt.bindLong(_argIndex, before);
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
final Integer _result = _stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
return _result;
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfPurgeSuccessBefore.release(_stmt);
|
||||
}
|
||||
}
|
||||
}, $completion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flow<List<UploadQueueEntity>> observeByStatuses(final int... statuses) {
|
||||
final StringBuilder _stringBuilder = StringUtil.newStringBuilder();
|
||||
_stringBuilder.append("SELECT * FROM upload_queue WHERE status IN (");
|
||||
final int _inputSize = statuses.length;
|
||||
StringUtil.appendPlaceholders(_stringBuilder, _inputSize);
|
||||
_stringBuilder.append(") ORDER BY created_at ASC");
|
||||
final String _sql = _stringBuilder.toString();
|
||||
final int _argCount = 0 + _inputSize;
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, _argCount);
|
||||
int _argIndex = 1;
|
||||
for (int _item : statuses) {
|
||||
_statement.bindLong(_argIndex, _item);
|
||||
_argIndex++;
|
||||
}
|
||||
return CoroutinesRoom.createFlow(__db, false, new String[] {"upload_queue"}, new Callable<List<UploadQueueEntity>>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public List<UploadQueueEntity> call() throws Exception {
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
|
||||
final int _cursorIndexOfDeviceType = CursorUtil.getColumnIndexOrThrow(_cursor, "device_type");
|
||||
final int _cursorIndexOfDeviceId = CursorUtil.getColumnIndexOrThrow(_cursor, "device_id");
|
||||
final int _cursorIndexOfDataType = CursorUtil.getColumnIndexOrThrow(_cursor, "data_type");
|
||||
final int _cursorIndexOfPayloadJson = CursorUtil.getColumnIndexOrThrow(_cursor, "payload_json");
|
||||
final int _cursorIndexOfStatus = CursorUtil.getColumnIndexOrThrow(_cursor, "status");
|
||||
final int _cursorIndexOfRetryCount = CursorUtil.getColumnIndexOrThrow(_cursor, "retry_count");
|
||||
final int _cursorIndexOfCreatedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "created_at");
|
||||
final int _cursorIndexOfUploadedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "uploaded_at");
|
||||
final List<UploadQueueEntity> _result = new ArrayList<UploadQueueEntity>(_cursor.getCount());
|
||||
while (_cursor.moveToNext()) {
|
||||
final UploadQueueEntity _item_1;
|
||||
final long _tmpId;
|
||||
_tmpId = _cursor.getLong(_cursorIndexOfId);
|
||||
final String _tmpDeviceType;
|
||||
_tmpDeviceType = _cursor.getString(_cursorIndexOfDeviceType);
|
||||
final String _tmpDeviceId;
|
||||
_tmpDeviceId = _cursor.getString(_cursorIndexOfDeviceId);
|
||||
final String _tmpDataType;
|
||||
_tmpDataType = _cursor.getString(_cursorIndexOfDataType);
|
||||
final String _tmpPayloadJson;
|
||||
_tmpPayloadJson = _cursor.getString(_cursorIndexOfPayloadJson);
|
||||
final int _tmpStatus;
|
||||
_tmpStatus = _cursor.getInt(_cursorIndexOfStatus);
|
||||
final int _tmpRetryCount;
|
||||
_tmpRetryCount = _cursor.getInt(_cursorIndexOfRetryCount);
|
||||
final long _tmpCreatedAt;
|
||||
_tmpCreatedAt = _cursor.getLong(_cursorIndexOfCreatedAt);
|
||||
final Long _tmpUploadedAt;
|
||||
if (_cursor.isNull(_cursorIndexOfUploadedAt)) {
|
||||
_tmpUploadedAt = null;
|
||||
} else {
|
||||
_tmpUploadedAt = _cursor.getLong(_cursorIndexOfUploadedAt);
|
||||
}
|
||||
_item_1 = new UploadQueueEntity(_tmpId,_tmpDeviceType,_tmpDeviceId,_tmpDataType,_tmpPayloadJson,_tmpStatus,_tmpRetryCount,_tmpCreatedAt,_tmpUploadedAt);
|
||||
_result.add(_item_1);
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() {
|
||||
_statement.release();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object takePending(final List<Integer> statuses, final int limit,
|
||||
final Continuation<? super List<UploadQueueEntity>> $completion) {
|
||||
final StringBuilder _stringBuilder = StringUtil.newStringBuilder();
|
||||
_stringBuilder.append("SELECT * FROM upload_queue WHERE status IN (");
|
||||
final int _inputSize = statuses.size();
|
||||
StringUtil.appendPlaceholders(_stringBuilder, _inputSize);
|
||||
_stringBuilder.append(") ORDER BY created_at ASC LIMIT ");
|
||||
_stringBuilder.append("?");
|
||||
final String _sql = _stringBuilder.toString();
|
||||
final int _argCount = 1 + _inputSize;
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, _argCount);
|
||||
int _argIndex = 1;
|
||||
for (int _item : statuses) {
|
||||
_statement.bindLong(_argIndex, _item);
|
||||
_argIndex++;
|
||||
}
|
||||
_argIndex = 1 + _inputSize;
|
||||
_statement.bindLong(_argIndex, limit);
|
||||
final CancellationSignal _cancellationSignal = DBUtil.createCancellationSignal();
|
||||
return CoroutinesRoom.execute(__db, false, _cancellationSignal, new Callable<List<UploadQueueEntity>>() {
|
||||
@Override
|
||||
@NonNull
|
||||
public List<UploadQueueEntity> call() throws Exception {
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
|
||||
final int _cursorIndexOfDeviceType = CursorUtil.getColumnIndexOrThrow(_cursor, "device_type");
|
||||
final int _cursorIndexOfDeviceId = CursorUtil.getColumnIndexOrThrow(_cursor, "device_id");
|
||||
final int _cursorIndexOfDataType = CursorUtil.getColumnIndexOrThrow(_cursor, "data_type");
|
||||
final int _cursorIndexOfPayloadJson = CursorUtil.getColumnIndexOrThrow(_cursor, "payload_json");
|
||||
final int _cursorIndexOfStatus = CursorUtil.getColumnIndexOrThrow(_cursor, "status");
|
||||
final int _cursorIndexOfRetryCount = CursorUtil.getColumnIndexOrThrow(_cursor, "retry_count");
|
||||
final int _cursorIndexOfCreatedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "created_at");
|
||||
final int _cursorIndexOfUploadedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "uploaded_at");
|
||||
final List<UploadQueueEntity> _result = new ArrayList<UploadQueueEntity>(_cursor.getCount());
|
||||
while (_cursor.moveToNext()) {
|
||||
final UploadQueueEntity _item_1;
|
||||
final long _tmpId;
|
||||
_tmpId = _cursor.getLong(_cursorIndexOfId);
|
||||
final String _tmpDeviceType;
|
||||
_tmpDeviceType = _cursor.getString(_cursorIndexOfDeviceType);
|
||||
final String _tmpDeviceId;
|
||||
_tmpDeviceId = _cursor.getString(_cursorIndexOfDeviceId);
|
||||
final String _tmpDataType;
|
||||
_tmpDataType = _cursor.getString(_cursorIndexOfDataType);
|
||||
final String _tmpPayloadJson;
|
||||
_tmpPayloadJson = _cursor.getString(_cursorIndexOfPayloadJson);
|
||||
final int _tmpStatus;
|
||||
_tmpStatus = _cursor.getInt(_cursorIndexOfStatus);
|
||||
final int _tmpRetryCount;
|
||||
_tmpRetryCount = _cursor.getInt(_cursorIndexOfRetryCount);
|
||||
final long _tmpCreatedAt;
|
||||
_tmpCreatedAt = _cursor.getLong(_cursorIndexOfCreatedAt);
|
||||
final Long _tmpUploadedAt;
|
||||
if (_cursor.isNull(_cursorIndexOfUploadedAt)) {
|
||||
_tmpUploadedAt = null;
|
||||
} else {
|
||||
_tmpUploadedAt = _cursor.getLong(_cursorIndexOfUploadedAt);
|
||||
}
|
||||
_item_1 = new UploadQueueEntity(_tmpId,_tmpDeviceType,_tmpDeviceId,_tmpDataType,_tmpPayloadJson,_tmpStatus,_tmpRetryCount,_tmpCreatedAt,_tmpUploadedAt);
|
||||
_result.add(_item_1);
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
}, $completion);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static List<Class<?>> getRequiredConverters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package hilt_aggregated_deps;
|
||||
|
||||
import dagger.hilt.processor.internal.aggregateddeps.AggregatedDeps;
|
||||
import javax.annotation.processing.Generated;
|
||||
|
||||
/**
|
||||
* This class should only be referenced by generated code! This class aggregates information across multiple compilations.
|
||||
*/
|
||||
@AggregatedDeps(
|
||||
components = "dagger.hilt.components.SingletonComponent",
|
||||
modules = "com.stec.cmd.core.database.DatabaseModule"
|
||||
)
|
||||
@Generated("dagger.hilt.processor.internal.aggregateddeps.AggregatedDepsGenerator")
|
||||
public class _com_stec_cmd_core_database_DatabaseModule {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.stec.cmd.core.database" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="26" />
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.stec.cmd.core.database",
|
||||
"variantName": "debug",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"outputFile": "AndroidManifest.xml"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
aarFormatVersion=1.0
|
||||
aarMetadataVersion=1.0
|
||||
minCompileSdk=1
|
||||
minCompileSdkExtension=0
|
||||
minAndroidGradlePluginVersion=1.0.0
|
||||
coreLibraryDesugaringEnabled=false
|
||||
@@ -0,0 +1 @@
|
||||
{"room-compiler-2.6.1.jar (androidx.room:room-compiler:2.6.1)":"KSP_PROCESSOR","hilt-android-compiler-2.52.jar (com.google.dagger:hilt-android-compiler:2.52)":"KSP_PROCESSOR","dagger-compiler-2.52.jar (com.google.dagger:dagger-compiler:2.52)":"KSP_PROCESSOR"}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
#Thu Sep 03 16:17:27 CST 2026
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\main\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\main\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\debug\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\debug\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\build\generated\res\resValues\debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\build\generated\res\resValues\debug"/></dataSet><mergedItems/></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\main\jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\debug\jniLibs"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\main\shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\debug\shaders"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\main\assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\src\debug\assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Administrator\m-stecmd\core\database\build\intermediates\shader_assets\debug\compileDebugShaders\out"/></dataSet></merger>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
R_DEF: Internal format may change without notice
|
||||
local
|
||||
@@ -0,0 +1,7 @@
|
||||
1<?xml version="1.0" encoding="utf-8"?>
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.stec.cmd.core.database" >
|
||||
4
|
||||
5 <uses-sdk android:minSdkVersion="26" />
|
||||
6
|
||||
7</manifest>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.stec.cmd.core.database" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="26" />
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
0 Warning/Error
|
||||
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user