2019-07-09 09:52:03 +02:00
|
|
|
package com.stevesoltys.backup
|
|
|
|
|
|
|
|
import android.app.Application
|
|
|
|
import android.app.backup.IBackupManager
|
|
|
|
import android.content.Context.BACKUP_SERVICE
|
|
|
|
import android.os.ServiceManager.getService
|
2019-07-09 19:22:24 +02:00
|
|
|
import com.stevesoltys.backup.crypto.KeyManager
|
|
|
|
import com.stevesoltys.backup.crypto.KeyManagerImpl
|
2019-07-09 09:52:03 +02:00
|
|
|
|
|
|
|
const val JOB_ID_BACKGROUND_BACKUP = 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Steve Soltys
|
|
|
|
* @author Torsten Grote
|
|
|
|
*/
|
|
|
|
class Backup : Application() {
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
val backupManager: IBackupManager by lazy {
|
|
|
|
IBackupManager.Stub.asInterface(getService(BACKUP_SERVICE))
|
|
|
|
}
|
2019-07-09 19:22:24 +02:00
|
|
|
val keyManager: KeyManager by lazy {
|
|
|
|
KeyManagerImpl()
|
|
|
|
}
|
2019-07-09 09:52:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|