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

Commit a9b91864 authored by Christopher Tate's avatar Christopher Tate
Browse files

Deal with apps known to LocalTransport backend but with no data

An app might have backed something up and later deleted it, in which
case it will have a directory in the LocalTransport bookkeeping but
with no actual dataset.  Skip these packages at restore time, since
we know a priori that there will be nothing to do.

Change-Id: I85853097bc65ed60e5efd217ee6553b50459e445
parent 3651cb7b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -233,7 +233,9 @@ public class LocalTransport extends IBackupTransport.Stub {
        if (mRestorePackages == null) throw new IllegalStateException("startRestore not called");
        while (++mRestorePackage < mRestorePackages.length) {
            String name = mRestorePackages[mRestorePackage].packageName;
            if (new File(mDataDir, name).isDirectory()) {
            // skip packages where we have a data dir but no actual contents
            String[] contents = (new File(mDataDir, name)).list();
            if (contents != null && contents.length > 0) {
                if (DEBUG) Log.v(TAG, "  nextRestorePackage() = " + name);
                return name;
            }