hippware / rn-chat

MIT License
5 stars 0 forks source link

[android] Discussion: App is unpredictably killed or restricted by OS #4522

Open bengtan opened 4 years ago

bengtan commented 4 years ago

This was first encountered by QA and testers on Samsung android devices. The symptom is that location data points are not uploaded when expected. This occurs at random and unpredictable times. Hence, our location based services don't work properly due to the lack of reliable data points.

Upon investigation, it appears that this has been (crowd-sourced and) documented:

(and many more places throughout the internet)

It affects not just Samsung devices, but the majority of android devices, albeit in different ways.

Trying to mitigate or solve this is going to require investigation, discussion, and (probably) multiple sub-tickets/tasks.

bengtan commented 4 years ago

Ideas for partial mitigation:

bengtan commented 4 years ago

I found the Samsung battery (non-)optimisation whitelist. See below.

I extracted an app called SmartManager_v5 from a Sept/Oct 2019 firmware of a Galaxy S10 and extracted a file res/values/arrays.xml from the app.

If you download it and rename it back to an .xml extension, you can view it in a browser or xml viewer and be able to expand/collapse the subcategories.

Notice:

    <string-array name="default_whitelist">
        ...
        <item>com.life360.android.note4</item>
        <item>com.life360.android.s6</item>
        <item>com.life360.android.safetymapd</item>
        ...
    </string-array>
    <string-array name="exclude_from_spcm">
        ...
        <item>com.life360.android.safetymapd</item>
        <item>com.life360.android.note4</item>
        <item>com.life360.android.s6</item>
        ...
    </string-array>

around lines 78-80 and 872-878. There are about 300 apps in default_whitelist and about 250 apps in exclude_from_spcm (I have no idea what exclude_from_spcm means).

SmartManager_v5_res_values_arrays.xml.txt