Suppress OperationCanceledException logging.

These exceptions are normal when an app has cancelled an outstanding
thumbnail request.

Bug: 11385378
Change-Id: I8aed5721b447cda5baf447ac7afd627aa1062863
diff --git a/core/java/android/provider/DocumentsContract.java b/core/java/android/provider/DocumentsContract.java
index 09f5fe3..86d3cf8 100644
--- a/core/java/android/provider/DocumentsContract.java
+++ b/core/java/android/provider/DocumentsContract.java
@@ -34,6 +34,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.ParcelFileDescriptor;
 import android.os.ParcelFileDescriptor.OnCloseListener;
 import android.os.RemoteException;
@@ -670,7 +671,9 @@
         try {
             return getDocumentThumbnail(client, documentUri, size, signal);
         } catch (Exception e) {
-            Log.w(TAG, "Failed to load thumbnail for " + documentUri + ": " + e);
+            if (!(e instanceof OperationCanceledException)) {
+                Log.w(TAG, "Failed to load thumbnail for " + documentUri + ": " + e);
+            }
             return null;
         } finally {
             ContentProviderClient.releaseQuietly(client);
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
index 775720e..b2b2bd8 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
@@ -47,6 +47,7 @@
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.CancellationSignal;
+import android.os.OperationCanceledException;
 import android.os.Parcelable;
 import android.provider.DocumentsContract;
 import android.provider.DocumentsContract.Document;
@@ -1028,7 +1029,9 @@
                     thumbs.put(mUri, result);
                 }
             } catch (Exception e) {
-                Log.w(TAG, "Failed to load thumbnail for " + mUri + ": " + e);
+                if (!(e instanceof OperationCanceledException)) {
+                    Log.w(TAG, "Failed to load thumbnail for " + mUri + ": " + e);
+                }
             } finally {
                 ContentProviderClient.releaseQuietly(client);
             }