Skip to content

Commit

Permalink
martini: overlay: Don't pin camera & launcher app in memory
Browse files Browse the repository at this point in the history
The default camera app can be *huge* in some cases, e.g. when the app in
question is Google Camera. The system will only pin up to the first 80
MiB of the APK file, as well as the first 80 MiB of its odex. There are
several problems with this:

  - We could easily end up with 160 MiB of camera app files pinned,
    which is a somewhat tall order with the ~5.3 GiB of usable RAM that
    we have
  - The data that gets pinned may not even be the most critical data for
    launching the camera

Disable pinning of the camera app to save precious RAM on this device.

NB: The value has been changed to false instead of removing it entirely
because we need to override the config set by overlays in the prebuilt
vendor image.

Similar to what we did for the camera app, unpin the launcher app from
memory as well. While the default launcher (Launcher3) isn't
particularly big, it doesn't make much sense to pin because the launcher
does not typically load new resources much. Most of its resources should
already be loaded in memory after it starts, so pinning the APK is
redundant.

NB: The value has been changed to false instead of removing it entirely
because we need to override the config set by overlays in the prebuilt
vendor image.
  • Loading branch information
kdrag0n authored and inferno0230 committed Jan 26, 2023
1 parent d8f3b96 commit 4803e13
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions overlay/OPlusFrameworksResCommon/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
<bool name="config_lidControlsSleep">true</bool>

<!-- True if camera app should be pinned via Pinner Service -->
<bool name="config_pinnerCameraApp">true</bool>

<!-- True if home app should be pinned via Pinner Service -->
<bool name="config_pinnerHomeApp">true</bool>
<bool name="config_pinnerCameraApp">false</bool>

<!-- Indicate whether to allow the device to suspend when the screen is off
due to the proximity sensor. This resource should only be set to true
Expand Down

0 comments on commit 4803e13

Please sign in to comment.