Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit edeb0d27 authored by Christopher Tate's avatar Christopher Tate Committed by Android (Google) Code Review
Browse files

Merge "Fix full backup of shared storage"

parents 68625766 fb2ea431
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@

    <application android:allowClearUserData="false"
                 android:permission="android.permission.CONFIRM_FULL_BACKUP"
                 android:backupAgent=".SharedStorageAgent"
                 android:allowBackup="false" >
                 android:backupAgent="SharedStorageAgent" >
    </application>
</manifest>
+2 −4
Original line number Diff line number Diff line
@@ -2,11 +2,8 @@ package com.android.sharedstoragebackup;

import android.app.backup.FullBackupAgent;
import android.app.backup.FullBackup;
import android.app.backup.BackupDataInput;
import android.app.backup.BackupDataOutput;
import android.app.backup.FullBackupDataOutput;
import android.content.Context;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.os.storage.StorageManager;
import android.os.storage.StorageVolume;
@@ -40,6 +37,7 @@ public class SharedStorageAgent extends FullBackupAgent {
        // hierarchy backup process on them.  By convention in the Storage Manager, the
        // "primary" shared storage volume is first in the list.
        if (mVolumes != null) {
            if (DEBUG) Slog.i(TAG, "Backing up " + mVolumes.length + " shared volumes");
            for (int i = 0; i < mVolumes.length; i++) {
                StorageVolume v = mVolumes[i];
                // Express the contents of volume N this way in the tar stream:
@@ -58,7 +56,7 @@ public class SharedStorageAgent extends FullBackupAgent {
    public void onRestoreFile(ParcelFileDescriptor data, long size,
            int type, String domain, String relpath, long mode, long mtime)
            throws IOException {
        Slog.d(TAG, "Shared restore: [ " + domain + " : " + relpath + "]");
        if (DEBUG) Slog.d(TAG, "Shared restore: [ " + domain + " : " + relpath + "]");

        File outFile = null;