OSDN Git Service

The phone did not reject unsupported vCalendar item
authorOlsson <ola1.olsson@sonyericsson.com>
Mon, 6 Dec 2010 13:23:37 +0000 (14:23 +0100)
committerJohan Redestig <johan.redestig@sonyericsson.com>
Thu, 14 Apr 2011 06:58:06 +0000 (08:58 +0200)
vCalendar is not supported in the phone but it was not
rejected. A blacklist was present in the code but not
used. Hence, this fix enables the blacklist functionality.

Change-Id: I4fefe0e819eb025d37c972cf7e74eabd4f6e6585

src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java

index cb292c1..a58df0d 100644 (file)
@@ -230,10 +230,13 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
             }
 
             // Reject policy: anything outside the "white list" plus unspecified
-            // MIME Types.
+            // MIME Types. Also reject everything in the "black list".
             if (!pre_reject
-                    && (mimeType == null || (!Constants.mimeTypeMatches(mimeType,
-                            Constants.ACCEPTABLE_SHARE_INBOUND_TYPES)))) {
+                    && (mimeType == null
+                            || !Constants.mimeTypeMatches(mimeType,
+                                    Constants.ACCEPTABLE_SHARE_INBOUND_TYPES)
+                            || Constants.mimeTypeMatches(mimeType,
+                                    Constants.UNACCEPTABLE_SHARE_INBOUND_TYPES))) {
                 if (D) Log.w(TAG, "mimeType is null or in unacceptable list, reject the transfer");
                 pre_reject = true;
                 obexResponse = ResponseCodes.OBEX_HTTP_UNSUPPORTED_TYPE;