Mathieu Chartier | 7267676 | 2017-10-15 20:07:19 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2017 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | # Sets Android Go recommended default values for propreties. |
| 18 | |
| 19 | # Set lowram options |
| 20 | PRODUCT_PROPERTY_OVERRIDES += \ |
| 21 | ro.config.low_ram=true \ |
| 22 | ro.lmk.critical_upgrade=true \ |
Suren Baghdasaryan | df10064 | 2017-12-22 13:32:35 -0800 | [diff] [blame] | 23 | ro.lmk.upgrade_pressure=40 \ |
| 24 | ro.lmk.downgrade_pressure=60 \ |
Yao Chen | b76f355 | 2018-06-06 17:22:57 -0700 | [diff] [blame] | 25 | ro.lmk.kill_heaviest_task=false \ |
| 26 | ro.statsd.enable=false |
Mathieu Chartier | 7267676 | 2017-10-15 20:07:19 -0700 | [diff] [blame] | 27 | |
| 28 | # set threshold to filter unused apps |
| 29 | PRODUCT_PROPERTY_OVERRIDES += \ |
| 30 | pm.dexopt.downgrade_after_inactive_days=10 |
| 31 | |
| 32 | |
| 33 | # Speed profile services and wifi-service to reduce RAM and storage. |
| 34 | PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile |
| 35 | |
| 36 | # Always preopt extracted APKs to prevent extracting out of the APK for gms |
| 37 | # modules. |
| 38 | PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK := true |
| 39 | |
| 40 | # Use a profile based boot image for this device. Note that this is currently a |
| 41 | # generic profile and not Android Go optimized. |
| 42 | PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true |
| 43 | PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := frameworks/base/config/boot-image-profile.txt |
| 44 | |
| 45 | # set the compiler filter for shared apks to quicken. |
| 46 | # Rationale: speed has a lot of dex code expansion, it uses more ram and space |
| 47 | # compared to quicken. Using quicken for shared APKs on Go devices may save RAM. |
| 48 | # Note that this is a trade-off: here we trade clean pages for dirty pages, |
| 49 | # extra cpu and battery. That's because the quicken files will be jit-ed in all |
| 50 | # the processes that load of shared apk and the code cache is not shared. |
| 51 | # Some notable apps that will be affected by this are gms and chrome. |
| 52 | # b/65591595. |
| 53 | PRODUCT_PROPERTY_OVERRIDES += \ |
| 54 | pm.dexopt.shared=quicken |
| 55 | |
| 56 | # Default heap sizes. Allow up to 256m for large heaps to make sure a single app |
| 57 | # doesn't take all of the RAM. |
| 58 | PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapgrowthlimit=128m |
| 59 | PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapsize=256m |
| 60 | |
Andreas Gampe | 6bb2743 | 2017-10-19 11:42:44 -0700 | [diff] [blame] | 61 | # Do not generate libartd. |
| 62 | PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false |
Mathieu Chartier | 99b2739 | 2017-10-24 14:12:58 -0700 | [diff] [blame] | 63 | |
Remi NGUYEN VAN | a329810 | 2018-11-22 18:13:20 +0900 | [diff] [blame] | 64 | # Do not spin up a separate process for the network stack on go devices, use an in-process lib. |
| 65 | PRODUCT_PACKAGES += NetworkStackLib |
| 66 | PRODUCT_SYSTEM_SERVER_JARS += NetworkStackLib |
| 67 | |
Mathieu Chartier | 99b2739 | 2017-10-24 14:12:58 -0700 | [diff] [blame] | 68 | # Strip the local variable table and the local variable type table to reduce |
| 69 | # the size of the system image. This has no bearing on stack traces, but will |
| 70 | # leave less information available via JDWP. |
| 71 | PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true |
Kostya Kortchinsky | 0273240 | 2019-02-01 09:06:42 -0800 | [diff] [blame] | 72 | |
| 73 | # Disable Scudo outside of eng builds to save RAM. |
| 74 | ifneq (,$(filter eng, $(TARGET_BUILD_VARIANT))) |
| 75 | PRODUCT_DISABLE_SCUDO := true |
| 76 | endif |