DatabaseBackupViewModel
class DatabaseBackupViewModel(backupService: DatabaseBackupOperations, fileService: FileService, nodeRepository: NodeRepository, radioController: RadioController, radioPrefs: RadioPrefs, alertManager: AlertManager) : ViewModel(source)
Backs up the app database for the connected device, and stages a restore that applies on the next launch.
Constructors
Link copied to clipboard
constructor(backupService: DatabaseBackupOperations, fileService: FileService, nodeRepository: NodeRepository, radioController: RadioController, radioPrefs: RadioPrefs, alertManager: AlertManager)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Asks for confirmation, then calls onConfirmed so the caller can open its file picker.
Link copied to clipboard
Link copied to clipboard
Runs onReady now when the radio is disconnected. Otherwise, including while it sleeps or connects, asks first and, once confirmed, disconnects the radio the same way the Connections screen does, then runs onReady. The backup or restore binds to the device database active before the disconnect or, already disconnected, to the last device's; with no device database it does not proceed.
Link copied to clipboard
File name offered by the save picker: device id and today's date.