Load image with resampling to prevent OOM
ClosedPublic

Authored by eduisters on Nov 6 2018, 4:49 PM.

Details

Summary

When loading large images you can run into an OOM situation crashing
the app and leaving the progress notification displayed indefinitely

BUG: 397507

Test Plan

Before applying the patch find a phone where the app crashes when you send a very large
image to it (my 6.0.1 phone did not even crash when i send it a 85MB image but my 4.0.4 phone
already crashes on a 7MB image)

Apply patch install and send image again

Diff Detail

Repository
R225 KDE Connect - Android application
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
eduisters created this revision.Nov 6 2018, 4:49 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptNov 6 2018, 4:49 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
eduisters requested review of this revision.Nov 6 2018, 4:49 PM
albertvaka requested changes to this revision.Nov 7 2018, 3:13 PM
albertvaka added a subscriber: albertvaka.
albertvaka added inline comments.
src/org/kde/kdeconnect/Plugins/SharePlugin/ShareNotification.java
129

I think you had an old version of the code when you implemented this, because I changed this finally to a try-with-resources and in your patch this got reverted. Can you rebase it onto the latest master? Apart from that, the patch looks good.

This revision now requires changes to proceed.Nov 7 2018, 3:13 PM
eduisters updated this revision to Diff 45052.Nov 7 2018, 4:23 PM
  • Use try-with-resources
eduisters marked an inline comment as done.Nov 7 2018, 4:24 PM
albertvaka accepted this revision.Nov 7 2018, 4:40 PM
This revision is now accepted and ready to land.Nov 7 2018, 4:40 PM
This revision was automatically updated to reflect the committed changes.