@@ -113,6 +113,8 @@ private static boolean serializeNotificationParcel(Intent intent, DataOutputStre
113
113
return true ;
114
114
} catch (Exception e ) {
115
115
Log .e (TAG_UNITY , "Failed to serialize notification as Parcel" , e );
116
+ } catch (OutOfMemoryError e ) {
117
+ Log .e (TAG_UNITY , "Failed to serialize notification as Parcel" , e );
116
118
}
117
119
118
120
return false ;
@@ -186,8 +188,11 @@ private static byte[] serializeParcelable(Parcelable obj) {
186
188
return result ;
187
189
} catch (Exception e ) {
188
190
Log .e (TAG_UNITY , "Failed to serialize Parcelable" , e );
189
- return null ;
191
+ } catch (OutOfMemoryError e ) {
192
+ Log .e (TAG_UNITY , "Failed to serialize Parcelable" , e );
190
193
}
194
+
195
+ return null ;
191
196
}
192
197
193
198
protected static Object deserializeNotification (Context context , SharedPreferences prefs ) {
@@ -251,8 +256,11 @@ private static Notification deserializeNotificationParcelable(DataInputStream in
251
256
return notification ;
252
257
} catch (Exception e ) {
253
258
Log .e (TAG_UNITY , "Failed to deserialize notification intent" , e );
254
- return null ;
259
+ } catch (OutOfMemoryError e ) {
260
+ Log .e (TAG_UNITY , "Failed to deserialize notification intent" , e );
255
261
}
262
+
263
+ return null ;
256
264
}
257
265
258
266
private static Notification .Builder deserializeNotificationCustom (DataInputStream in ) {
@@ -354,8 +362,11 @@ private static Notification.Builder deserializeNotificationCustom(DataInputStrea
354
362
return builder ;
355
363
} catch (Exception e ) {
356
364
Log .e (TAG_UNITY , "Failed to deserialize notification" , e );
357
- return null ;
365
+ } catch (OutOfMemoryError e ) {
366
+ Log .e (TAG_UNITY , "Failed to deserialize notification" , e );
358
367
}
368
+
369
+ return null ;
359
370
}
360
371
361
372
private static Notification .Builder deserializedFromOldIntent (byte [] bytes ) {
@@ -414,8 +425,11 @@ private static Notification.Builder deserializedFromOldIntent(byte[] bytes) {
414
425
return builder ;
415
426
} catch (Exception e ) {
416
427
Log .e (TAG_UNITY , "Failed to deserialize old style notification" , e );
417
- return null ;
428
+ } catch (OutOfMemoryError e ) {
429
+ Log .e (TAG_UNITY , "Failed to deserialize old style notification" , e );
418
430
}
431
+
432
+ return null ;
419
433
}
420
434
421
435
private static String deserializeString (DataInputStream in ) throws IOException {
@@ -449,6 +463,8 @@ private static <T extends Parcelable> T deserializeParcelable(DataInputStream in
449
463
}
450
464
} catch (Exception e ) {
451
465
Log .e (TAG_UNITY , "Failed to deserialize parcelable" , e );
466
+ } catch (OutOfMemoryError e ) {
467
+ Log .e (TAG_UNITY , "Failed to deserialize parcelable" , e );
452
468
}
453
469
454
470
return null ;
0 commit comments