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

Commit 9c4fd7b8 authored by Steve McKay's avatar Steve McKay Committed by android-build-merger
Browse files

Merge \\\"Include cause when reporting errors.\\\" into nyc-dev am: 60585e6c am: be8b6e61

am: 7dfb6fa1

Change-Id: Iade90d4bfb323bcc1bb7a771fcb2b64656c25d57
parents 9d9f42da 7dfb6fa1
Loading
Loading
Loading
Loading
+9 −15
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ class CopyJob extends Job {
        try {
            mBatchSize = calculateSize(mSrcs);
        } catch (ResourceException e) {
            Log.w(TAG, "Failed to calculate total size. Copying without progress.");
            Log.w(TAG, "Failed to calculate total size. Copying without progress.", e);
            mBatchSize = -1;
        }

@@ -230,25 +230,19 @@ class CopyJob extends Job {
        for (int i = 0; i < mSrcs.size() && !isCanceled(); ++i) {
            srcInfo = mSrcs.get(i);

            // Guard unsupported recursive operation.
            try {
                if (dstInfo.equals(srcInfo) || isDescendentOf(srcInfo, dstInfo)) {
                    throw new ResourceException("Cannot copy to itself recursively.");
                }
            } catch (ResourceException e) {
                Log.e(TAG, e.toString());
                onFileFailed(srcInfo);
                continue;
            }

            if (DEBUG) Log.d(TAG,
                    "Copying " + srcInfo.displayName + " (" + srcInfo.derivedUri + ")"
                    + " to " + dstInfo.displayName + " (" + dstInfo.derivedUri + ")");

            try {
                if (dstInfo.equals(srcInfo) || isDescendentOf(srcInfo, dstInfo)) {
                    Log.e(TAG, "Skipping recursive copy of " + srcInfo.derivedUri);
                    onFileFailed(srcInfo);
                } else {
                    processDocument(srcInfo, null, dstInfo);
                }
            } catch (ResourceException e) {
                Log.e(TAG, e.toString());
                Log.e(TAG, "Failed to copy " + srcInfo.derivedUri, e);
                onFileFailed(srcInfo);
            }
        }
@@ -296,7 +290,7 @@ class CopyJob extends Job {
                    }
                } catch (RemoteException | RuntimeException e) {
                    Log.e(TAG, "Provider side copy failed for: " + src.derivedUri
                            + " due to an exception: " + e);
                            + " due to an exception.", e);
                }

                // If optimized copy fails, then fallback to byte-by-byte copy.
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ final class DeleteJob extends Job {
                    return;
                }
            } catch (ResourceException e) {
                Log.e(TAG, "Failed to delete document @ " + doc.derivedUri);
                Log.e(TAG, "Failed to delete document @ " + doc.derivedUri, e);
                onFileFailed(doc);
            }

+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ final class MoveJob extends CopyJob {
                    }
                } catch (RemoteException | RuntimeException e) {
                    Log.e(TAG, "Provider side move failed for: " + src.derivedUri
                            + " due to an exception: " + e);
                            + " due to an exception: ", e);
                }
                // If optimized move fails, then fallback to byte-by-byte copy.
                if (DEBUG) Log.d(TAG, "Fallback to byte-by-byte move for: " + src.derivedUri);