Merge Android 24Q2 Release (ab/11526283) to aosp-main-future

Bug: 337098550
Merged-In: I4ac1ecf51da01c24d4e2f0f7e52df1d2cb92e275
Change-Id: I436cedecd5c6eb58f03fc239c520070163d49b8f
This commit is contained in:
Xin Li 2024-05-24 08:25:22 -07:00
commit ef6bdc1f33
99 changed files with 862 additions and 405 deletions

View File

@ -1,7 +1,8 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/aoc/sepolicy BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/aoc/sepolicy
PRODUCT_PACKAGES += dump_aoc \ PRODUCT_PACKAGES += dump_aoc \
aocd aocd \
aocxd
ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) ifeq (,$(filter aosp_%,$(TARGET_PRODUCT)))
# IAudioMetricExt HIDL # IAudioMetricExt HIDL
@ -23,4 +24,5 @@ PRODUCT_PACKAGES_DEBUG += \
aocdump \ aocdump \
aocutil \ aocutil \
aoc_audio_cfg \ aoc_audio_cfg \
vp_util vp_util \
aocx_tool

View File

@ -32,10 +32,6 @@ int main() {
runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_a32"); runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_a32");
runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_ff1"); runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_ff1");
runCommand("clean AoC buffer","echo ' ' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"); runCommand("clean AoC buffer","echo ' ' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Heap Stats (A32)", "echo 'dbg heap -c 1' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Heap Stats (F1)", "echo 'dbg heap -c 2' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Heap Stats (HF0)", "echo 'dbg heap -c 3' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Heap Stats (HF1)", "echo 'dbg heap -c 4' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC DVFS (FF1)", "echo 'dbg info -c 2 DVFSFF1' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"); runCommand("AoC DVFS (FF1)", "echo 'dbg info -c 2 DVFSFF1' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Monitor Mode Status", "echo 'monitor_mode status' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug"); runCommand("AoC Monitor Mode Status", "echo 'monitor_mode status' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
return 0; return 0;

28
aoc/sepolicy/aocxd.te Normal file
View File

@ -0,0 +1,28 @@
# aocxd server domain
type aocxd, domain;
type aocxd_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(aocxd)
# sysfs operations
allow aocxd sysfs_aoc:dir search;
# dev operations
allow aocxd aoc_device:chr_file rw_file_perms;
# allow inotify to watch for additions/removals from /dev
allow aocxd device:dir r_dir_perms;
# set properties
set_prop(aocxd, vendor_aoc_prop);
# allow binder access
vndbinder_use(aocxd);
# allow managing wakelocks
wakelock_use(aocxd);
# add aocx service to the domain
add_service(aocxd, aocx);
# allow managing thread priority
allow aocxd self:global_capability_class_set sys_nice;

View File

@ -27,11 +27,14 @@
/dev/acd-audio_ap_offload_rx u:object_r:aoc_device:s0 /dev/acd-audio_ap_offload_rx u:object_r:aoc_device:s0
/dev/acd-audio_ap_offload_tx u:object_r:aoc_device:s0 /dev/acd-audio_ap_offload_tx u:object_r:aoc_device:s0
/dev/acd-mel_processor u:object_r:aoc_device:s0 /dev/acd-mel_processor u:object_r:aoc_device:s0
/dev/acd-aocx_control u:object_r:aoc_device:s0
/dev/acd-mc_headpos u:object_r:aoc_device:s0
# AoC vendor binaries # AoC vendor binaries
/vendor/bin/aocd u:object_r:aocd_exec:s0 /vendor/bin/aocd u:object_r:aocd_exec:s0
/vendor/bin/aocdump u:object_r:aocdump_exec:s0 /vendor/bin/aocdump u:object_r:aocdump_exec:s0
/vendor/bin/dump/dump_aoc u:object_r:dump_aoc_exec:s0 /vendor/bin/dump/dump_aoc u:object_r:dump_aoc_exec:s0
/vendor/bin/aocxd u:object_r:aocxd_exec:s0
# AoC audio files # AoC audio files
/vendor/etc/aoc(/.*)? u:object_r:aoc_audio_file:s0 /vendor/etc/aoc(/.*)? u:object_r:aoc_audio_file:s0

View File

@ -0,0 +1 @@
type aocx, vndservice_manager_type;

View File

@ -0,0 +1 @@
aocx.IAocx u:object_r:aocx:s0

View File

@ -1,3 +1,4 @@
DEVICE_MANIFEST_FILE += device/google/gs-common/audio/aidl/manifest.xml DEVICE_MANIFEST_FILE += device/google/gs-common/audio/aidl/manifest.xml
# Audio HALs # Audio HALs
@ -17,6 +18,7 @@ PRODUCT_PACKAGES += \
libdownmixaidl \ libdownmixaidl \
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/aidl BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/aidl
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio
include device/google/gs-common/audio/common.mk include device/google/gs-common/audio/common.mk
@ -24,3 +26,7 @@ DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/audio/aidl/d
PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_PROPERTY_OVERRIDES += \
vendor.audio_hal.aidl.enable=true vendor.audio_hal.aidl.enable=true
PRODUCT_SYSTEM_EXT_PROPERTIES += \
ro.audio.ihaladaptervendorextension_enabled=true
$(call soong_config_set,pixel_audio_hal_type,aidl_build,true)

View File

@ -6,7 +6,7 @@ PRODUCT_PACKAGES += \
libmahalcontroller \ libmahalcontroller \
libAlgFx_HiFi3z libAlgFx_HiFi3z
ifneq ($(RELEASE_PIXEL_AIDL_AUDIO_HAL),true) ifneq ($(USE_AUDIO_HAL_AIDL),true)
## AudioHAL Configurations ## AudioHAL Configurations
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration_7_0.xml \ frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration_7_0.xml \

View File

@ -31,6 +31,7 @@ PRODUCT_PACKAGES += \
audio.bluetooth.default \ audio.bluetooth.default \
audio.r_submix.default \ audio.r_submix.default \
audio_spk_35l41 \ audio_spk_35l41 \
audio_spk_tas25xx \
audio_hdmi_aoc \ audio_hdmi_aoc \
sound_trigger.primary.$(TARGET_BOARD_PLATFORM) sound_trigger.primary.$(TARGET_BOARD_PLATFORM)

View File

@ -1,3 +1,3 @@
# Audio # Audio
type hal_audio_ext_service, hal_service_type, service_manager_type; type hal_audio_ext_service, hal_service_type, service_manager_type;
type hal_audio_parameter_parser_service, service_manager_type; type hal_audio_parameter_parser_service, service_manager_type;

View File

@ -1,4 +1,3 @@
# Audio # Audio
vendor.google.whitechapel.audio.extension.IAudioExtension/default u:object_r:hal_audio_ext_service:s0 vendor.google.whitechapel.audio.extension.IAudioExtension/default u:object_r:hal_audio_ext_service:s0
android.media.audio.IHalAdapterVendorExtension/default u:object_r:hal_audio_parameter_parser_service:s0 android.media.audio.IHalAdapterVendorExtension/default u:object_r:hal_audio_parameter_parser_service:s0

View File

@ -34,3 +34,7 @@ userdebug_or_eng(`
') ')
wakelock_use(hal_audio_default); wakelock_use(hal_audio_default);
vndbinder_use(hal_audio_default);
allow hal_audio_default aocx:service_manager find;
binder_call(hal_audio_default, aocxd);

View File

@ -1,51 +0,0 @@
/*
* 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.
*/
soong_namespace {
imports: [
"hardware/google/pixel",
],
}
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_binary {
vendor: true,
name: "battery_mitigation",
relative_install_path: "hw",
proprietary: true,
init_rc: ["battery_mitigation.rc"],
shared_libs: [
"libpixelmitigation",
"libbase",
"libbinder_ndk",
"libcutils",
"libhardware",
"liblog",
"libutils",
"android.hardware.thermal@2.0",
"android.hardware.thermal-V1-ndk"
],
srcs: [
"battery_mitigation.cpp",
],
cflags: [
"-Wall",
"-Werror",
],
}

View File

@ -1,220 +0,0 @@
/*
* 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.
*/
#define LOG_TAG "battery-mitigation"
#include <android/binder_process.h>
#include <battery_mitigation/BatteryMitigation.h>
#include <battery_mitigation/BatteryMitigationService.h>
#include <sys/resource.h>
#include <system/thread_defs.h>
#define COUNT_LIMIT 10
using android::hardware::google::pixel::BatteryMitigation;
using android::hardware::google::pixel::BatteryMitigationService;
using android::hardware::google::pixel::MitigationConfig;
android::sp<BatteryMitigation> bmSp;
android::sp<BatteryMitigationService> batteryMitigationService;
const struct MitigationConfig::Config cfg = {
.SystemPath = {
"/dev/thermal/tz-by-name/batoilo/temp",
"/dev/thermal/tz-by-name/smpl_gm/temp",
"/dev/thermal/tz-by-name/soc/temp",
"/dev/thermal/tz-by-name/vdroop1/temp",
"/dev/thermal/tz-by-name/vdroop2/temp",
"/dev/thermal/tz-by-name/ocp_gpu/temp",
"/dev/thermal/tz-by-name/ocp_tpu/temp",
"/dev/thermal/tz-by-name/soft_ocp_cpu2/temp",
"/dev/thermal/tz-by-name/soft_ocp_cpu1/temp",
"/dev/thermal/tz-by-name/battery/temp",
"/dev/thermal/tz-by-name/battery_cycle/temp",
"/sys/bus/iio/devices/iio:device0/lpf_power",
"/sys/bus/iio/devices/iio:device1/lpf_power",
"/dev/thermal/cdev-by-name/thermal-cpufreq-2/cur_state",
"/dev/thermal/cdev-by-name/thermal-cpufreq-1/cur_state",
"/dev/thermal/cdev-by-name/thermal-gpufreq-0/cur_state",
"/dev/thermal/cdev-by-name/tpu_cooling/cur_state",
"/dev/thermal/cdev-by-name/CAM/cur_state",
"/dev/thermal/cdev-by-name/DISP/cur_state",
"/dev/thermal/cdev-by-name/gxp-cooling/cur_state",
"/sys/class/power_supply/battery/voltage_now",
"/sys/class/power_supply/battery/current_now",
},
.FilteredZones = {
"batoilo",
"vdroop1",
"vdroop2",
"smpl_gm",
},
.SystemName = {
"batoilo", "smpl_gm", "soc", "vdroop1", "vdroop2", "ocp_gpu",
"ocp_tpu", "soft_ocp_cpu2", "soft_ocp_cpu1", "battery", "battery_cycle",
"main", "sub", "CPU2", "CPU1", "GPU", "TPU", "CAM", "DISP", "NPU",
"voltage_now", "current_now",
},
.LogFilePath = "/data/vendor/mitigation/thismeal.txt",
.TimestampFormat = "%Y-%m-%d %H:%M:%S",
};
const struct MitigationConfig::EventThreadConfig eventThreadCfg = {
.NumericSysfsStatPaths = {
{"cpu0_freq", "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"},
{"cpu1_freq", "/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq"},
{"cpu2_freq", "/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq"},
{"battery_temp", "/dev/thermal/tz-by-name/battery/temp"},
{"battery_cycle", "/dev/thermal/tz-by-name/battery_cycle/temp"},
{"voltage_now", "/sys/class/power_supply/battery/voltage_now"},
{"current_now", "/sys/class/power_supply/battery/current_now"},
},
.TriggeredIdxPath = "/sys/devices/virtual/pmic/mitigation/br_stats/triggered_idx",
.triggeredStatePath[android::hardware::google::pixel::UVLO1] =
"/sys/devices/virtual/pmic/mitigation/triggered_state/uvlo1_triggered",
.triggeredStatePath[android::hardware::google::pixel::UVLO2] =
"/sys/devices/virtual/pmic/mitigation/triggered_state/uvlo2_triggered",
.triggeredStatePath[android::hardware::google::pixel::OILO1] =
"/sys/devices/virtual/pmic/mitigation/triggered_state/oilo1_triggered",
.triggeredStatePath[android::hardware::google::pixel::OILO2] =
"/sys/devices/virtual/pmic/mitigation/triggered_state/oilo2_triggered",
.triggeredStatePath[android::hardware::google::pixel::SMPL] =
"/sys/devices/virtual/pmic/mitigation/triggered_state/smpl_triggered",
.BrownoutStatsPath = "/sys/devices/virtual/pmic/mitigation/br_stats/stats",
.StoringPath = "/data/vendor/mitigation/thismeal.bin",
.ParsedThismealPath = "/data/vendor/mitigation/thismeal.txt",
.ParsedLastmealPath = "/data/vendor/mitigation/lastmeal.txt",
.ParsedLastmealCSVPath = "/data/vendor/mitigation/lastmeal.csv",
.FvpStatsPath = "/sys/devices/platform/acpm_stats/fvp_stats",
.PmicCommon = {
/* Main Pmic */
{
.OdpmDir = "/sys/bus/iio/devices/iio:device0",
.OdpmEnabledRailsPath = "/sys/bus/iio/devices/iio:device0/enabled_rails",
.PmicNamePath = "/sys/bus/iio/devices/iio:device0/name",
},
/* Sub Pmic */
{
.OdpmDir = "/sys/bus/iio/devices/iio:device1",
.OdpmEnabledRailsPath = "/sys/bus/iio/devices/iio:device1/enabled_rails",
.PmicNamePath = "/sys/bus/iio/devices/iio:device1/name",
},
},
.PlatformSpecific = {
.NumericSysfsStatPaths = {
{
.name = "battery_soc",
.paths = {
"/sys/class/power_supply/max77759fg/capacity",
"/sys/class/power_supply/max77779fg/capacity",
},
},
{
.name = "gpu_freq",
.paths = {
"/sys/devices/platform/1c500000.mali/cur_freq",
"/sys/devices/platform/28000000.mali/cur_freq",
"/sys/devices/platform/1f000000.mali/cur_freq",
},
},
},
},
};
const char kReadyFilePath[] = "/sys/devices/virtual/pmic/mitigation/instruction/ready";
const char kReadyProperty[] = "vendor.brownout.mitigation.ready";
const char kLastMealPath[] = "/data/vendor/mitigation/lastmeal.txt";
const char kBRRequestedProperty[] = "vendor.brownout_reason";
const char kLastMealProperty[] = "vendor.brownout.br.feasible";
const std::regex kTimestampRegex("^\\S+\\s[0-9]+:[0-9]+:[0-9]+\\S+$");
int main(int argc, char **argv) {
batteryMitigationService = new BatteryMitigationService(eventThreadCfg);
if (!batteryMitigationService) {
return 0;
}
bool brownoutStatsBinarySupported = batteryMitigationService->isBrownoutStatsBinarySupported();
if (argc == 2) {
if(strcmp(argv[1], "-d") == 0 &&
brownoutStatsBinarySupported) {
/* Create thismeal.txt from thismeal.bin */
batteryMitigationService->genParsedMeal(eventThreadCfg.ParsedThismealPath);
}
return 0;
}
setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_AUDIO);
auto batteryMitigationStartTime = std::chrono::system_clock::now();
ABinderProcess_setThreadPoolMaxThreadCount(1);
ABinderProcess_startThreadPool();
bool mitigationLogTimeValid;
std::string reason = android::base::GetProperty(kBRRequestedProperty, "");
if (brownoutStatsBinarySupported) {
/* Create lastmeal.txt if the dump time in thismeal.bin are valid */
mitigationLogTimeValid = batteryMitigationService->isTimeValid(eventThreadCfg.StoringPath,
batteryMitigationStartTime);
if (!reason.empty() && mitigationLogTimeValid &&
batteryMitigationService->genParsedMeal(eventThreadCfg.ParsedLastmealPath) &&
batteryMitigationService->genLastmealCSV(eventThreadCfg.ParsedLastmealCSVPath)) {
android::base::SetProperty(kLastMealProperty, "1");
}
} else{
bmSp = new BatteryMitigation(cfg);
if (!bmSp) {
return 0;
}
mitigationLogTimeValid = bmSp->isMitigationLogTimeValid(batteryMitigationStartTime,
cfg.LogFilePath,
cfg.TimestampFormat,
kTimestampRegex);
if (!reason.empty() && mitigationLogTimeValid) {
std::ifstream src(cfg.LogFilePath, std::ios::in);
std::ofstream dst(kLastMealPath, std::ios::out);
dst << src.rdbuf();
android::base::SetProperty(kLastMealProperty, "1");
}
}
bool isBatteryMitigationReady = false;
std::string ready_str;
int val = 0;
for (int i = 0; i < COUNT_LIMIT; i++) {
if (!android::base::ReadFileToString(kReadyFilePath, &ready_str)) {
continue;
}
ready_str = android::base::Trim(ready_str);
if (!android::base::ParseInt(ready_str, &val)) {
continue;
}
if (val == 1) {
isBatteryMitigationReady = true;
break;
}
}
if (isBatteryMitigationReady) {
android::base::SetProperty(kReadyProperty, "1");
}
if (isBatteryMitigationReady && brownoutStatsBinarySupported) {
/* Start BrownoutEventThread to poll brownout event from kernel */
batteryMitigationService->startBrownoutEventThread();
}
while (true) {
pause();
}
return 0;
}

View File

@ -1,96 +0,0 @@
on property:vendor.thermal.link_ready=1
mkdir /data/vendor/mitigation 0755 system system
chown system system /data/vendor/mitigation
start vendor.battery_mitigation
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,if && property:sys.boot.reason=reboot,uvlo,pmic,if
setprop vendor.brownout_reason "uvlo,pmic,if"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,pmic,if && property:sys.boot.reason=reboot,ocp,pmic,if
setprop vendor.brownout_reason "ocp,pmic,if"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,main && property:sys.boot.reason=reboot,uvlo,pmic,main
setprop vendor.brownout_reason "uvlo,pmic,main"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,sub && property:sys.boot.reason=reboot,uvlo,pmic,sub
setprop vendor.brownout_reason "uvlo,pmic,sub"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK1M && property:sys.boot.reason=reboot,ocp,buck1m
setprop vendor.brownout_reason "ocp,buck1m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK2M && property:sys.boot.reason=reboot,ocp,buck2m
setprop vendor.brownout_reason "ocp,buck2m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK3M && property:sys.boot.reason=reboot,ocp,buck3m
setprop vendor.brownout_reason "ocp,buck3m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK4M && property:sys.boot.reason=reboot,ocp,buck4m
setprop vendor.brownout_reason "ocp,buck4m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK5M && property:sys.boot.reason=reboot,ocp,buck5m
setprop vendor.brownout_reason "ocp,buck5m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK6M && property:sys.boot.reason=reboot,ocp,buck6m
setprop vendor.brownout_reason "ocp,buck6m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK7M && property:sys.boot.reason=reboot,ocp,buck7m
setprop vendor.brownout_reason "ocp,buck7m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK8M && property:sys.boot.reason=reboot,ocp,buck8m
setprop vendor.brownout_reason "ocp,buck8m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK9M && property:sys.boot.reason=reboot,ocp,buck9m
setprop vendor.brownout_reason "ocp,buck9m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK10M && property:sys.boot.reason=reboot,ocp,buck10m
setprop vendor.brownout_reason "ocp,buck10m"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK1S && property:sys.boot.reason=reboot,ocp,buck1s
setprop vendor.brownout_reason "ocp,buck1s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK2S && property:sys.boot.reason=reboot,ocp,buck2s
setprop vendor.brownout_reason "ocp,buck2s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK3S && property:sys.boot.reason=reboot,ocp,buck3s
setprop vendor.brownout_reason "ocp,buck3s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK4S && property:sys.boot.reason=reboot,ocp,buck4s
setprop vendor.brownout_reason "ocp,buck4s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK5S && property:sys.boot.reason=reboot,ocp,buck5s
setprop vendor.brownout_reason "ocp,buck5s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK6S && property:sys.boot.reason=reboot,ocp,buck6s
setprop vendor.brownout_reason "ocp,buck6s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK7S && property:sys.boot.reason=reboot,ocp,buck7s
setprop vendor.brownout_reason "ocp,buck7s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK8S && property:sys.boot.reason=reboot,ocp,buck8s
setprop vendor.brownout_reason "ocp,buck8s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK9S && property:sys.boot.reason=reboot,ocp,buck9s
setprop vendor.brownout_reason "ocp,buck9s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCK10S && property:sys.boot.reason=reboot,ocp,buck10s
setprop vendor.brownout_reason "ocp,buck10s"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKDS && property:sys.boot.reason=reboot,ocp,buckds
setprop vendor.brownout_reason "ocp,buckds"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKAS && property:sys.boot.reason=reboot,ocp,buckas
setprop vendor.brownout_reason "ocp,buckas"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKCS && property:sys.boot.reason=reboot,ocp,buckcs
setprop vendor.brownout_reason "ocp,buckcs"
on property:vendor.thermal.link_ready=1 && property:ro.boot.bootreason=reboot,ocp,BUCKBS && property:sys.boot.reason=reboot,ocp,buckbs
setprop vendor.brownout_reason "ocp,buckbs"
on property:vendor.brownout.br.feasible=1
chown system system data/vendor/mitigation/lastmeal.txt
service vendor.battery_mitigation /vendor/bin/hw/battery_mitigation
user system
group system
capabilities WAKE_ALARM BLOCK_SUSPEND

View File

@ -7,7 +7,17 @@ PRODUCT_PACKAGES += BrownoutDetection
endif endif
endif endif
ifeq ($(RELEASE_PIXEL_AIDL_BATTERY_MITIGATION_HAL), true)
PRODUCT_PROPERTY_OVERRIDES += \
vendor.battery_mitigation.aidl.enable=true
endif
PRODUCT_SOONG_NAMESPACES += device/google/gs-common/battery_mitigation \
vendor/google/battery_mitigation
PRODUCT_PACKAGES += vendor.google.battery_mitigation-default
PRODUCT_PACKAGES += vendor.google.battery_mitigation.service_static
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/battery_mitigation/compatibility_matrix.xml
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/vendor BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/vendor
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/system_ext/private SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/system_ext/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/system_ext/public SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/battery_mitigation/sepolicy/system_ext/public
PRODUCT_SOONG_NAMESPACES += device/google/gs-common/battery_mitigation

View File

@ -0,0 +1,10 @@
<compatibility-matrix version="1.0" type="framework">
<hal format="aidl" optional="true">
<name>vendor.google.battery_mitigation</name>
<version>1</version>
<interface>
<name>IBatteryMitigation</name>
<instance>default</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@ -19,7 +19,7 @@ r_dir_file(battery_mitigation, thermal_link_device)
r_dir_file(battery_mitigation, sysfs_odpm) r_dir_file(battery_mitigation, sysfs_odpm)
r_dir_file(battery_mitigation, sysfs_power_stats) r_dir_file(battery_mitigation, sysfs_power_stats)
allow battery_mitigation sysfs_bcl:dir r_dir_perms; allow battery_mitigation sysfs_bcl:dir r_dir_perms;
allow battery_mitigation sysfs_bcl:file r_file_perms; allow battery_mitigation sysfs_bcl:file rw_file_perms;
allow battery_mitigation sysfs_bcl:lnk_file r_file_perms; allow battery_mitigation sysfs_bcl:lnk_file r_file_perms;
allow battery_mitigation sysfs_thermal:lnk_file r_file_perms; allow battery_mitigation sysfs_thermal:lnk_file r_file_perms;
allow battery_mitigation mitigation_vendor_data_file:dir rw_dir_perms; allow battery_mitigation mitigation_vendor_data_file:dir rw_dir_perms;
@ -29,3 +29,5 @@ allow battery_mitigation mitigation_vendor_data_file:file create_file_perms;
binder_use(battery_mitigation) binder_use(battery_mitigation)
# Allow battery_mitigation to listen brownout event by epoll_wait # Allow battery_mitigation to listen brownout event by epoll_wait
wakelock_use(battery_mitigation) wakelock_use(battery_mitigation)
# Allow battery_mitigation to run aidl service
add_service(battery_mitigation, hal_battery_mitigation_service)

View File

@ -0,0 +1 @@
type hal_battery_mitigation_service, protected_service, hal_service_type, service_manager_type;

View File

@ -0,0 +1 @@
vendor.google.battery_mitigation.IBatteryMitigation/default u:object_r:hal_battery_mitigation_service:s0

View File

@ -21,8 +21,10 @@
#define BCMBT_SNOOP_LOG_DIRECTORY "/data/vendor/bluetooth" #define BCMBT_SNOOP_LOG_DIRECTORY "/data/vendor/bluetooth"
#define BCMBT_FW_LOG_DIRECTORY "/data/vendor/ssrdump/coredump" #define BCMBT_FW_LOG_DIRECTORY "/data/vendor/ssrdump/coredump"
#define BCMBT_SNOOP_LOG_PREFIX "btsnoop_hci_vnd" #define BCMBT_SNOOP_LOG_PREFIX "btsnoop_hci_vnd"
#define BCMBT_BACKUP_SNOOP_LOG_PREFIX "backup_btsnoop_hci_vnd"
#define BCMBT_FW_DUMP_LOG_PREFIX "coredump_bt_socdump_" #define BCMBT_FW_DUMP_LOG_PREFIX "coredump_bt_socdump_"
#define BCMBT_CHRE_DUMP_LOG_PREFIX "coredump_bt_chredump_" #define BCMBT_CHRE_DUMP_LOG_PREFIX "coredump_bt_chredump_"
#define BCMBT_HAL_DUMP_LOG_PREFIX "coredump_bt_"
#define BCMBT_ACTIVITY_LOG_PREFIX "bt_activity_" #define BCMBT_ACTIVITY_LOG_PREFIX "bt_activity_"
int main() { int main() {
@ -33,8 +35,10 @@ int main() {
} }
dumpLogs(BCMBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, BCMBT_SNOOP_LOG_PREFIX); dumpLogs(BCMBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, BCMBT_SNOOP_LOG_PREFIX);
dumpLogs(BCMBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, BCMBT_BACKUP_SNOOP_LOG_PREFIX);
dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_FW_DUMP_LOG_PREFIX); dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_FW_DUMP_LOG_PREFIX);
dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_CHRE_DUMP_LOG_PREFIX); dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_CHRE_DUMP_LOG_PREFIX);
dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_HAL_DUMP_LOG_PREFIX);
dumpLogs(BCMBT_ACTIVITY_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_ACTIVITY_LOG_PREFIX); dumpLogs(BCMBT_ACTIVITY_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_ACTIVITY_LOG_PREFIX);
return 0; return 0;
} }

5
betterbug/betterbug.mk Normal file
View File

@ -0,0 +1,5 @@
PRODUCT_PACKAGES += BetterBugStub
PRODUCT_PACKAGES_DEBUG += BetterBug
PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/betterbug/sepolicy/product/public
PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/betterbug/sepolicy/product/private

View File

@ -0,0 +1,15 @@
typeattribute better_bug_app coredomain;
app_domain(better_bug_app)
net_domain(better_bug_app)
allow better_bug_app shell_data_file:file read;
allow better_bug_app privapp_data_file:file execute;
allow better_bug_app app_api_service:service_manager find;
allow better_bug_app system_api_service:service_manager find;
allow better_bug_app mediaserver_service:service_manager find;
set_prop(better_bug_app, ctl_start_prop)
get_prop(better_bug_app, system_boot_reason_prop)

View File

@ -0,0 +1,2 @@
# BetterBug
user=_app isPrivApp=true name=com.google.android.apps.internal.betterbug domain=better_bug_app type=app_data_file levelFrom=all

View File

@ -0,0 +1 @@
type better_bug_app, domain;

View File

@ -45,6 +45,7 @@ int main() {
dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "high-drop-rate-"); dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "high-drop-rate-");
dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "watchdog-"); dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "watchdog-");
dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "camera-ended-"); dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "camera-ended-");
dumpLogs(kCameraLogDir.data(), cameraDestDir.c_str(), 5, "fatal-error-");
dumpLogs(kGraphStateDumpDir.data(), cameraDestDir.c_str(), 5, dumpLogs(kGraphStateDumpDir.data(), cameraDestDir.c_str(), 5,
"hal_graph_state_"); "hal_graph_state_");

View File

@ -1,12 +1,32 @@
typeattribute vendor_pcs_app coredomain; typeattribute vendor_pcs_app coredomain;
app_domain(vendor_pcs_app); app_domain(vendor_pcs_app);
net_domain(vendor_pcs_app);
bluetooth_domain(vendor_pcs_app);
allow vendor_pcs_app { allow vendor_pcs_app {
app_api_service app_api_service
audioserver_service audioserver_service
cameraserver_service cameraserver_service
drmserver_service
mediametrics_service mediametrics_service
mediaserver_service mediaserver_service
nfc_service
radio_service radio_service
}:service_manager find; }:service_manager find;
# Following allowances were replicated from priv_app
# Write to /cache.
allow vendor_pcs_app { cache_file cache_recovery_file }:dir create_dir_perms;
allow vendor_pcs_app { cache_file cache_recovery_file }:file create_file_perms;
# /cache is a symlink to /data/cache on some devices. Allow reading the link.
allow vendor_pcs_app cache_file:lnk_file r_file_perms;
# Access to /data/media.
allow vendor_pcs_app media_rw_data_file:dir create_dir_perms;
allow vendor_pcs_app media_rw_data_file:file create_file_perms;
# Access to /data/preloads
r_dir_file(vendor_pcs_app, preloads_data_file)
r_dir_file(vendor_pcs_app, preloads_media_file)

View File

@ -1,14 +1,17 @@
# Allow PCS to find the LyricConfigProvider service through ServiceManager. allow vendor_pcs_app {
allow vendor_pcs_app vendor_camera_lyricconfigprovider_service:service_manager find; vendor_camera_lyricconfigprovider_service
# Allow PCS to find the CameraIdRemapper service through ServiceManager. vendor_camera_cameraidremapper_service
allow vendor_pcs_app vendor_camera_cameraidremapper_service:service_manager find; edgetpu_app_service
}:service_manager find;
allow vendor_pcs_app hal_pixel_remote_camera_service:service_manager add; allow vendor_pcs_app hal_pixel_remote_camera_service:service_manager add;
binder_call(vendor_pcs_app, hal_pixel_remote_camera_service); binder_call(vendor_pcs_app, hal_pixel_remote_camera_service);
binder_call(vendor_pcs_app, hal_camera_default); binder_call(vendor_pcs_app, hal_camera_default);
# Allow interacting with EdgeTpu.
allow vendor_pcs_app edgetpu_device:chr_file { getattr read write ioctl map };
# Allow PCS to open socket connections for HTTP streaming support. # Allow PCS to open socket connections for HTTP streaming support.
allow vendor_pcs_app vendor_pcs_app:unpriv_socket_class_set create_socket_perms_no_ioctl; allow vendor_pcs_app vendor_pcs_app:unpriv_socket_class_set create_socket_perms_no_ioctl;
allow vendor_pcs_app fwmarkd_socket:sock_file write; allow vendor_pcs_app fwmarkd_socket:sock_file write;

5
chre/README.txt Normal file
View File

@ -0,0 +1,5 @@
This folder contains the common settings for CHRE shared by various platforms.
Dependencies among types can happen. For example, hal_contexthub_default
depends on sysfs_aoc at the moment. When setting up a device with CHRE
we should make sure rules of dependent types are included too.

2
chre/hal.mk Normal file
View File

@ -0,0 +1,2 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/chre/sepolicy/
PRODUCT_PACKAGES += android.hardware.contexthub-service.generic

View File

@ -0,0 +1 @@
/vendor/bin/hw/android\.hardware\.contexthub-service\.generic u:object_r:hal_contexthub_default_exec:s0

View File

@ -0,0 +1,37 @@
#
# Context hub multiclient HAL common selinux policies
#
# Permit communication with AoC
allow hal_contexthub_default aoc_device:chr_file rw_file_perms;
# Allow context hub HAL to determine AoC's current clock
allow hal_contexthub_default sysfs_aoc:dir search;
allow hal_contexthub_default sysfs_aoc_boottime:file r_file_perms;
# Allow context hub HAL to create thread to watch AOC's device
allow hal_contexthub_default device:dir r_dir_perms;
# Allow context hub HAL to use the USF low latency transport
usf_low_latency_transport(hal_contexthub_default)
# Allow context hub HAL to talk to the WiFi HAL
binder_call(hal_contexthub_default, hal_wifi_ext)
allow hal_contexthub_default hal_wifi_ext_service:service_manager find;
# Allow context hub HAL to talk to stats service
binder_call(hal_contexthub_default, stats_service_server)
allow hal_contexthub_default fwk_stats_service:service_manager find;
# Allow context hub HAL to write data to /data/vendor/chre/ directory
allow hal_contexthub_default chre_data_file:dir create_dir_perms;
allow hal_contexthub_default chre_data_file:file create_file_perms;
# Allow context hub HAL to use WakeLock
wakelock_use(hal_contexthub_default)
# Allow context hub HAL to block suspend, which is required to use EPOLLWAKEUP
allow hal_contexthub_default self:global_capability2_class_set block_suspend;
# Allow binder calls with clients
binder_call(hal_contexthub_default, hal_sensors_default)

View File

@ -0,0 +1 @@
vendor_internal_prop(vendor_chre_hal_prop)

View File

@ -0,0 +1 @@
vendor.chre.multiclient_hal u:object_r:vendor_chre_hal_prop:s0

View File

@ -0,0 +1 @@
set_prop(vendor_init, vendor_chre_hal_prop)

View File

@ -19,5 +19,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES_DEBUG += citadel_integration_tests \ PRODUCT_PACKAGES_DEBUG += citadel_integration_tests \
pwntest \ pwntest \
nugget_targeted_tests \ nugget_targeted_tests \
CitadelProvision CitadelProvision \
endif nugget_aidl_test_weaver
endif

View File

@ -1 +0,0 @@
PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/diagnosticstool/sepolicy

View File

@ -1,4 +0,0 @@
type diagnosticstool_app, domain;
app_domain(diagnosticstool_app)
allow diagnosticstool_app app_api_service:service_manager find;

View File

@ -1,2 +0,0 @@
# Diagnostics Tool
user=_app seinfo=platform name=com.google.android.apps.diagnosticstool domain=diagnosticstool_app isPrivApp=true levelFrom=user

View File

@ -15,7 +15,7 @@
/vendor/lib64/libmetrics_logger\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libmetrics_logger\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libedgetpu_util\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libedgetpu_util\.so u:object_r:same_process_hal_file:s0
# EdgeTPU runtime libraries # EdgeTPU runtime libraries
/vendor/lib64/com\.google\.edgetpu_app_service-V[1-2]-ndk\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/com\.google\.edgetpu_app_service-V[1-3]-ndk\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/com\.google\.edgetpu_vendor_service-V[1-2]-ndk\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/com\.google\.edgetpu_vendor_service-V[1-2]-ndk\.so u:object_r:same_process_hal_file:s0
# EdgeTPU data files # EdgeTPU data files

View File

@ -12,3 +12,7 @@ binder_call(hal_audio_default, edgetpu_app_server)
# Allow audio HAL to read tflite Darwinn delegate properties # Allow audio HAL to read tflite Darwinn delegate properties
get_prop(hal_audio_default, vendor_tflite_delegate_prop) get_prop(hal_audio_default, vendor_tflite_delegate_prop)
get_prop(hal_audio_default, vendor_edgetpu_runtime_prop)
# Allow DMA Buf access.
allow hal_audio_default dmabuf_system_heap_device:chr_file r_file_perms;

19
gps/lsi/s5400.mk Normal file
View File

@ -0,0 +1,19 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/lsi/sepolicy
PRODUCT_SOONG_NAMESPACES += \
vendor/samsung_slsi/gps/s5400
PRODUCT_PACKAGES += \
android.hardware.location.gps.prebuilt.xml \
gnssd \
android.hardware.gnss-service \
ca.pem \
gnss_check.sh \
kepler.bin
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_VENDOR_PROPERTIES += vendor.gps.aol.enabled=true
endif
# Enable Pixel GNSS HAL
include device/google/gs-common/gps/pixel/pixel_gnss_hal.mk

1
gps/lsi/sepolicy/file.te Normal file
View File

@ -0,0 +1 @@
type vendor_gps_file, file_type, data_file_type;

View File

@ -0,0 +1,12 @@
# GPS
/dev/gnss_ipc u:object_r:vendor_gnss_device:s0
/dev/gnss_boot u:object_r:vendor_gnss_device:s0
/dev/gnss_dump u:object_r:vendor_gnss_device:s0
/vendor/bin/hw/gnssd u:object_r:gnssd_exec:s0
/vendor/bin/hw/sctd u:object_r:sctd_exec:s0
/vendor/bin/hw/swcnd u:object_r:swcnd_exec:s0
/vendor/bin/hw/spad u:object_r:spad_exec:s0
/vendor/bin/hw/android.hardware.gnss-service u:object_r:hal_gnss_default_exec:s0
/vendor/bin/gnss_check\.sh u:object_r:gnss_check_exec:s0
# keep only one rule and use eGNSS one
# /data/vendor/gps(/.*)? u:object_r:vendor_gps_file:s0

View File

@ -0,0 +1,2 @@
# gps coredump node
genfscon sysfs /devices/platform/gnssif/coredump u:object_r:sysfs_gps:s0

View File

@ -0,0 +1,9 @@
type gnss_check, domain;
type gnss_check_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(gnss_check);
allow gnss_check vendor_toolbox_exec:file { execute_no_trans };
set_prop(gnss_check, ctl_stop_prop);
set_prop(gnss_check, ctl_start_prop);

33
gps/lsi/sepolicy/gnssd.te Normal file
View File

@ -0,0 +1,33 @@
type gnssd, domain;
type gnssd_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(gnssd);
# Allow gnssd to access rild
binder_call(gnssd, rild);
binder_call(gnssd, hwservicemanager)
allow gnssd hal_exynos_rild_hwservice:hwservice_manager find;
allow gnssd radio_device:chr_file rw_file_perms;
# Allow gnssd to acess gnss device
allow gnssd vendor_gnss_device:chr_file rw_file_perms;
allow gnssd vendor_gps_file:dir create_dir_perms;
allow gnssd vendor_gps_file:file create_file_perms;
allow gnssd vendor_gps_file:fifo_file create_file_perms;
# Allow gnssd to obtain wakelock
wakelock_use(gnssd)
# Allow a base set of permissions required for network access.
net_domain(gnssd);
# Allow gnssd to get boot complete
get_prop(gnssd, bootanim_system_prop)
allow gnssd sysfs_soc:file r_file_perms;
allow gnssd sysfs_gps:file rw_file_perms;
# Allow gnssd to set GPS property
set_prop(gnssd, vendor_gps_prop)
# Read RIL property
get_prop(gnssd, vendor_rild_prop)

View File

@ -0,0 +1,13 @@
allow hal_gnss_default fwk_sensor_service:service_manager find;
allow hal_gnss_default gnssd:unix_stream_socket connectto;
allow hal_gnss_default vendor_gps_file:dir create_dir_perms;
allow hal_gnss_default vendor_gps_file:file create_file_perms;
allow hal_gnss_default vendor_gps_file:fifo_file create_file_perms;
allow hal_gnss_default sysfs_gps:file rw_file_perms;
binder_call(hal_gnss_default, gnssd);
#Read GPS property
get_prop(hal_gnss_default, vendor_gps_prop)
#IPC between pixel and vendor HAL
binder_call(hal_gnss_default, hal_gnss_pixel)

1
gps/lsi/sepolicy/rild.te Normal file
View File

@ -0,0 +1 @@
binder_call(rild, gnssd)

3
gps/lsi/sepolicy/sctd.te Normal file
View File

@ -0,0 +1,3 @@
type sctd, domain;
type sctd_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(sctd);

3
gps/lsi/sepolicy/spad.te Normal file
View File

@ -0,0 +1,3 @@
type spad, domain;
type spad_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(spad);

View File

@ -0,0 +1,3 @@
type swcnd, domain;
type swcnd_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(swcnd);

View File

@ -0,0 +1,2 @@
# gps vendor property
set_prop(vendor_init, vendor_gps_prop)

View File

@ -0,0 +1,10 @@
<compatibility-matrix version="1.0" type="framework" level="8">
<hal format="aidl" optional="true">
<name>android.hardware.gnss</name>
<version>3</version>
<interface>
<name>IGnss</name>
<instance>vendor</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@ -0,0 +1,15 @@
# Include this file to enable Pixel GNSS HAL
$(call soong_config_set, pixel_gnss, enable_pixel_gnss_aidl_service, true)
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/pixel/sepolicy
PRODUCT_PACKAGES += \
android.hardware.gnss-service.pixel
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.gps.hal.service.name=vendor
# Compatibility matrix
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += \
device/google/gs-common/gps/pixel/device_framework_matrix_product.xml

View File

@ -0,0 +1 @@
type sysfs_modem_state, sysfs_type, fs_type;

View File

@ -0,0 +1,2 @@
/vendor/bin/hw/android\.hardware\.gnss-service\.pixel u:object_r:hal_gnss_pixel_exec:s0

View File

@ -0,0 +1,2 @@
# modem state node
genfscon sysfs /devices/platform/cpif/modem_state u:object_r:sysfs_modem_state:s0

View File

@ -0,0 +1,14 @@
type hal_gnss_pixel, domain;
hal_server_domain(hal_gnss_pixel, hal_gnss)
type hal_gnss_pixel_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_gnss_pixel)
#IPC between pixel and vendor HAL
binder_call(hal_gnss_pixel, hal_gnss_default)
#Read modem state
allow hal_gnss_pixel sysfs_modem_state:file r_file_perms;
#Toggle coredump node
allow hal_gnss_pixel sysfs_gps:file rw_file_perms;

View File

@ -0,0 +1 @@
android.hardware.gnss.IGnss/vendor u:object_r:hal_gnss_service:s0

View File

@ -1,3 +1,16 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gpu/sepolicy BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gpu/sepolicy
PRODUCT_PACKAGES += gpu_probe PRODUCT_PACKAGES += gpu_probe
USE_MAPPER5 := false
PRODUCT_PACKAGES += pixel_gralloc_allocator
PRODUCT_PACKAGES += pixel_gralloc_mapper
ifeq ($(USE_MAPPER5), true)
$(call soong_config_set,arm_gralloc,mapper_version,mapper5)
$(call soong_config_set,aion_buffer,mapper_version,mapper5)
else
$(call soong_config_set,arm_gralloc,mapper_version,mapper4)
$(call soong_config_set,aion_buffer,mapper_version,mapper4)
endif

View File

@ -0,0 +1,2 @@
# Allow apps to read gxp properties
get_prop(appdomain, vendor_gxp_prop)

View File

@ -0,0 +1,6 @@
# Allow Edgetpu App Service to access the GXP device and read GXP properties.
allow edgetpu_app_server gxp_device:chr_file rw_file_perms;
get_prop(edgetpu_app_server, vendor_gxp_prop)
# Allows Edgetpu App Service to search for GXP firmware file.
allow edgetpu_app_server vendor_fw_file:dir search;

3
gxp/sepolicy/priv_app.te Normal file
View File

@ -0,0 +1,3 @@
# Allows privileged applications to access the GXP device, except open,
# which is guarded by the EdgeTPU service.
allow priv_app gxp_device:chr_file { getattr read write ioctl map };

View File

@ -0,0 +1,3 @@
# Allows applications to access the GXP device, except open,
# which is guarded by the EdgeTPU service.
allow untrusted_app_all gxp_device:chr_file { getattr read write ioctl map };

View File

@ -0,0 +1,20 @@
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_binary {
name: "dump_gyotaku",
srcs: ["dump_gyotaku.cpp"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
shared_libs: [
"libbase",
"libdump",
"liblog",
],
vendor: true,
relative_install_path: "dump",
}

View File

@ -0,0 +1,35 @@
/*
* Copyright 2024 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.
*/
#include <unistd.h>
#include <dump/pixel_dump.h>
#include <android-base/file.h>
#define GYOTAKU_DIRECTORY "/data/vendor/gyotaku/andlog"
#define GYOTAKU_ANDROID_LOG_PREFIX "android_"
#define maxFileLogsNumber 30
int main() {
std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "gyotaku");
if (mkdir(outputDir.c_str(), 0700) == -1) {
printf("Unable to create folder: %s\n", outputDir.c_str());
return 0;
}
dumpLogs(GYOTAKU_DIRECTORY, outputDir.c_str(), maxFileLogsNumber, GYOTAKU_ANDROID_LOG_PREFIX);
return 0;
}

View File

@ -0,0 +1,11 @@
pixel_bugreport(dump_gyotaku)
userdebug_or_eng(`
# For access and collecting logs into vendor radio type folder.
allow dump_gyotaku radio_vendor_data_file:dir create_dir_perms;
allow dump_gyotaku radio_vendor_data_file:file create_file_perms;
# For access /data/vendor/ folder.
allow dump_gyotaku gyotaku_vendor_data_file:dir create_dir_perms;
allow dump_gyotaku gyotaku_vendor_data_file:file create_file_perms;
')

5
gyotaku_app/dump/file.te Normal file
View File

@ -0,0 +1,5 @@
# For /data/vendor use
type gyotaku_vendor_data_file, file_type, data_file_type;
userdebug_or_eng(`
typeattribute gyotaku_vendor_data_file mlstrustedobject;
')

View File

@ -0,0 +1,4 @@
/data/vendor/gyotaku(/.*)? u:object_r:gyotaku_vendor_data_file:s0
# Pixel dump for Gyotaku
/vendor/bin/dump/dump_gyotaku u:object_r:dump_gyotaku_exec:s0

View File

@ -0,0 +1,5 @@
userdebug_or_eng(`
# For access /data/vendor/gyotaku folder
allow gyotaku_app gyotaku_vendor_data_file:dir create_dir_perms;
allow gyotaku_app gyotaku_vendor_data_file:file create_file_perms;
')

View File

@ -4,5 +4,11 @@ ifneq ($(TARGET_BUILD_VARIANT), user)
Gyotaku Gyotaku
BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/sepolicy/ BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/sepolicy/
# Pixel 5a (barbet) does not support Pixel dump
ifneq ($(TARGET_PRODUCT), barbet)
PRODUCT_PACKAGES_DEBUG += dump_gyotaku
BOARD_SEPOLICY_DIRS += device/google/gs-common/gyotaku_app/dump
endif
endif endif
endif endif

View File

@ -0,0 +1 @@
type eco_service, service_manager_type;

View File

@ -1 +0,0 @@
type eco_service, vndservice_manager_type;

View File

@ -5,6 +5,7 @@ init_daemon_domain(mediacodec_samsung)
hal_server_domain(mediacodec_samsung, hal_codec2) hal_server_domain(mediacodec_samsung, hal_codec2)
add_service(mediacodec_samsung, eco_service) add_service(mediacodec_samsung, eco_service)
binder_use(mediacodec_samsung)
vndbinder_use(mediacodec_samsung) vndbinder_use(mediacodec_samsung)
allow mediacodec_samsung video_device:chr_file rw_file_perms; allow mediacodec_samsung video_device:chr_file rw_file_perms;

View File

@ -1,2 +1,8 @@
include build/make/target/product/fullmte.mk include build/make/target/product/fullmte.mk
PRODUCT_MODULE_BUILD_FROM_SOURCE := true
BOARD_KERNEL_CMDLINE += bootloader.pixel.MTE_FORCE_ON BOARD_KERNEL_CMDLINE += bootloader.pixel.MTE_FORCE_ON
# TODO(b/324412910): Remove this when the stack-buffer-overflow is fixed.
PRODUCT_PRODUCT_PROPERTIES += \
arm64.memtag.process.android.hardware.composer.hwc3-service.pixel=off

View File

@ -62,6 +62,14 @@ AdaptiveDvfsStateResidencyDataProvider::AdaptiveDvfsStateResidencyDataProvider(
} }
} }
// Cpufreq data is sorted in ascending order, but power stats are sorted
// in descending order. Reverse sorting to maintain consistency with
// other power stats.
if (states.size() > 1 &&
std::atoll(states[0].second.c_str()) < std::atoll(states[1].second.c_str())) {
std::reverse(states.begin(), states.end());
}
mPowerEntities.push_back({powerEntities[i].first, std::move(states)}); mPowerEntities.push_back({powerEntities[i].first, std::move(states)});
} }

