Check for encrypted backup

pull/215/head
M66B 8 months ago
parent a3a8000d2d
commit 910a8e844b

@ -56,9 +56,12 @@ public class FairEmailBackupAgent extends BackupAgent {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean enabled = prefs.getBoolean("google_backup", BuildConfig.PLAY_STORE_RELEASE); boolean enabled = prefs.getBoolean("google_backup", BuildConfig.PLAY_STORE_RELEASE);
EntityLog.log(this, "Backup start enabled=" + enabled); boolean encrypted = ((data.getTransportFlags() & FLAG_CLIENT_SIDE_ENCRYPTION_ENABLED) != 0);
boolean d2d = ((data.getTransportFlags() & FLAG_DEVICE_TO_DEVICE_TRANSFER) != 0);
EntityLog.log(this, "Backup start enabled=" + enabled +
" encrypted=" + encrypted + " d2d=" + d2d);
if (!enabled) if (!enabled || !(encrypted || BuildConfig.DEBUG))
return; return;
try { try {
@ -130,6 +133,11 @@ public class FairEmailBackupAgent extends BackupAgent {
EntityLog.log(this, "Backup end"); EntityLog.log(this, "Backup end");
} }
@Override
public void onQuotaExceeded(long backupDataBytes, long quotaBytes) {
Log.e("Backup quota exceeded " + backupDataBytes + "/" + quotaBytes);
}
@Override @Override
public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws
IOException { IOException {
@ -215,6 +223,11 @@ public class FairEmailBackupAgent extends BackupAgent {
EntityLog.log(this, "Restore end"); EntityLog.log(this, "Restore end");
} }
@Override
public void onRestoreFinished() {
EntityLog.log(this, "Restore finished");
}
static void dataChanged(Context context) { static void dataChanged(Context context) {
try { try {
new BackupManager(context).dataChanged(); new BackupManager(context).dataChanged();

Loading…
Cancel
Save