Skip to content

Commit 145e6c4

Browse files
Ola OlssonJohan Redestig
authored andcommitted
The phone is crashing when unknown mime content is transferred.
The content resolver does not take care of the IllegalStateException that is thrown in getType and that needs to be fixed. Change-Id: I3e66f1aa259ab91fb9233e1ba07faa1ab6c3f2dd
1 parent e78a000 commit 145e6c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/java/android/content/ContentResolver.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ public final String getType(Uri url) {
201201
} catch (RemoteException e) {
202202
return null;
203203
} catch (java.lang.Exception e) {
204+
Log.w(TAG, "Failed to get type for: " + url + " (" + e.getMessage() + ")");
204205
return null;
205206
} finally {
206207
releaseProvider(provider);
@@ -216,6 +217,9 @@ public final String getType(Uri url) {
216217
return type;
217218
} catch (RemoteException e) {
218219
return null;
220+
} catch (java.lang.Exception e) {
221+
Log.w(TAG, "Failed to get type for: " + url + " (" + e.getMessage() + ")");
222+
return null;
219223
}
220224
}
221225

0 commit comments

Comments
 (0)