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

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

Merge "Don't crash when wiping backup data redundantly in the local transport"

parents 0c44525a 0abf6a00
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -166,10 +166,13 @@ public class LocalTransport extends IBackupTransport.Stub {
        if (DEBUG) Log.v(TAG, "clearBackupData() pkg=" + packageInfo.packageName);

        File packageDir = new File(mDataDir, packageInfo.packageName);
        for (File f : packageDir.listFiles()) {
        final File[] fileset = packageDir.listFiles();
        if (fileset != null) {
            for (File f : fileset) {
                f.delete();
            }
            packageDir.delete();
        }
        return BackupConstants.TRANSPORT_OK;
    }

+2 −0
Original line number Diff line number Diff line
@@ -4693,6 +4693,8 @@ class BackupManagerService extends IBackupManager.Stub {
                mTransport.clearBackupData(mPackage);
            } catch (RemoteException e) {
                // can't happen; the transport is local
            } catch (Exception e) {
                Slog.e(TAG, "Transport threw attempting to clear data for " + mPackage);
            } finally {
                try {
                    // TODO - need to handle failures