diff --git a/conf/init.factory.rc b/conf/init.factory.rc index 42a1ad15..409ab1a5 100644 --- a/conf/init.factory.rc +++ b/conf/init.factory.rc @@ -12,3 +12,8 @@ on boot # Audio test folder mkdir /data/AudioTest 0775 system system + +on property:sys.boot_completed=1 + # Bump nnapi min clamp & add adbd to it for factory (b/222226268) + write /sys/kernel/vendor_sched/nnapi_uclamp_min 512 + exec - system system -- /vendor/bin/factory/factory_post_boot diff --git a/factory/factory_post_boot/Android.bp b/factory/factory_post_boot/Android.bp new file mode 100644 index 00000000..cbbebda4 --- /dev/null +++ b/factory/factory_post_boot/Android.bp @@ -0,0 +1,25 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} +sh_binary { + name: "factory_post_boot", + src: "factory_post_boot.sh", + vendor: true, + sub_dir: "factory", +} + diff --git a/factory/factory_post_boot/factory_post_boot.sh b/factory/factory_post_boot/factory_post_boot.sh new file mode 100644 index 00000000..f610901a --- /dev/null +++ b/factory/factory_post_boot/factory_post_boot.sh @@ -0,0 +1,4 @@ +#!/vendor/bin/sh + +# Add adbd to nnapi vendor cgroup. (b/222226268) +echo `pidof adbd` > /sys/kernel/vendor_sched/set_task_group_nnapi diff --git a/factory_common.mk b/factory_common.mk index 0e2fd5c2..4a5d42bd 100644 --- a/factory_common.mk +++ b/factory_common.mk @@ -63,11 +63,14 @@ DEVICE_PACKAGE_OVERLAYS += device/google/gs201/overlay-factory PRODUCT_COPY_FILES += \ device/google/gs201/conf/init.factory.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.factory.rc +BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/factory_boost + # Add factory-friendly changes PRODUCT_PACKAGES += \ FactoryOverlaySettings \ FactoryOverlayLauncher3 \ - FactoryOverlayFrameworkRes + FactoryOverlayFrameworkRes \ + factory_post_boot # To prevent rebooting due to crashing services PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \