Skip to content

Commit

Permalink
fix: Active check in PackageBackupEntireDao
Browse files Browse the repository at this point in the history
Change-Id: I09e28d9b65615fb51b7e4d3a2dbd5cdb59bd92c5
  • Loading branch information
XayahSuSuSu committed Sep 22, 2023
1 parent a126d4d commit d0717b2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface PackageBackupEntireDao {
@Query("SELECT packageName, label FROM PackageBackupEntire WHERE packageName = :packageName LIMIT 1")
suspend fun queryManifestPackage(packageName: String): PackageBackupManifest

@Query("SELECT packageName, label, operationCode, versionName, versionCode, flags FROM PackageBackupEntire WHERE operationCode = 1 OR operationCode = 2 OR operationCode = 3")
@Query("SELECT packageName, label, operationCode, versionName, versionCode, flags FROM PackageBackupEntire WHERE active = 1 AND (operationCode = 1 OR operationCode = 2 OR operationCode = 3)")
suspend fun queryActiveTotalPackages(): List<PackageBackupOp>

@Query("SELECT packageName, label FROM PackageBackupEntire WHERE active = 1 AND operationCode = 3")
Expand All @@ -41,13 +41,13 @@ interface PackageBackupEntireDao {
@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE active = 1")
suspend fun countActivePackages(): Int

@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE operationCode = 1 OR operationCode = 2 OR operationCode = 3")
@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE active = 1 AND (operationCode = 1 OR operationCode = 2 OR operationCode = 3)")
fun countSelectedTotal(): Flow<Int>

@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE operationCode = 2 OR operationCode = 3")
@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE active = 1 AND (operationCode = 2 OR operationCode = 3)")
fun countSelectedAPKs(): Flow<Int>

@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE operationCode = 1 OR operationCode = 3")
@Query("SELECT COUNT(*) FROM PackageBackupEntire WHERE active = 1 AND (operationCode = 1 OR operationCode = 3)")
fun countSelectedData(): Flow<Int>

@Query("UPDATE PackageBackupEntire SET active = :active")
Expand Down

0 comments on commit d0717b2

Please sign in to comment.