MyDataTaiwan / mylog14

GNU General Public License v3.0
16 stars 11 forks source link

[Bug Report] Cannot Take New Photos After App Uses Up Android Device Memory #284

Open seanwu1105 opened 4 years ago

seanwu1105 commented 4 years ago

After the app contains multiple proofs, the app will be killed when taking new photos due to insufficient memory. Thus, after the the app recreated by Android, users will find out that the app does not store the new photo.

Steps to Reproduce

  1. Use a low-end Android device.
  2. After install the app, take photo.
  3. When taking photos, do some "memory demanding" tasks, such as zoom in and out, or switch rear and front camera multiple times.
  4. Repeat the steps 3. multiple times, the app should containing multiple photos and thus uses more device memory.
  5. There should be a high chance that Android kills the mylog app and restores it after user takes a photo. The new photo will not be caught by the app (i.e. the PhotoService.create() will not work).

This is the same issue as https://github.com/numbersprotocol/capture-lite/issues/83. We should catch the image after the app is restored by App.addListener('appRestoredResult', ...). The result is in the following format:

{
   "pluginId":"Camera",
   "methodName":"getPhoto",
   "success":true,
   "data":{
      "format":"jpeg",
      "base64String":"...",
      ...
   },
   ...
}