factory: add factory_post_boot.sh/boost adbd

Add factory_post_boot.sh for factory targets to boost
adbd on boot.

Bug: 222226268
Change-Id: If20455705e2632eda95297952cfd770a4e8ff6f7
This commit is contained in:
Andrew Chant 2022-03-08 19:47:19 -08:00 committed by TreeHugger Robot
parent dced35e5c5
commit 2f2f7fd3de
4 changed files with 38 additions and 1 deletions

View file

@ -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

View file

@ -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",
}

View file

@ -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

View file

@ -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 += \