Skip to content

Commit

Permalink
Always log BackupMonitor and start stopped apps later in CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Oct 11, 2024
1 parent 2079562 commit f672de1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ internal class BackupRestoreTest : SeedvaultLargeTest() {

@Test
fun `backup and restore applications`() {
launchStoppedApps()
launchBackupActivity()

if (!keyManager.hasBackupKey()) {
Expand All @@ -34,6 +33,9 @@ internal class BackupRestoreTest : SeedvaultLargeTest() {
changeBackupLocation()
}

launchStoppedApps()
launchBackupActivity()

val backupResult = performBackup()
assertValidBackupMetadata(backupResult)

Expand Down
6 changes: 1 addition & 5 deletions app/src/main/java/com/stevesoltys/seedvault/BackupMonitor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import android.app.backup.BackupManagerMonitor.LOG_EVENT_ID_ERROR_PREFLIGHT
import android.app.backup.IBackupManagerMonitor
import android.os.Bundle
import android.util.Log
import android.util.Log.DEBUG

private val TAG = BackupMonitor::class.java.name

Expand All @@ -29,14 +28,11 @@ open class BackupMonitor : IBackupManagerMonitor.Stub() {
}

open fun onEvent(id: Int, category: Int, packageName: String?, bundle: Bundle) {
Log.d(TAG, "${packageName?.padEnd(64, ' ')} cat: $category id: $id")
if (id == LOG_EVENT_ID_ERROR_PREFLIGHT) {
val preflightResult = bundle.getLong(EXTRA_LOG_PREFLIGHT_ERROR, -1)
Log.w(TAG, "Pre-flight error from $packageName: $preflightResult")
}
if (!Log.isLoggable(TAG, DEBUG)) return
Log.d(TAG, "ID: $id")
Log.d(TAG, "CATEGORY: $category")
Log.d(TAG, "PACKAGE: $packageName")
}

}

0 comments on commit f672de1

Please sign in to comment.