View File

@ -0,0 +1,169 @@
/*
* Copyright (C) 2023 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.
*/
#include "DisplayMrrStateResidencyDataProvider.h"
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-base/strings.h>
using android::base::ParseInt;
using android::base::ParseUint;
using android::base::Split;
using android::base::Trim;
static const std::string TIME_IN_STATE = "time_in_state";
static const std::string AVAILABLE_STATE = "available_disp_stats";
static const std::vector<std::string> DISP_STATE = { "On", "HBM", "LP", "Off" };
namespace aidl {
namespace android {
namespace hardware {
namespace power {
namespace stats {
DisplayMrrStateResidencyDataProvider::DisplayMrrStateResidencyDataProvider(
const std::string& name, const std::string& path) : mName(name), mPath(path) {
mConfigs = std::vector<Config>();
std::string statePath = mPath + AVAILABLE_STATE;
std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(statePath.c_str(), "r"), fclose);
if (fp) {
char *line = nullptr;
size_t len = 0;
Config config = { .state = 0, .resX = 0, .resY = 0, .rr = 0 };
while (getline(&line, &len, fp.get()) != -1) {
if (parseAvailableState(line, &config)) {
mConfigs.push_back(config);
} else {
PLOG(ERROR) << "Failed to parse display config for [" << std::string(line)
<< "] from " << statePath;
mConfigs.clear();
break;
}
}
free(line);
} else {
PLOG(ERROR) << "Failed to open file " << statePath;
}
}
bool DisplayMrrStateResidencyDataProvider::parseConfig(
char const *line, Config *config, uint64_t *duration) {
std::vector<std::string> parts = Split(line, " ");
if (duration == nullptr) {
if (parts.size() != 4) return false;
} else {
if (parts.size() != 5) return false;
if (!ParseUint(Trim(parts[4]), duration)) return false;
}
if (!ParseInt(Trim(parts[0]), &config->state)) return false;
if (!ParseInt(Trim(parts[1]), &config->resX)) return false;
if (!ParseInt(Trim(parts[2]), &config->resY)) return false;
if (!ParseInt(Trim(parts[3]), &config->rr)) return false;
return true;
}
bool DisplayMrrStateResidencyDataProvider::parseAvailableState(
char const *line, Config *config) {
return parseConfig(line, config, nullptr);
}
bool DisplayMrrStateResidencyDataProvider::parseTimeInState(
char const *line, Config *config, uint64_t *duration) {
return parseConfig(line, config, duration);
}
bool DisplayMrrStateResidencyDataProvider::getStateResidencies(
std::unordered_map<std::string, std::vector<StateResidency>> *residencies) {
if (mConfigs.empty()) {
LOG(ERROR) << "Display MRR state list is empty!";
return false;
}
std::string path = mPath + TIME_IN_STATE;
std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(path.c_str(), "r"), fclose);
if (!fp) {
PLOG(ERROR) << "Failed to open file " << path;
return false;
}
std::vector<StateResidency> stateResidencies;
for (int i = 0; i < mConfigs.size(); i++) {
StateResidency s = {.id = i, .totalTimeInStateMs = 0};
stateResidencies.push_back(s);
}
char *line = nullptr;
size_t len = 0;
Config config = { .state = 0, .resX = 0, .resY = 0, .rr = 0 };
uint64_t duration;
std::vector<Config>::const_iterator found;
while (getline(&line, &len, fp.get()) != -1) {
if (parseTimeInState(line, &config, &duration)) {
found = std::find(mConfigs.begin(), mConfigs.end(), config);
if (found != mConfigs.end()) {
stateResidencies[found - mConfigs.begin()].totalTimeInStateMs = duration;
} else {
LOG(ERROR) << "Failed to find config for [" << std::string(line)
<< "] in display MRR state list";
}
} else {
LOG(ERROR) << "Failed to parse state and duration from [" << std::string(line) << "]";
free(line);
return false;
}
}
residencies->emplace(mName, stateResidencies);
free(line);
return true;
}
std::unordered_map<std::string, std::vector<State>> DisplayMrrStateResidencyDataProvider::getInfo()
{
int32_t dispId;
std::string name;
std::vector<State> states;
for (int32_t id = 0; id < mConfigs.size(); id++) {
dispId = mConfigs[id].state;
if (dispId >= DISP_STATE.size()) {
LOG(ERROR) << "Display state id " << dispId << " is out of bound";
return {};
}
name = DISP_STATE[dispId];
if (dispId != DISP_STATE.size() - 1) {
name += ": " + std::to_string(mConfigs[id].resX) +
"x" + std::to_string(mConfigs[id].resY) +
"@" + std::to_string(mConfigs[id].rr);
}
State s = { .id = id, .name = name };
states.push_back(s);
}
return {{ mName, states }};
}
} // namespace stats
} // namespace power
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@ -0,0 +1,68 @@
/*
* Copyright (C) 2023 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.
*/
#pragma once
#include <PowerStatsAidl.h>
namespace aidl {
namespace android {
namespace hardware {
namespace power {
namespace stats {
class DisplayMrrStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
public:
DisplayMrrStateResidencyDataProvider(const std::string& name, const std::string& path);
~DisplayMrrStateResidencyDataProvider() = default;
/*
* See IStateResidencyDataProvider::getStateResidencies
*/
bool getStateResidencies(
std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
/*
* See IStateResidencyDataProvider::getInfo
*/
std::unordered_map<std::string, std::vector<State>> getInfo() override;
private:
struct Config {
int32_t state; // Display state (On, HBM, LP, Off)
int32_t resX; // Resolution X
int32_t resY; // Resolution Y
int32_t rr; // Refresh rate
bool operator==(const Config& r) const {
return state == r.state && resX == r.resX && resY == r.resY && rr == r.rr;
}
};
bool parseConfig(char const *line, Config *config, uint64_t *duration);
bool parseAvailableState(char const *line, Config *config);
bool parseTimeInState(char const *line, Config *config, uint64_t *duration);
bool loadAvailableState();
const std::string mName;
const std::string mPath;
std::vector<Config> mConfigs;
};
} // namespace stats
} // namespace power
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@ -34,6 +34,8 @@ int main() {
if (tcpdumpEnabled) { if (tcpdumpEnabled) {
dumpLogs(TCPDUMP_LOG_DIRECTORY, BUGREPORT_PACKING_DIR, ::android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX); dumpLogs(TCPDUMP_LOG_DIRECTORY, BUGREPORT_PACKING_DIR, ::android::base::GetIntProperty(TCPDUMP_NUMBER_BUGREPORT, 5), TCPDUMP_LOG_PREFIX);
} }
copyFile("/data/vendor/radio/adum_log", "/data/vendor/radio/logs/always-on/all_logs/adum_log");
copyFile("/data/vendor/radio/adum_log_old", "/data/vendor/radio/logs/always-on/all_logs/adum_log_old");
copyFile("/data/vendor/radio/metrics_data", "/data/vendor/radio/logs/always-on/all_logs/metrics_data"); copyFile("/data/vendor/radio/metrics_data", "/data/vendor/radio/logs/always-on/all_logs/metrics_data");
copyFile("/data/vendor/radio/omadm_logs.txt", "/data/vendor/radio/logs/always-on/all_logs/omadm_logs.txt"); copyFile("/data/vendor/radio/omadm_logs.txt", "/data/vendor/radio/logs/always-on/all_logs/omadm_logs.txt");
copyFile("/data/vendor/radio/power_anomaly_data.txt", "/data/vendor/radio/logs/always-on/all_logs/power_anomaly_data.txt"); copyFile("/data/vendor/radio/power_anomaly_data.txt", "/data/vendor/radio/logs/always-on/all_logs/power_anomaly_data.txt");

View File

@ -60,6 +60,14 @@ allow hal_sensors_default fwk_stats_service:service_manager find;
# Allow access to CHRE socket to connect to nanoapps. # Allow access to CHRE socket to connect to nanoapps.
unix_socket_connect(hal_sensors_default, chre, chre) unix_socket_connect(hal_sensors_default, chre, chre)
## TODO(b/248615564): Remove above rule after CHRE multiclient HAL is launched.
unix_socket_connect(hal_sensors_default, chre, hal_contexthub_default)
# Allow access to CHRE multiclient HAL.
get_prop(hal_sensors_default, vendor_chre_hal_prop)
binder_call(hal_sensors_default, hal_contexthub_default)
allow hal_sensors_default hal_contexthub_service:service_manager find;
# Allow access to the power supply files for MagCC. # Allow access to the power supply files for MagCC.
r_dir_file(hal_sensors_default, sysfs_batteryinfo) r_dir_file(hal_sensors_default, sysfs_batteryinfo)

View File

@ -1,3 +1,60 @@
on property:ro.build.type=userdebug on property:ro.build.type=userdebug
write /dev/sys/block/bootdevice/pixel/enable_pixel_ufs_logging 1 write /dev/sys/block/bootdevice/pixel/enable_pixel_ufs_logging 1
chown system /dev/sg3 chown system /dev/sg3
on default_storage_mode
# F2FS
write /dev/sys/fs/by-name/userdata/data_io_flag 8
write /dev/sys/fs/by-name/userdata/node_io_flag 8
# Block
write /dev/sys/block/by-name/rootdisk/queue/iostats 1
write /dev/sys/block/by-name/rootdisk/queue/nr_requests 128
write /dev/sys/block/by-name/rootdisk/queue/rq_affinity 2
# UFS
write /dev/sys/block/bootdevice/clkgate_enable 1
on init
# Symlink /dev/sys/block/bootdevice
wait /dev/block/platform/${ro.boot.boot_devices}
symlink /dev/block/platform/${ro.boot.boot_devices} /dev/block/bootdevice
symlink /sys/devices/platform/${ro.boot.boot_devices} /dev/sys/block/bootdevice
# F2FS
write /dev/sys/fs/by-name/userdata/data_io_flag 56
write /dev/sys/fs/by-name/userdata/node_io_flag 56
# Block
write /dev/sys/block/by-name/rootdisk/queue/iostats 0
write /sys/sys/block/by-name/rootdisk/queue/nr_requests 256
# UFS
write /dev/sys/block/bootdevice/clkgate_enable 0
on property:sys.boot_completed=1
# Health Storage HAL
chown system system /dev/sys/block/bootdevice/manual_gc
# Pixelstats
chown system system /dev/sys/block/bootdevice/slowio_read_cnt
chown system system /dev/sys/block/bootdevice/slowio_sync_cnt
chown system system /dev/sys/block/bootdevice/slowio_unmap_cnt
chown system system /dev/sys/block/bootdevice/slowio_write_cnt
chown system system /dev/sys/fs/by-name/userdata/committed_atomic_block
chown system system /dev/sys/fs/by-name/userdata/compr_new_inode
chown system system /dev/sys/fs/by-name/userdata/compr_saved_block
chown system system /dev/sys/fs/by-name/userdata/compr_written_block
chown system system /dev/sys/fs/by-name/userdata/gc_reclaimed_segments
chown system system /dev/sys/fs/by-name/userdata/gc_segment_mode
chown system system /dev/sys/fs/by-name/userdata/peak_atomic_write
chown system system /dev/sys/fs/by-name/userdata/revoked_atomic_block
trigger default_storage_mode
on charger
trigger default_storage_mode
on property:ro.boot.mode=charger && property:init.svc.vendor.charger=running
trigger default_storage_mode

View File

@ -1,3 +1,3 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy/dump BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy/dump
PRODUCT_PACKAGES += dump/dump_thermal.sh PRODUCT_PACKAGES += dump_thermal.sh

View File

@ -1,4 +1,4 @@
on property:vendor.device.modules.ready=1 on property:sys.boot_completed=1
# Sysfs # Sysfs
chown system system /sys/devices/virtual/goog_touch_interface/gti.0/force_active chown system system /sys/devices/virtual/goog_touch_interface/gti.0/force_active
chown system system /sys/devices/virtual/goog_touch_interface/gti.0/fw_ver chown system system /sys/devices/virtual/goog_touch_interface/gti.0/fw_ver

View File

@ -1,4 +1,4 @@
on property:vendor.device.modules.ready=1 on property:sys.boot_completed=1
# Sysfs # Sysfs
chown system system /sys/devices/virtual/goog_touch_interface/gti.1/force_active chown system system /sys/devices/virtual/goog_touch_interface/gti.1/force_active
chown system system /sys/devices/virtual/goog_touch_interface/gti.1/fw_ver chown system system /sys/devices/virtual/goog_touch_interface/gti.1/fw_ver

View File

@ -5,7 +5,8 @@ package {
sh_binary { sh_binary {
name: "dump_syna.sh", name: "dump_syna.sh",
src: "dump_syna.sh", src: "dump_syna.sh",
init_rc: ["init.touch.syna20.rc"], init_rc: ["init.touch.syna.rc"],
vendor: true, vendor: true,
sub_dir: "dump", sub_dir: "dump",
} }

View File

@ -0,0 +1,5 @@
on property:sys.boot_completed=1
chown system system /sys/class/spi_master/spi19/spi19.0/synaptics_tcm.0/sysfs/get_raw_data
chown system system /sys/class/spi_master/spi19/spi19.0/synaptics_tcm.0/sysfs/force_active
chown system system /sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs/get_raw_data
chown system system /sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs/force_active

View File

@ -1,3 +0,0 @@
on property:vendor.device.modules.ready=1
chown system system /sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs/get_raw_data
chown system system /sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs/force_active

View File

@ -1,3 +1,3 @@
genfscon sysfs /devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0 genfscon sysfs /devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0
genfscon sysfs /devices/platform/111c0000.spi/spi_master/spi19/spi19.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0
genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0 genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0
genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/wakeup u:object_r:sysfs_wakeup:s0

View File

@ -1,4 +1,4 @@
PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/sepolicy BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/sepolicy

5
touch/syna/syna19.mk Normal file
View File

@ -0,0 +1,5 @@
PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi19/spi19.0/synaptics_tcm.0/sysfs
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/sepolicy
PRODUCT_PACKAGES += dump_syna.sh

View File

@ -1,4 +1,4 @@
PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/sepolicy BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/sepolicy

View File

@ -0,0 +1,10 @@
<compatibility-matrix version="1.0" type="framework">
<hal format="aidl" optional="true">
<name>com.google.input</name>
<version>2-3</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@ -0,0 +1,26 @@
<compatibility-matrix version="1.0" type="framework">
<hal format="aidl" optional="true">
<name>com.google.input</name>
<version>2-3</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>com.google.input.algos.gril</name>
<version>2-3</version>
<interface>
<name>IGrilAntennaTuningService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>com.google.input.algos.spd</name>
<version>2-3</version>
<interface>
<name>IScreenProtectorDetectorService</name>
<instance>default</instance>
</interface>
</hal>
</compatibility-matrix>

View File

@ -0,0 +1,10 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>com.google.input</name>
<version>3</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@ -0,0 +1,26 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>com.google.input</name>
<version>3</version>
<interface>
<name>ITouchContextService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl">
<name>com.google.input.algos.gril</name>
<version>3</version>
<interface>
<name>IGrilAntennaTuningService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl">
<name>com.google.input.algos.spd</name>
<version>3</version>
<interface>
<name>IScreenProtectorDetectorService</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@ -0,0 +1,2 @@
DEVICE_MANIFEST_FILE += device/google/gs-common/touch/twoshay/aidl/manifest_gs101.xml
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/touch/twoshay/aidl/compatibility_matrix_gs101.xml

View File

@ -0,0 +1,2 @@
DEVICE_MANIFEST_FILE += device/google/gs-common/touch/twoshay/aidl/manifest_zuma.xml
DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/touch/twoshay/aidl/compatibility_matrix_zuma.xml