update the full database
This commit is contained in:
@@ -39,7 +39,11 @@
|
||||
|
||||
package com.github.shadowsocks
|
||||
|
||||
import android.app.backup.{SharedPreferencesBackupHelper, BackupAgentHelper}
|
||||
import android.app.backup.{FileBackupHelper, SharedPreferencesBackupHelper, BackupAgentHelper}
|
||||
import android.content.Context
|
||||
|
||||
case class DbBackupHelper(context: Context, dbName: String)
|
||||
extends FileBackupHelper(context, context.getDatabasePath(dbName).getAbsolutePath)
|
||||
|
||||
class ShadowsocksBackupAgent extends BackupAgentHelper {
|
||||
|
||||
@@ -51,8 +55,11 @@ class ShadowsocksBackupAgent extends BackupAgentHelper {
|
||||
// identify the SharedPreferencesBackupHelper's data.
|
||||
val MY_PREFS_BACKUP_KEY = "com.github.shadowsocks"
|
||||
|
||||
val DATABASE = "com.github.shadowsocks.database.profile"
|
||||
|
||||
override def onCreate() {
|
||||
val helper = new SharedPreferencesBackupHelper(this, PREFS_DISPLAY)
|
||||
addHelper(MY_PREFS_BACKUP_KEY, helper)
|
||||
addHelper(DATABASE, new DbBackupHelper(this, "profile.db"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user