Loading core/java/com/google/android/mms/pdu/PduPersister.java +91 −86 Original line number Diff line number Diff line Loading @@ -519,7 +519,11 @@ public class PduPersister { * @throws MmsException Failed to load some fields of a PDU. */ public GenericPdu load(Uri uri) throws MmsException { PduCacheEntry cacheEntry; GenericPdu pdu = null; PduCacheEntry cacheEntry = null; int msgBox = 0; long threadId = -1; try { synchronized(PDU_CACHE_INSTANCE) { if (PDU_CACHE_INSTANCE.isUpdating(uri)) { if (LOCAL_LOGV) { Loading @@ -545,8 +549,6 @@ public class PduPersister { PduHeaders headers = new PduHeaders(); Set<Entry<Integer, Integer>> set; long msgId = ContentUris.parseId(uri); int msgBox; long threadId; try { if ((c == null) || (c.getCount() != 1) || !c.moveToFirst()) { Loading Loading @@ -609,7 +611,6 @@ public class PduPersister { } } GenericPdu pdu = null; switch (msgType) { case PduHeaders.MESSAGE_TYPE_NOTIFICATION_IND: pdu = new NotificationInd(headers); Loading Loading @@ -658,16 +659,20 @@ public class PduPersister { throw new MmsException( "Unrecognized PDU type: " + Integer.toHexString(msgType)); } } finally { synchronized(PDU_CACHE_INSTANCE) { if (pdu != null) { assert(PDU_CACHE_INSTANCE.get(uri) == null); // Update the cache entry with the real info cacheEntry = new PduCacheEntry(pdu, msgBox, threadId); PDU_CACHE_INSTANCE.put(uri, cacheEntry); } PDU_CACHE_INSTANCE.setUpdating(uri, false); PDU_CACHE_INSTANCE.notifyAll(); // tell anybody waiting on this entry to go ahead return pdu; } } return pdu; } private void persistAddress( long msgId, int type, EncodedStringValue[] array) { Loading Loading
core/java/com/google/android/mms/pdu/PduPersister.java +91 −86 Original line number Diff line number Diff line Loading @@ -519,7 +519,11 @@ public class PduPersister { * @throws MmsException Failed to load some fields of a PDU. */ public GenericPdu load(Uri uri) throws MmsException { PduCacheEntry cacheEntry; GenericPdu pdu = null; PduCacheEntry cacheEntry = null; int msgBox = 0; long threadId = -1; try { synchronized(PDU_CACHE_INSTANCE) { if (PDU_CACHE_INSTANCE.isUpdating(uri)) { if (LOCAL_LOGV) { Loading @@ -545,8 +549,6 @@ public class PduPersister { PduHeaders headers = new PduHeaders(); Set<Entry<Integer, Integer>> set; long msgId = ContentUris.parseId(uri); int msgBox; long threadId; try { if ((c == null) || (c.getCount() != 1) || !c.moveToFirst()) { Loading Loading @@ -609,7 +611,6 @@ public class PduPersister { } } GenericPdu pdu = null; switch (msgType) { case PduHeaders.MESSAGE_TYPE_NOTIFICATION_IND: pdu = new NotificationInd(headers); Loading Loading @@ -658,16 +659,20 @@ public class PduPersister { throw new MmsException( "Unrecognized PDU type: " + Integer.toHexString(msgType)); } } finally { synchronized(PDU_CACHE_INSTANCE) { if (pdu != null) { assert(PDU_CACHE_INSTANCE.get(uri) == null); // Update the cache entry with the real info cacheEntry = new PduCacheEntry(pdu, msgBox, threadId); PDU_CACHE_INSTANCE.put(uri, cacheEntry); } PDU_CACHE_INSTANCE.setUpdating(uri, false); PDU_CACHE_INSTANCE.notifyAll(); // tell anybody waiting on this entry to go ahead return pdu; } } return pdu; } private void persistAddress( long msgId, int type, EncodedStringValue[] array) { Loading