diff --git a/16kb/16kb.mk b/16kb/16kb.mk deleted file mode 100644 index 96bfd89..0000000 --- a/16kb/16kb.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (C) 2025 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. -# - -####################################################################### -# WARNING: Any rule defined here automatically gets inherited for -# *BOTH* 4 KB and 16 KB targets where this file is included. -####################################################################### - -PRODUCT_PACKAGES += copy_efs_files_to_data diff --git a/16kb/Android.bp b/16kb/Android.bp deleted file mode 100644 index e9bd6ac..0000000 --- a/16kb/Android.bp +++ /dev/null @@ -1,13 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -// Filesystem: Copy efs/efs_backup/modem_userdata to /data partition -// so that they can be accessed under 16K mode. By default, these partitions -// are 4K F2FS , which can't be mounted under 16K mode. -// (b/293313353) -sh_binary { - name: "copy_efs_files_to_data", - src: "copy_efs_files_to_data.sh", - vendor: true, -} diff --git a/16kb/CopyEfsTest/Android.bp b/16kb/CopyEfsTest/Android.bp deleted file mode 100644 index e599215..0000000 --- a/16kb/CopyEfsTest/Android.bp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2025 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: ["device_google_gs-common_license"], -} - -java_test_host { - name: "CopyEfsTest", - // Include all test java files - srcs: ["src/**/*.java"], - static_libs: [ - "junit", - "platform-test-annotations", - "truth", - ], - libs: [ - "tradefed", - "compatibility-host-util", - "compatibility-tradefed", - ], - test_suites: [ - "device-tests", - "device-pixel-tests", - ], - test_config: "AndroidTest.xml", -} diff --git a/16kb/CopyEfsTest/AndroidTest.xml b/16kb/CopyEfsTest/AndroidTest.xml deleted file mode 100644 index 2b18b04..0000000 --- a/16kb/CopyEfsTest/AndroidTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/16kb/CopyEfsTest/src/com/android/test/CopyEfsTest.java b/16kb/CopyEfsTest/src/com/android/test/CopyEfsTest.java deleted file mode 100644 index 0f87513..0000000 --- a/16kb/CopyEfsTest/src/com/android/test/CopyEfsTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2025 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 com.android.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; -import org.junit.Before; -import org.junit.After; - -import android.platform.test.annotations.AppModeFull; - -import com.android.tradefed.device.DeviceNotAvailableException; -import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; -import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; -import com.android.tradefed.testtype.junit4.DeviceTestRunOptions; -import com.android.tradefed.util.CommandResult; -import com.android.tradefed.util.RunUtil; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import java.io.BufferedReader; -import java.io.StringReader; - -@RunWith(DeviceJUnit4ClassRunner.class) -public class CopyEfsTest extends BaseHostJUnit4Test { - - @Before - public void setUp() throws Exception { - getDevice().enableAdbRoot(); - - getDevice().executeShellCommand("rm -rf /data/local/tmp/efs_test"); - getDevice().executeShellCommand("mkdir -p /data/local/tmp/efs_test/mnt"); - getDevice().executeShellCommand("mkdir -p /data/local/tmp/efs_test/dump"); - } - - @Test - @AppModeFull - public void copyEfsTest() throws Exception { - assumeTrue(getDevice().executeShellCommand("getconf PAGESIZE").trim().equals("4096")); - - testDumpF2FS("efs"); - testDumpF2FS("efs_backup"); - testDumpF2FS("modem_userdata"); - testDumpF2FS("persist"); - } - - private CommandResult RunAndCheckAdbCmd(String cmd) throws DeviceNotAvailableException { - CommandResult r = getDevice().executeShellV2Command(cmd); - assertEquals("Failed to run " + cmd, Integer.valueOf(0), r.getExitCode()); - return r; - } - - // Remove timestamps because ls on device does not support --time-style. - // Format is [permissions] [links] [uid] [gid] [size] time [name/symlink] - // time may vary greatly in formatting - // symlinks will be of the form a -> b - // So we can check for -> in the second to last spot to determine what position the timestamp ends at - // Remove totals because on disk block usage may change depending on filesystem - private String removeTimestamps(String input) { - StringBuilder output = new StringBuilder(); - for (String line : input.split("\n")) { - String[] tokens = line.split("(?")) - name_offset = 3; - for (int i=0; i= 5 && i < tokens.length - name_offset) - continue; - if (i != 0) - output.append(" "); - output.append(tokens[i]); - } - output.append("\n"); - } - return output.toString(); - } - - private void testDumpF2FS(String name) throws Exception { - RunAndCheckAdbCmd(String.format("cp /dev/block/by-name/%s /data/local/tmp/efs_test/%s.img", name, name)); - - // The device was mounted r/w. To get a clean image, we run fsck, and then mount to allow mount time fixes to happen. - // We can then dump and mount read only to ensure the contents should be the same. - RunAndCheckAdbCmd(String.format("fsck.f2fs -f /data/local/tmp/efs_test/%s.img", name)); - RunAndCheckAdbCmd(String.format("mount /data/local/tmp/efs_test/%s.img /data/local/tmp/efs_test/mnt", name)); - RunAndCheckAdbCmd("umount /data/local/tmp/efs_test/mnt"); - - RunAndCheckAdbCmd(String.format("dump.f2fs -rfPLo /data/local/tmp/efs_test/dump /data/local/tmp/efs_test/%s.img", name)); - RunAndCheckAdbCmd(String.format("mount -r /data/local/tmp/efs_test/%s.img /data/local/tmp/efs_test/mnt", name)); - - CommandResult r = RunAndCheckAdbCmd("diff -rq --no-dereference /data/local/tmp/efs_test/mnt /data/local/tmp/efs_test/dump"); - assertEquals(r.getStdout(), ""); - - String ls_cmd = "cd /data/local/tmp/efs_test/%s;ls -AlnR ."; - CommandResult mnt_ls = RunAndCheckAdbCmd(String.format(ls_cmd, "mnt")); - CommandResult dump_ls = RunAndCheckAdbCmd(String.format(ls_cmd, "dump")); - assertEquals(removeTimestamps(mnt_ls.getStdout()), removeTimestamps(dump_ls.getStdout())); - - getDevice().executeShellCommand("umount /data/local/tmp/efs_test/mnt"); - getDevice().executeShellCommand("rm -rf /data/local/tmp/efs_test/dump/*"); - getDevice().executeShellCommand("rm /data/local/tmp/efs_test/" + name + ".img"); - } - - @After - public void tearDown() throws Exception { - getDevice().executeShellCommand("umount /data/local/tmp/efs_test/mnt"); - getDevice().executeShellCommand("rm -rf /data/local/tmp/efs_test"); - } -} diff --git a/16kb/copy_efs_files_to_data.sh b/16kb/copy_efs_files_to_data.sh deleted file mode 100644 index e1d2204..0000000 --- a/16kb/copy_efs_files_to_data.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/vendor/bin/sh - -CHECKPOINT_DIR=/data/vendor/copied - -export BIN_DIR=/vendor/bin - -$BIN_DIR/mkdir -p $CHECKPOINT_DIR - -function copy_files_to_data() -{ - block_device=$1 - partition_name=$(basename $1) - mount_point=$2 - tmpdir=$CHECKPOINT_DIR/$partition_name.img - build_checkpoint=$CHECKPOINT_DIR/$partition_name - if [ ! -e $build_checkpoint ]; then - $BIN_DIR/rm -rf $tmpdir - $BIN_DIR/mkdir -p $tmpdir - $BIN_DIR/dump.f2fs -rfPLo $tmpdir $block_device - if [ $? -ne 0 ]; then - echo "Failed to $BIN_DIR/dump.f2fs -rfPLo $tmpdir $block_device" - return - fi - $BIN_DIR/mv $tmpdir $build_checkpoint - if [ $? -ne 0 ]; then - echo "mv $tmpdir $build_checkpoint" - return - fi - $BIN_DIR/fsync `dirname $build_checkpoint` - fi - echo "Successfully copied $mount_point to $build_checkpoint" -} - -copy_files_to_data "/dev/block/by-name/efs" "/mnt/vendor/efs" -copy_files_to_data "/dev/block/by-name/efs_backup" "/mnt/vendor/efs_backup" -copy_files_to_data "/dev/block/by-name/modem_userdata" "/mnt/vendor/modem_userdata" -copy_files_to_data "/dev/block/by-name/persist" "/mnt/vendor/persist" - -$BIN_DIR/fsync /data/vendor/copied diff --git a/Android.bp b/Android.bp index 52a1055..6515b74 100644 --- a/Android.bp +++ b/Android.bp @@ -18,26 +18,11 @@ package { default_applicable_licenses: ["device_google_gs-common_license"], } -// Added automatically by a large-scale-change that took the approach of -// 'apply every license found to every target'. While this makes sure we respect -// every license restriction, it may not be entirely correct. -// -// e.g. GPL in an MIT project might only apply to the contrib/ directory. -// -// Please consider splitting the single license below into multiple licenses, -// taking care not to lose any license_kind information, and overriding the -// default license using the 'licenses: [...]' property on targets as needed. -// -// For unused files, consider creating a 'fileGroup' with "//visibility:private" -// to attach the license to, and including a comment whether the files may be -// used in the current project. -// See: http://go/android-license-faq license { name: "device_google_gs-common_license", visibility: [":__subpackages__"], license_kinds: [ "SPDX-license-identifier-Apache-2.0", - "SPDX-license-identifier-BSD", ], license_text: [ "NOTICE", diff --git a/FSTAB_OWNERS b/FSTAB_OWNERS deleted file mode 100644 index 18093a0..0000000 --- a/FSTAB_OWNERS +++ /dev/null @@ -1,11 +0,0 @@ -# NOTE: CHANGE THIS FILE WITH CAUTIOUS -# - this file is referenced by other OWNERS file, e.g. device/google/*/OWNERS -# - changing this file might break the function, check go/gerrit-code-owners-syntax first - -jaegeuk@google.com -huangrandall@google.com -bvanassche@google.com -daehojeong@google.com -chullee@google.com -vkon@google.com -thomasyen@google.com diff --git a/MK_OWNERS b/MK_OWNERS deleted file mode 100644 index 67af9f7..0000000 --- a/MK_OWNERS +++ /dev/null @@ -1,20 +0,0 @@ -# NOTE: CHANGE THIS FILE WITH CAUTIOUS -# - this file is referenced by other OWNERS file, e.g. device/google/*/OWNERS -# - changing this file might break the function, check go/gerrit-code-owners-syntax first -# -# Makefile Review Guide for OWNERS: go/pixel-device-mk-owner-checklist - -aaronding@google.com -rurumihong@google.com -adamshih@google.com -wilsonsung@google.com -cyanhsieh@google.com -cyuanjen@google.com -robinpeng@google.com -achant@google.com -etam@google.com -pattjin@google.com -bkhalife@google.com -lokeshgoel@google.com -jainne@google.com -pscovanner@google.com diff --git a/OWNERS b/OWNERS deleted file mode 100644 index 57ca40f..0000000 --- a/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ - -per-file *.te,*_contexts,te_macros,global_macros=set noparent -per-file *.te,*_contexts,te_macros,global_macros=file:/sepolicy/OWNERS -per-file *.mk,{**/,}Android.bp=set noparent -per-file *.mk,{**/,}Android.bp=file:MK_OWNERS diff --git a/README.txt b/README.txt deleted file mode 100644 index b279bda..0000000 --- a/README.txt +++ /dev/null @@ -1 +0,0 @@ -Please refer to go/pixel-recycle to modularize your code in this space. diff --git a/aoc/Android.bp b/aoc/Android.bp deleted file mode 100644 index 7af2424..0000000 --- a/aoc/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_aoc", - srcs: ["dump_aoc.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/aoc/aoc.mk b/aoc/aoc.mk deleted file mode 100644 index 210bd45..0000000 --- a/aoc/aoc.mk +++ /dev/null @@ -1,9 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/aoc/sepolicy - -PRODUCT_PACKAGES += dump_aoc \ - aocd \ - aocxd - -# If AoC Daemon is not present on this build, load firmware at boot via rc -PRODUCT_COPY_FILES += \ - device/google/gs-common/aoc/conf/init.aoc.daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.aoc.rc diff --git a/aoc/conf/init.aoc.daemon.rc b/aoc/conf/init.aoc.daemon.rc deleted file mode 100644 index 1cf204e..0000000 --- a/aoc/conf/init.aoc.daemon.rc +++ /dev/null @@ -1 +0,0 @@ -# AoC firmware will be loaded by Daemon \ No newline at end of file diff --git a/aoc/dump_aoc.cpp b/aoc/dump_aoc.cpp deleted file mode 100644 index baf056e..0000000 --- a/aoc/dump_aoc.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - -// Dump Aoc. -int main() { - setbuf(stdout, NULL); - runCommand("AoC Service Status", "timeout 0.1 cat /sys/devices/platform/*.aoc/services"); - runCommand("AoC Restarts", "timeout 0.1 cat /sys/devices/platform/*.aoc/restart_count"); - runCommand("AoC Coredumps", "timeout 0.1 cat /sys/devices/platform/*.aoc/coredump_count"); - runCommand("AoC ring buf wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/ring_buffer_wakeup"); - runCommand("AoC host ipc wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/host_ipc_wakeup"); - runCommand("AoC usf wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/usf_wakeup"); - runCommand("AoC audio wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/audio_wakeup"); - runCommand("AoC logging wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/logging_wakeup"); - runCommand("AoC hotword wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/hotword_wakeup"); - runCommand("AoC memory exception wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_exception"); - runCommand("AoC memory votes", "timeout 0.5 cat /sys/devices/platform/*.aoc/control/memory_votes_a32"); - runCommand("AoC memory votes", "timeout 0.5 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("AoC DVFS (A32)", "echo 'dbg info -c 1 DVFSA32' > /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"); - return 0; -} diff --git a/aoc/sepolicy/aocd.te b/aoc/sepolicy/aocd.te deleted file mode 100644 index 464e46b..0000000 --- a/aoc/sepolicy/aocd.te +++ /dev/null @@ -1,24 +0,0 @@ -type aocd, domain; -type aocd_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(aocd) - -# access persist files -allow aocd mnt_vendor_file:dir search; -allow aocd persist_file:dir search; -r_dir_file(aocd, persist_aoc_file); - -# sysfs operations -allow aocd sysfs_aoc:dir search; -allow aocd sysfs_aoc_firmware:file w_file_perms; -allow aocd sysfs_aoc_notifytimeout:file r_file_perms; - -# dev operations -allow aocd aoc_device:chr_file rw_file_perms; - -# allow inotify to watch for additions/removals from /dev -allow aocd device:dir r_dir_perms; - -# set properties -set_prop(aocd, vendor_aoc_prop) -set_prop(aocd, vendor_timeout_aoc_prop) -get_prop(aocd, vendor_volte_mif_off) \ No newline at end of file diff --git a/aoc/sepolicy/aocdump.te b/aoc/sepolicy/aocdump.te deleted file mode 100644 index 0801ec0..0000000 --- a/aoc/sepolicy/aocdump.te +++ /dev/null @@ -1,18 +0,0 @@ -type aocdump, domain; -type aocdump_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(aocdump) - -userdebug_or_eng(` - # Permit communication with AoC - allow aocdump aoc_device:chr_file rw_file_perms; - - allow aocdump radio_vendor_data_file:dir rw_dir_perms; - allow aocdump radio_vendor_data_file:file create_file_perms; - allow aocdump wifi_logging_data_file:dir create_dir_perms; - allow aocdump wifi_logging_data_file:file create_file_perms; - set_prop(aocdump, vendor_audio_prop); - r_dir_file(aocdump, proc_asound) - - allow aocdump self:unix_stream_socket create_stream_socket_perms; - allow aocdump audio_vendor_data_file:sock_file { create unlink }; -') diff --git a/aoc/sepolicy/aocxd.te b/aoc/sepolicy/aocxd.te deleted file mode 100644 index 2eedf48..0000000 --- a/aoc/sepolicy/aocxd.te +++ /dev/null @@ -1,31 +0,0 @@ -# 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; - -allow aocxd dumpstate:fd use; -allow aocxd dumpstate:fifo_file write; diff --git a/aoc/sepolicy/device.te b/aoc/sepolicy/device.te deleted file mode 100644 index fbee004..0000000 --- a/aoc/sepolicy/device.te +++ /dev/null @@ -1,3 +0,0 @@ -# AOC device -type aoc_device, dev_type; - diff --git a/aoc/sepolicy/dump_aoc.te b/aoc/sepolicy/dump_aoc.te deleted file mode 100644 index 0731da4..0000000 --- a/aoc/sepolicy/dump_aoc.te +++ /dev/null @@ -1,8 +0,0 @@ -pixel_bugreport(dump_aoc) -allow dump_aoc sysfs_aoc:dir search; -allow dump_aoc sysfs:dir r_dir_perms; -allow dump_aoc sysfs_aoc_dumpstate:file r_file_perms; -allow dump_aoc aoc_device:chr_file rw_file_perms; -allow dump_aoc vendor_shell_exec:file execute_no_trans; -allow dump_aoc vendor_toolbox_exec:file execute_no_trans; - diff --git a/aoc/sepolicy/dumpstate.te b/aoc/sepolicy/dumpstate.te deleted file mode 100644 index 5b89fe1..0000000 --- a/aoc/sepolicy/dumpstate.te +++ /dev/null @@ -1,2 +0,0 @@ -# Allow dumpstate to talk to aocxd over binder -binder_call(dumpstate, aocxd) diff --git a/aoc/sepolicy/file.te b/aoc/sepolicy/file.te deleted file mode 100644 index 0b853db..0000000 --- a/aoc/sepolicy/file.te +++ /dev/null @@ -1,13 +0,0 @@ -# sysfs -type sysfs_aoc_dumpstate, sysfs_type, fs_type; -type sysfs_aoc_boottime, sysfs_type, fs_type; -type sysfs_aoc_firmware, sysfs_type, fs_type; -type sysfs_aoc, sysfs_type, fs_type; -type sysfs_aoc_reset, sysfs_type, fs_type; -type sysfs_aoc_notifytimeout, sysfs_type, fs_type; - -# persist -type persist_aoc_file, file_type, vendor_persist_type; - -# vendor -type aoc_audio_file, file_type, vendor_file_type; diff --git a/aoc/sepolicy/file_contexts b/aoc/sepolicy/file_contexts deleted file mode 100644 index 778de0c..0000000 --- a/aoc/sepolicy/file_contexts +++ /dev/null @@ -1,52 +0,0 @@ -# AoC devices -/dev/acd-audio_output_tuning u:object_r:aoc_device:s0 -/dev/acd-audio_bulk_tx u:object_r:aoc_device:s0 -/dev/acd-audio_bulk_rx u:object_r:aoc_device:s0 -/dev/acd-audio_input_tuning u:object_r:aoc_device:s0 -/dev/acd-audio_input_bulk_tx u:object_r:aoc_device:s0 -/dev/acd-audio_input_bulk_rx u:object_r:aoc_device:s0 -/dev/acd-audio_rtp_tx u:object_r:aoc_device:s0 -/dev/acd-audio_rtp_rx u:object_r:aoc_device:s0 -/dev/acd-sound_trigger u:object_r:aoc_device:s0 -/dev/acd-hotword_notification u:object_r:aoc_device:s0 -/dev/acd-hotword_pcm u:object_r:aoc_device:s0 -/dev/acd-ambient_pcm u:object_r:aoc_device:s0 -/dev/acd-model_data u:object_r:aoc_device:s0 -/dev/acd-debug u:object_r:aoc_device:s0 -/dev/acd-audio_tap[0-9]* u:object_r:aoc_device:s0 -/dev/acd-audio_dcdoff_ref u:object_r:aoc_device:s0 -/dev/acd-com.google.umfw_stat u:object_r:aoc_device:s0 -/dev/acd-com.google.usf u:object_r:aoc_device:s0 -/dev/acd-com.google.usf.non_wake_up u:object_r:aoc_device:s0 -/dev/acd-com.google.chre u:object_r:aoc_device:s0 -/dev/acd-com.google.chre.non_wake_up u:object_r:aoc_device:s0 -/dev/acd-com.google.bt u:object_r:aoc_device:s0 -/dev/acd-com.google.bt.non_wake_up u:object_r:aoc_device:s0 -/dev/acd-logging u:object_r:aoc_device:s0 -/dev/aoc 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-mel_processor u:object_r:aoc_device:s0 -/dev/acd-aocx_control u:object_r:aoc_device:s0 -/dev/acd-aocx_inject[0-9]* u:object_r:aoc_device:s0 -/dev/acd-aocx_tapout[0-9]* u:object_r:aoc_device:s0 -/dev/acd-mc_headpos u:object_r:aoc_device:s0 -/dev/acd-chre_bt_offload_ctl u:object_r:aoc_device:s0 -/dev/acd-chre_bt_offload_data_tx u:object_r:aoc_device:s0 -/dev/acd-chre_bt_offload_data_rx u:object_r:aoc_device:s0 -/dev/acd-chre_ctl u:object_r:aoc_device:s0 -/dev/acd-chre_data_tx u:object_r:aoc_device:s0 -/dev/acd-chre_data_rx u:object_r:aoc_device:s0 - -# AoC vendor binaries -/vendor/bin/aocd u:object_r:aocd_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/aocxd u:object_r:aocxd_exec:s0 - -# AoC audio files -/vendor/etc/aoc(/.*)? u:object_r:aoc_audio_file:s0 - -# Aoc persist files -/mnt/vendor/persist/aoc(/.*)? u:object_r:persist_aoc_file:s0 - diff --git a/aoc/sepolicy/property.te b/aoc/sepolicy/property.te deleted file mode 100644 index e6d715b..0000000 --- a/aoc/sepolicy/property.te +++ /dev/null @@ -1,4 +0,0 @@ -# AoC -vendor_internal_prop(vendor_aoc_prop) -vendor_internal_prop(vendor_timeout_aoc_prop) -vendor_internal_prop(vendor_volte_mif_off) diff --git a/aoc/sepolicy/property_contexts b/aoc/sepolicy/property_contexts deleted file mode 100644 index 475272a..0000000 --- a/aoc/sepolicy/property_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# AoC -vendor.aoc.firmware.version u:object_r:vendor_aoc_prop:s0 -persist.vendor.aoc.status_request_timed_out u:object_r:vendor_timeout_aoc_prop:s0 -persist.vendor.radio.volte_mif_off u:object_r:vendor_volte_mif_off:s0 \ No newline at end of file diff --git a/aoc/sepolicy/service.te b/aoc/sepolicy/service.te deleted file mode 100644 index 502b28d..0000000 --- a/aoc/sepolicy/service.te +++ /dev/null @@ -1 +0,0 @@ -type aocx, service_manager_type; diff --git a/aoc/sepolicy/service_contexts b/aoc/sepolicy/service_contexts deleted file mode 100644 index 80346c8..0000000 --- a/aoc/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -aocx.IAocx/default u:object_r:aocx:s0 diff --git a/audio/aidl.mk b/audio/aidl.mk deleted file mode 100644 index 016f33b..0000000 --- a/audio/aidl.mk +++ /dev/null @@ -1,34 +0,0 @@ - -DEVICE_MANIFEST_FILE += device/google/gs-common/audio/aidl/manifest.xml - -# Audio HALs -PRODUCT_PACKAGES += \ - android.hardware.audio.service-aidl.aoc \ - vendor.google.whitechapel.audio.hal.parserservice \ - -PRODUCT_PACKAGES += \ - libvisualizeraidl \ - libbundleaidl \ - libreverbaidl \ - libdynamicsprocessingaidl \ - libloudnessenhanceraidl \ - libdownmixaidl \ - libhapticgeneratoraidl \ - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/aidl -ifeq ($(AUDIO_USE_DPTX_SEPOLICY),true) -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio/dptx -else -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hdmi_audio/drmdp -endif - -include device/google/gs-common/audio/common.mk - -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/audio/aidl/device_framework_matrix_product.xml - -PRODUCT_PROPERTY_OVERRIDES += \ - 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) diff --git a/audio/aidl/device_framework_matrix_product.xml b/audio/aidl/device_framework_matrix_product.xml deleted file mode 100644 index ce9250f..0000000 --- a/audio/aidl/device_framework_matrix_product.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.whitechapel.audio.extension - 4-6 - - IAudioExtension - default - - - diff --git a/audio/aidl/manifest.xml b/audio/aidl/manifest.xml deleted file mode 100644 index daeb1c4..0000000 --- a/audio/aidl/manifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/audio/common.mk b/audio/common.mk deleted file mode 100644 index c034a68..0000000 --- a/audio/common.mk +++ /dev/null @@ -1,16 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/common - -#Audio Vendor libraries -PRODUCT_PACKAGES += \ - libfvsam_prm_parser \ - libmahalcontroller - -ifeq ($(USE_MAM_V4_ABOVE),true) -PRODUCT_PACKAGES += \ - libMAM_Google_Pixel_Android -else -PRODUCT_PACKAGES += \ - libAlgFx_HiFi3z -endif - -$(call soong_config_set,aoc_audio_board,platform,$(TARGET_BOARD_PLATFORM)) diff --git a/audio/hidl/device_framework_matrix_product.xml b/audio/hidl/device_framework_matrix_product.xml deleted file mode 100644 index 3005497..0000000 --- a/audio/hidl/device_framework_matrix_product.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - vendor.google.whitechapel.audio.audioext - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - 1.0 - - IAudioMetricExt - default - - - diff --git a/audio/hidl/device_framework_matrix_product_gs101.xml b/audio/hidl/device_framework_matrix_product_gs101.xml deleted file mode 100644 index e1bd62a..0000000 --- a/audio/hidl/device_framework_matrix_product_gs101.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - vendor.google.whitechapel.audio.audioext - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - 1.0 - - IAudioMetricExt - default - - - diff --git a/audio/hidl/manifest.xml b/audio/hidl/manifest.xml deleted file mode 100644 index a8d4979..0000000 --- a/audio/hidl/manifest.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.1 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - diff --git a/audio/hidl/manifest_gs101.xml b/audio/hidl/manifest_gs101.xml deleted file mode 100644 index c2fba61..0000000 --- a/audio/hidl/manifest_gs101.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.1 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - diff --git a/audio/hidl/manifest_gs101_64.xml b/audio/hidl/manifest_gs101_64.xml deleted file mode 100644 index 0022cea..0000000 --- a/audio/hidl/manifest_gs101_64.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.1 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 4.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - diff --git a/audio/hidl_gs101.mk b/audio/hidl_gs101.mk deleted file mode 100644 index 713bb43..0000000 --- a/audio/hidl_gs101.mk +++ /dev/null @@ -1,56 +0,0 @@ -DEVICE_MANIFEST_FILE += device/google/gs-common/audio/hidl/manifest_gs101$(LOCAL_64ONLY).xml - -# Audio HAL configurations -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_in_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/hearing_aid_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/hearing_aid_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ - frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml - -# Audio HAL Server & Default Implementations -PRODUCT_PACKAGES += \ - android.hardware.audio.service \ - android.hardware.audio@7.1-impl \ - android.hardware.audio.effect@7.0-impl \ - android.hardware.bluetooth.audio-impl \ - android.hardware.soundtrigger@2.3-impl \ - vendor.google.whitechapel.audio.audioext@4.0-impl - -#Audio HAL libraries -PRODUCT_PACKAGES += \ - audio.primary.$(TARGET_BOARD_PLATFORM) \ - audio.platform.aoc \ - sound_trigger.primary.$(TARGET_BOARD_PLATFORM) \ - audio_bt_aoc \ - audio_tunnel_aoc \ - aoc_aud_ext \ - libaoctuningdecoder \ - libaoc_waves \ - liboffloadeffect \ - audio_waves_aoc \ - audio_fortemedia_aoc \ - audio_bluenote_aoc \ - audio_usb_aoc \ - audio_spk_35l41 \ - audio.usb.default \ - audio.usbv2.default \ - audio.bluetooth.default \ - audio.r_submix.default \ - libamcsextfile \ - audio_amcs_ext \ - -ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) -# IAudioMetricExt HIDL -PRODUCT_PACKAGES += \ - vendor.google.audiometricext@1.0-service-vendor -endif - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hidl - -include device/google/gs-common/audio/common.mk - -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/audio/hidl/device_framework_matrix_product_gs101.xml diff --git a/audio/hidl_gs201.mk b/audio/hidl_gs201.mk deleted file mode 100644 index 920b4f2..0000000 --- a/audio/hidl_gs201.mk +++ /dev/null @@ -1,56 +0,0 @@ -DEVICE_MANIFEST_FILE += device/google/gs-common/audio/hidl/manifest.xml - -# Audio HAL configurations -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_in_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/hearing_aid_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/hearing_aid_audio_policy_configuration_7_0.xml \ - frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ - frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ - frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml - -# Audio HAL Server & Default Implementations -PRODUCT_PACKAGES += \ - android.hardware.audio.service \ - android.hardware.audio@7.1-impl \ - android.hardware.audio.effect@7.0-impl \ - android.hardware.soundtrigger@2.3-impl \ - vendor.google.whitechapel.audio.audioext@4.0-impl \ - android.hardware.bluetooth.audio-impl \ - -#Audio HAL libraries -PRODUCT_PACKAGES += \ - audio.primary.$(TARGET_BOARD_PLATFORM) \ - audio.platform.aoc \ - audio_tunnel_aoc \ - aoc_aud_ext \ - libaoctuningdecoder \ - liboffloadeffect \ - audio_bt_aoc \ - audio_waves_aoc \ - audio_fortemedia_aoc \ - audio_bluenote_aoc \ - audio_usb_aoc \ - audio_cca_aoc \ - libamcsextfile \ - audio_amcs_ext \ - audio.usb.default \ - audio.usbv2.default \ - audio.bluetooth.default \ - audio.r_submix.default \ - audio_spk_35l41 \ - sound_trigger.primary.$(TARGET_BOARD_PLATFORM) - -ifeq (,$(filter aosp_%,$(TARGET_PRODUCT))) -# IAudioMetricExt HIDL -PRODUCT_PACKAGES += \ - vendor.google.audiometricext@1.0-service-vendor -endif - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/hidl - -include device/google/gs-common/audio/common.mk - -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/audio/hidl/device_framework_matrix_product.xml diff --git a/audio/sepolicy/aidl/file_contexts b/audio/sepolicy/aidl/file_contexts deleted file mode 100644 index 3f3390e..0000000 --- a/audio/sepolicy/aidl/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# Audio Hal AIDL Service for Aoc -/vendor/bin/hw/android\.hardware\.audio\.service-aidl\.aoc u:object_r:hal_audio_default_exec:s0 -/system_ext/bin/hw/vendor\.google\.whitechapel\.audio\.hal\.parserservice u:object_r:hal_audio_parameter_parser_exec:s0 diff --git a/audio/sepolicy/aidl/hal_audio_default.te b/audio/sepolicy/aidl/hal_audio_default.te deleted file mode 100644 index 1ae90c7..0000000 --- a/audio/sepolicy/aidl/hal_audio_default.te +++ /dev/null @@ -1,4 +0,0 @@ -add_service(hal_audio_default, hal_audio_ext_service) -# Allow audio-hal to register battery_mitigation service -allow hal_audio_default hal_battery_mitigation_service:service_manager find; -binder_call(hal_audio_default, battery_mitigation) diff --git a/audio/sepolicy/aidl/hal_sensors_default.te b/audio/sepolicy/aidl/hal_sensors_default.te deleted file mode 100644 index ca738ea..0000000 --- a/audio/sepolicy/aidl/hal_sensors_default.te +++ /dev/null @@ -1,3 +0,0 @@ -# Allow access to audio HAL. -binder_call(hal_sensors_default, hal_audio_default) -allow hal_sensors_default hal_audio_ext_service:service_manager find; diff --git a/audio/sepolicy/aidl/parser_service.te b/audio/sepolicy/aidl/parser_service.te deleted file mode 100644 index bce6d49..0000000 --- a/audio/sepolicy/aidl/parser_service.te +++ /dev/null @@ -1,14 +0,0 @@ -# Define a parameter parser service -type hal_audio_parameter_parser, coredomain, domain; -type hal_audio_parameter_parser_exec, system_file_type, file_type, exec_type; -init_daemon_domain(hal_audio_parameter_parser) - -# The server will serve a binder service. -binder_service(hal_audio_parameter_parser) - -add_service(hal_audio_parameter_parser, hal_audio_parameter_parser_service); - -binder_call(audioserver, hal_audio_parameter_parser) -binder_call(hal_audio_parameter_parser, servicemanager) - -allow audioserver hal_audio_parameter_parser_service:service_manager find; diff --git a/audio/sepolicy/aidl/radio.te b/audio/sepolicy/aidl/radio.te deleted file mode 100644 index dcd8458..0000000 --- a/audio/sepolicy/aidl/radio.te +++ /dev/null @@ -1,2 +0,0 @@ -allow radio hal_audio_ext_service:service_manager find; -binder_call(radio, hal_audio_default) diff --git a/audio/sepolicy/aidl/rild.te b/audio/sepolicy/aidl/rild.te deleted file mode 100644 index 218a69d..0000000 --- a/audio/sepolicy/aidl/rild.te +++ /dev/null @@ -1 +0,0 @@ -allow rild hal_audio_ext_service:service_manager find; diff --git a/audio/sepolicy/aidl/service.te b/audio/sepolicy/aidl/service.te deleted file mode 100644 index d931f16..0000000 --- a/audio/sepolicy/aidl/service.te +++ /dev/null @@ -1,3 +0,0 @@ -# Audio -type hal_audio_ext_service, hal_service_type, service_manager_type; -type hal_audio_parameter_parser_service, service_manager_type; \ No newline at end of file diff --git a/audio/sepolicy/aidl/service_contexts b/audio/sepolicy/aidl/service_contexts deleted file mode 100644 index 7a7d61d..0000000 --- a/audio/sepolicy/aidl/service_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# Audio -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 \ No newline at end of file diff --git a/audio/sepolicy/common/device.te b/audio/sepolicy/common/device.te deleted file mode 100644 index b4e77e5..0000000 --- a/audio/sepolicy/common/device.te +++ /dev/null @@ -1,2 +0,0 @@ -# AMCS device -type amcs_device, dev_type; diff --git a/audio/sepolicy/common/file.te b/audio/sepolicy/common/file.te deleted file mode 100644 index 353ab9f..0000000 --- a/audio/sepolicy/common/file.te +++ /dev/null @@ -1,5 +0,0 @@ -# persist -type persist_audio_file, file_type, vendor_persist_type; - -# data -type audio_vendor_data_file, file_type, data_file_type; diff --git a/audio/sepolicy/common/file_contexts b/audio/sepolicy/common/file_contexts deleted file mode 100644 index 1480861..0000000 --- a/audio/sepolicy/common/file_contexts +++ /dev/null @@ -1,11 +0,0 @@ -# AMCS devices -/dev/amcs u:object_r:amcs_device:s0 - -# AMCS vendor service -/vendor/bin/hw/vendor\.google\.audiometricext@1\.0-service-vendor u:object_r:hal_audiometricext_default_exec:s0 - -# Audio data files -/data/vendor/audio(/.*)? u:object_r:audio_vendor_data_file:s0 - -# Audio presist file -/mnt/vendor/persist/audio(/.*)? u:object_r:persist_audio_file:s0 diff --git a/audio/sepolicy/common/genfs_contexts b/audio/sepolicy/common/genfs_contexts deleted file mode 100644 index c4a3120..0000000 --- a/audio/sepolicy/common/genfs_contexts +++ /dev/null @@ -1,24 +0,0 @@ -# pixelstat_vendor -genfscon sysfs /devices/platform/audiometrics/codec_state u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/hs_codec_state u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/speaker_impedance u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/speaker_excursion u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/speaker_heartbeat u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/speaker_temp u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/mic_broken_degrade u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/codec_crashed_counter u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/hwinfo_part_number u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/ams_rate_read_once u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/cca_rate_read_once u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/cca_count_read_once u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/pdm_state u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/waves u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/adapted_info_active_count u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/adapted_info_active_duration u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/pcm_count u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/pcm_latency u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/call_count u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/offload_effects_id u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/offload_effects_duration u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/bt_usage u:object_r:sysfs_pixelstats:s0 -genfscon sysfs /devices/platform/audiometrics/speaker_version u:object_r:sysfs_pixelstats:s0 diff --git a/audio/sepolicy/common/hal_audio_default.te b/audio/sepolicy/common/hal_audio_default.te deleted file mode 100644 index e917b73..0000000 --- a/audio/sepolicy/common/hal_audio_default.te +++ /dev/null @@ -1,45 +0,0 @@ -# allow access to folders -allow hal_audio_default audio_vendor_data_file:dir rw_dir_perms; -allow hal_audio_default audio_vendor_data_file:file create_file_perms; - -r_dir_file(hal_audio_default, aoc_audio_file); -r_dir_file(hal_audio_default, mnt_vendor_file); -r_dir_file(hal_audio_default, persist_audio_file); - -allow hal_audio_default persist_file:dir search; -allow hal_audio_default aoc_device:file rw_file_perms; -allow hal_audio_default aoc_device:chr_file rw_file_perms; - -allow hal_audio_default amcs_device:file rw_file_perms; -allow hal_audio_default amcs_device:chr_file rw_file_perms; -allow hal_audio_default sysfs_pixelstats:file rw_file_perms; -allow hal_audio_default sysfs_extcon:dir search; -allow hal_audio_default sysfs_extcon:file r_file_perms; -allow hal_audio_default vendor_usb_debugfs:dir search; - -#allow access to aoc and kernel boottime -allow hal_audio_default sysfs_aoc:dir { search }; -allow hal_audio_default sysfs_aoc_boottime:file r_file_perms; - -#allow access to DMABUF Heaps for AAudio API -allow hal_audio_default dmabuf_heap_device:chr_file r_file_perms; - -set_prop(hal_audio_default, vendor_audio_prop); -set_prop(hal_audio_default, vendor_audio_prop_restricted); - -hal_client_domain(hal_audio_default, hal_health); -hal_client_domain(hal_audio_default, hal_thermal); -allow hal_audio_default fwk_sensor_hwservice:hwservice_manager find; - -hal_client_domain(hal_audio_default, hal_graphics_allocator); - -userdebug_or_eng(` - allow hal_audio_default self:unix_stream_socket create_stream_socket_perms; - allow hal_audio_default audio_vendor_data_file:sock_file { create unlink }; -') - -wakelock_use(hal_audio_default); - -vndbinder_use(hal_audio_default); -allow hal_audio_default aocx:service_manager find; -binder_call(hal_audio_default, aocxd); diff --git a/audio/sepolicy/common/hal_audiometricext_default.te b/audio/sepolicy/common/hal_audiometricext_default.te deleted file mode 100644 index 5358eac..0000000 --- a/audio/sepolicy/common/hal_audiometricext_default.te +++ /dev/null @@ -1,12 +0,0 @@ -type hal_audiometricext_default, domain; -type hal_audiometricext_default_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(hal_audiometricext_default) - -allow hal_audiometricext_default amcs_device:chr_file rw_file_perms; -allow hal_audiometricext_default sysfs_pixelstats:file rw_file_perms; - -get_prop(hal_audiometricext_default, vendor_audio_prop); -get_prop(hal_audiometricext_default, hwservicemanager_prop); - -hwbinder_use(hal_audiometricext_default); -add_hwservice(hal_audiometricext_default, hal_audiometricext_hwservice); diff --git a/audio/sepolicy/common/hwservice.te b/audio/sepolicy/common/hwservice.te deleted file mode 100644 index 0809453..0000000 --- a/audio/sepolicy/common/hwservice.te +++ /dev/null @@ -1,2 +0,0 @@ -# AudioMetric -type hal_audiometricext_hwservice, hwservice_manager_type; diff --git a/audio/sepolicy/common/hwservice_contexts b/audio/sepolicy/common/hwservice_contexts deleted file mode 100644 index 85c05e5..0000000 --- a/audio/sepolicy/common/hwservice_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# Audio -vendor.google.audiometricext::IAudioMetricExt u:object_r:hal_audiometricext_hwservice:s0 - diff --git a/audio/sepolicy/common/property.te b/audio/sepolicy/common/property.te deleted file mode 100644 index 2287b84..0000000 --- a/audio/sepolicy/common/property.te +++ /dev/null @@ -1,5 +0,0 @@ -# Audio -vendor_internal_prop(vendor_audio_prop) - -# The property for Audio App -vendor_restricted_prop(vendor_audio_prop_restricted) diff --git a/audio/sepolicy/common/property_contexts b/audio/sepolicy/common/property_contexts deleted file mode 100644 index 9f88e55..0000000 --- a/audio/sepolicy/common/property_contexts +++ /dev/null @@ -1,17 +0,0 @@ -# for serial no -vendor.audio_hal.device.serialno u:object_r:vendor_audio_prop:s0 - -# for audio -vendor.audio_hal.period_multiplier u:object_r:vendor_audio_prop:s0 -vendor.audiodump.enable u:object_r:vendor_audio_prop:s0 -persist.vendor.audio. u:object_r:vendor_audio_prop:s0 -vendor.audiodump.log.ondemand u:object_r:vendor_audio_prop:s0 -vendor.audiodump.log.config u:object_r:vendor_audio_prop:s0 -vendor.audiodump.output.dir u:object_r:vendor_audio_prop:s0 -vendor.audiodump.encode.disable u:object_r:vendor_audio_prop:s0 -vendor.audiodump.log.cca.updated u:object_r:vendor_audio_prop:s0 -vendor.audiodump.cca.config u:object_r:vendor_audio_prop:s0 -vendor.audio_hal.aidl.enable u:object_r:vendor_audio_prop:s0 - -# for audio app -persist.vendor.app.audio. u:object_r:vendor_audio_prop_restricted:s0 diff --git a/audio/sepolicy/common/rild.te b/audio/sepolicy/common/rild.te deleted file mode 100644 index fe86848..0000000 --- a/audio/sepolicy/common/rild.te +++ /dev/null @@ -1 +0,0 @@ -get_prop(rild, vendor_audio_prop); diff --git a/audio/sepolicy/common/vendor_init.te b/audio/sepolicy/common/vendor_init.te deleted file mode 100644 index 1562d45..0000000 --- a/audio/sepolicy/common/vendor_init.te +++ /dev/null @@ -1,5 +0,0 @@ -# Audio property -set_prop(vendor_init, vendor_audio_prop) - -# Audio App property -set_prop(vendor_init, vendor_audio_prop_restricted) diff --git a/audio/sepolicy/hdmi_audio/dptx/genfs_contexts b/audio/sepolicy/hdmi_audio/dptx/genfs_contexts deleted file mode 100644 index 64803be..0000000 --- a/audio/sepolicy/hdmi_audio/dptx/genfs_contexts +++ /dev/null @@ -1 +0,0 @@ -genfscon sysfs /devices/platform/dwc_dptx-audio/extcon/hdmi_audio u:object_r:sysfs_extcon:s0 diff --git a/audio/sepolicy/hdmi_audio/drmdp/genfs_contexts b/audio/sepolicy/hdmi_audio/drmdp/genfs_contexts deleted file mode 100644 index eb7e1cf..0000000 --- a/audio/sepolicy/hdmi_audio/drmdp/genfs_contexts +++ /dev/null @@ -1 +0,0 @@ -genfscon sysfs /devices/platform/drmdp-adma/extcon/hdmi_audio u:object_r:sysfs_extcon:s0 diff --git a/audio/sepolicy/hidl/hal_audio_default.te b/audio/sepolicy/hidl/hal_audio_default.te deleted file mode 100644 index bdc3bf9..0000000 --- a/audio/sepolicy/hidl/hal_audio_default.te +++ /dev/null @@ -1,3 +0,0 @@ -hwbinder_use(hal_audio_default) - -add_hwservice(hal_audio_default, hal_audio_ext_hwservice) diff --git a/audio/sepolicy/hidl/hwservice.te b/audio/sepolicy/hidl/hwservice.te deleted file mode 100644 index 15aaaf7..0000000 --- a/audio/sepolicy/hidl/hwservice.te +++ /dev/null @@ -1,2 +0,0 @@ -# Audio -type hal_audio_ext_hwservice, hwservice_manager_type; diff --git a/audio/sepolicy/hidl/hwservice_contexts b/audio/sepolicy/hidl/hwservice_contexts deleted file mode 100644 index 8eadd21..0000000 --- a/audio/sepolicy/hidl/hwservice_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Audio -vendor.google.whitechapel.audio.audioext::IAudioExt u:object_r:hal_audio_ext_hwservice:s0 diff --git a/audio/sepolicy/hidl/radio.te b/audio/sepolicy/hidl/radio.te deleted file mode 100644 index 43585cd..0000000 --- a/audio/sepolicy/hidl/radio.te +++ /dev/null @@ -1,2 +0,0 @@ -allow radio hal_audio_ext_hwservice:hwservice_manager find; -binder_call(radio, hal_audio_default) diff --git a/audio/sepolicy/hidl/rild.te b/audio/sepolicy/hidl/rild.te deleted file mode 100644 index 378d26c..0000000 --- a/audio/sepolicy/hidl/rild.te +++ /dev/null @@ -1 +0,0 @@ -allow rild hal_audio_ext_hwservice:hwservice_manager find; diff --git a/battery_mitigation/bcl.mk b/battery_mitigation/bcl.mk deleted file mode 100644 index 54d8bfc..0000000 --- a/battery_mitigation/bcl.mk +++ /dev/null @@ -1,15 +0,0 @@ -ifeq (,$(filter factory_%,$(TARGET_PRODUCT))) -PRODUCT_PACKAGES += battery_mitigation -endif - -PRODUCT_PROPERTY_OVERRIDES += \ - vendor.battery_mitigation.aidl.enable=true - -PRODUCT_SOONG_NAMESPACES += device/google/gs-common/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 -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 diff --git a/battery_mitigation/compatibility_matrix.xml b/battery_mitigation/compatibility_matrix.xml deleted file mode 100644 index 7e3d88e..0000000 --- a/battery_mitigation/compatibility_matrix.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.battery_mitigation - 1 - - IBatteryMitigation - default - - - diff --git a/battery_mitigation/sepolicy/system_ext/private/brownout_detection_app.te b/battery_mitigation/sepolicy/system_ext/private/brownout_detection_app.te deleted file mode 100644 index c342cbf..0000000 --- a/battery_mitigation/sepolicy/system_ext/private/brownout_detection_app.te +++ /dev/null @@ -1,8 +0,0 @@ -typeattribute brownout_detection_app coredomain; - -userdebug_or_eng(` - app_domain(brownout_detection_app) - net_domain(brownout_detection_app) - allow brownout_detection_app app_api_service:service_manager find; - allow brownout_detection_app system_api_service:service_manager find; -') diff --git a/battery_mitigation/sepolicy/system_ext/private/seapp_contexts b/battery_mitigation/sepolicy/system_ext/private/seapp_contexts deleted file mode 100644 index 7e5d883..0000000 --- a/battery_mitigation/sepolicy/system_ext/private/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# BrownoutDetection -user=_app isPrivApp=true name=com.google.android.brownoutdetection domain=brownout_detection_app type=app_data_file levelFrom=all diff --git a/battery_mitigation/sepolicy/system_ext/public/brownout_detection_app.te b/battery_mitigation/sepolicy/system_ext/public/brownout_detection_app.te deleted file mode 100644 index 7eec57a..0000000 --- a/battery_mitigation/sepolicy/system_ext/public/brownout_detection_app.te +++ /dev/null @@ -1 +0,0 @@ -type brownout_detection_app, domain; diff --git a/battery_mitigation/sepolicy/vendor/battery_mitigation.te b/battery_mitigation/sepolicy/vendor/battery_mitigation.te deleted file mode 100644 index 30b314c..0000000 --- a/battery_mitigation/sepolicy/vendor/battery_mitigation.te +++ /dev/null @@ -1,38 +0,0 @@ -type battery_mitigation, domain; -type battery_mitigation_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(battery_mitigation) -get_prop(battery_mitigation, boot_status_prop) -get_prop(battery_mitigation, vendor_brownout_reason_prop) -get_prop(battery_mitigation, system_boot_reason_prop) -set_prop(battery_mitigation, vendor_mitigation_ready_prop) -set_prop(battery_mitigation, vendor_brownout_br_feasible_prop) - -hal_client_domain(battery_mitigation, hal_thermal); -hal_client_domain(battery_mitigation, hal_health); - -r_dir_file(battery_mitigation, sysfs_acpm_stats) -r_dir_file(battery_mitigation, sysfs_batteryinfo) -r_dir_file(battery_mitigation, sysfs_iio_devices) -r_dir_file(battery_mitigation, sysfs_gpu) -r_dir_file(battery_mitigation, sysfs_thermal) -r_dir_file(battery_mitigation, thermal_link_device) -r_dir_file(battery_mitigation, sysfs_odpm) -r_dir_file(battery_mitigation, sysfs_power_stats) -allow battery_mitigation sysfs_bcl:dir r_dir_perms; -allow battery_mitigation sysfs_bcl:file rw_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 mitigation_vendor_data_file:dir rw_dir_perms; -allow battery_mitigation mitigation_vendor_data_file:file create_file_perms; -allow battery_mitigation dumpstate:fd use; -allow battery_mitigation dumpstate:fifo_file rw_file_perms; - -# Allow battery_mitigation to use Binder IPC so that service manager can notify it for callbacks -binder_use(battery_mitigation) -# Allow battery_mitigation to listen brownout event by epoll_wait -wakelock_use(battery_mitigation) -# Allow battery_mitigation to run aidl service -add_service(battery_mitigation, hal_battery_mitigation_service) -# Allow battery_mitigation to run audio mitigation callback -binder_call(battery_mitigation, hal_audio_default) -binder_call(battery_mitigation, servicemanager) diff --git a/battery_mitigation/sepolicy/vendor/brownout_detection_app.te b/battery_mitigation/sepolicy/vendor/brownout_detection_app.te deleted file mode 100644 index e2c602f..0000000 --- a/battery_mitigation/sepolicy/vendor/brownout_detection_app.te +++ /dev/null @@ -1,3 +0,0 @@ -userdebug_or_eng(` - get_prop(brownout_detection_app, vendor_brownout_reason_prop) -') diff --git a/battery_mitigation/sepolicy/vendor/dumpstate.te b/battery_mitigation/sepolicy/vendor/dumpstate.te deleted file mode 100644 index b3bb1d4..0000000 --- a/battery_mitigation/sepolicy/vendor/dumpstate.te +++ /dev/null @@ -1,3 +0,0 @@ -# To call battery_mitigation hal -allow dumpstate hal_battery_mitigation_service:service_manager find; -binder_call(dumpstate, battery_mitigation); diff --git a/battery_mitigation/sepolicy/vendor/file.te b/battery_mitigation/sepolicy/vendor/file.te deleted file mode 100644 index 06bedad..0000000 --- a/battery_mitigation/sepolicy/vendor/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type mitigation_vendor_data_file, file_type, data_file_type; -type sysfs_bcl, sysfs_type, fs_type; -type sysfs_odpm, sysfs_type, fs_type; diff --git a/battery_mitigation/sepolicy/vendor/file_contexts b/battery_mitigation/sepolicy/vendor/file_contexts deleted file mode 100644 index 2e88ba0..0000000 --- a/battery_mitigation/sepolicy/vendor/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/hw/battery_mitigation u:object_r:battery_mitigation_exec:s0 -/data/vendor/mitigation(/.*)? u:object_r:mitigation_vendor_data_file:s0 diff --git a/battery_mitigation/sepolicy/vendor/genfs_contexts b/battery_mitigation/sepolicy/vendor/genfs_contexts deleted file mode 100644 index 66d63dd..0000000 --- a/battery_mitigation/sepolicy/vendor/genfs_contexts +++ /dev/null @@ -1 +0,0 @@ -genfscon sysfs /devices/virtual/pmic/mitigation u:object_r:sysfs_bcl:s0 diff --git a/battery_mitigation/sepolicy/vendor/property.te b/battery_mitigation/sepolicy/vendor/property.te deleted file mode 100644 index 3dfa12e..0000000 --- a/battery_mitigation/sepolicy/vendor/property.te +++ /dev/null @@ -1,4 +0,0 @@ -# Battery Mitigation -vendor_internal_prop(vendor_mitigation_ready_prop) -vendor_public_prop(vendor_brownout_reason_prop) -vendor_internal_prop(vendor_brownout_br_feasible_prop) diff --git a/battery_mitigation/sepolicy/vendor/property_contexts b/battery_mitigation/sepolicy/vendor/property_contexts deleted file mode 100644 index d5d538a..0000000 --- a/battery_mitigation/sepolicy/vendor/property_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# Battery Mitigation -vendor.brownout.mitigation.ready u:object_r:vendor_mitigation_ready_prop:s0 -vendor.brownout_reason u:object_r:vendor_brownout_reason_prop:s0 -vendor.brownout.br.feasible u:object_r:vendor_brownout_br_feasible_prop:s0 diff --git a/battery_mitigation/sepolicy/vendor/service.te b/battery_mitigation/sepolicy/vendor/service.te deleted file mode 100644 index f0c7e9d..0000000 --- a/battery_mitigation/sepolicy/vendor/service.te +++ /dev/null @@ -1 +0,0 @@ -type hal_battery_mitigation_service, hal_service_type, service_manager_type; diff --git a/battery_mitigation/sepolicy/vendor/service_contexts b/battery_mitigation/sepolicy/vendor/service_contexts deleted file mode 100644 index 472259e..0000000 --- a/battery_mitigation/sepolicy/vendor/service_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.google.battery_mitigation.IBatteryMitigation/default u:object_r:hal_battery_mitigation_service:s0 diff --git a/battery_mitigation/sepolicy/vendor/vendor_init.te b/battery_mitigation/sepolicy/vendor/vendor_init.te deleted file mode 100644 index d53053f..0000000 --- a/battery_mitigation/sepolicy/vendor/vendor_init.te +++ /dev/null @@ -1,5 +0,0 @@ -# Battery Mitigation -set_prop(vendor_init, vendor_brownout_reason_prop) -get_prop(vendor_init, vendor_brownout_br_feasible_prop) -get_prop(vendor_init, system_boot_reason_prop) -get_prop(vendor_init, vendor_thermal_prop) diff --git a/bcmbt/bluetooth.mk b/bcmbt/bluetooth.mk deleted file mode 100644 index 1896cf6..0000000 --- a/bcmbt/bluetooth.mk +++ /dev/null @@ -1,16 +0,0 @@ -PRODUCT_PACKAGES += \ - android.hardware.bluetooth-V1-ndk.so \ - android.hardware.bluetooth.finder-V1-ndk.so \ - android.hardware.bluetooth.ranging-V1-ndk.so \ - android.hardware.bluetooth-service.bcmbtlinux \ - vendor.google.bluetooth_ext-V3-ndk.so \ - bt_vendor.conf \ - android.hardware.bluetooth.prebuilt.xml \ - android.hardware.bluetooth_le.prebuilt.xml - - -BOARD_SEPOLICY_DIRS += device/google/gs-common/bcmbt/sepolicy -BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/powerstats - -DEVICE_MANIFEST_FILE += device/google/gs-common/bcmbt/manifest_bluetooth.xml -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/bcmbt/compatibility_matrix.xml diff --git a/bcmbt/compatibility_matrix.xml b/bcmbt/compatibility_matrix.xml deleted file mode 100644 index 47928f4..0000000 --- a/bcmbt/compatibility_matrix.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - vendor.google.bluetooth_ext - 1-3 - - IBluetoothFinder - default - - - IBluetoothCcc - default - - - IBTChannelAvoidance - default - - - IBluetoothSar - default - - - IBluetoothExt - default - - - IBluetoothEwp - default - - - IBluetoothCco - default - - - diff --git a/bcmbt/dump/dumplog.mk b/bcmbt/dump/dumplog.mk deleted file mode 100644 index 9c4a8e7..0000000 --- a/bcmbt/dump/dumplog.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bcmbt/dump/sepolicy/ diff --git a/bcmbt/dump/sepolicy/dump_bcmbt.te b/bcmbt/dump/sepolicy/dump_bcmbt.te deleted file mode 100644 index 8fa76b8..0000000 --- a/bcmbt/dump/sepolicy/dump_bcmbt.te +++ /dev/null @@ -1,11 +0,0 @@ -pixel_bugreport(dump_bcmbt) - -userdebug_or_eng(` - allow dump_bcmbt radio_vendor_data_file:dir create_dir_perms; - allow dump_bcmbt radio_vendor_data_file:file create_file_perms; - allow dump_bcmbt vendor_bt_data_file:dir r_dir_perms; - allow dump_bcmbt vendor_bt_data_file:file r_file_perms; - allow dump_bcmbt sscoredump_vendor_data_coredump_file:dir r_dir_perms; - allow dump_bcmbt sscoredump_vendor_data_coredump_file:file r_file_perms; - allow dump_bcmbt sscoredump_vendor_data_crashinfo_file:dir search; -') diff --git a/bcmbt/dump/sepolicy/file_contexts b/bcmbt/dump/sepolicy/file_contexts deleted file mode 100644 index e3f0df6..0000000 --- a/bcmbt/dump/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_bcmbt u:object_r:dump_bcmbt_exec:s0 diff --git a/bcmbt/manifest_bluetooth.xml b/bcmbt/manifest_bluetooth.xml deleted file mode 100644 index 7a7c5f1..0000000 --- a/bcmbt/manifest_bluetooth.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - android.hardware.bluetooth - 1 - IBluetoothHci/default - - - android.hardware.bluetooth.finder - 1 - IBluetoothFinder/default - - - android.hardware.bluetooth.ranging - 1 - IBluetoothChannelSounding/default - - - vendor.google.bluetooth_ext - 2 - IBTChannelAvoidance/default - IBluetoothCcc/default - IBluetoothEwp/default - IBluetoothExt/default - IBluetoothFinder/default - IBluetoothSar/default - IBluetoothCco/default - - diff --git a/bcmbt/sepolicy/device.te b/bcmbt/sepolicy/device.te deleted file mode 100644 index a256332..0000000 --- a/bcmbt/sepolicy/device.te +++ /dev/null @@ -1,3 +0,0 @@ -# Bt Wifi Coexistence device -type wb_coexistence_dev, dev_type; - diff --git a/bcmbt/sepolicy/file_contexts b/bcmbt/sepolicy/file_contexts deleted file mode 100644 index e7aac6a..0000000 --- a/bcmbt/sepolicy/file_contexts +++ /dev/null @@ -1,6 +0,0 @@ -# Bluetooth -/(vendor|system/vendor)/bin/hw/android\.hardware\.bluetooth-service\.bcmbtlinux u:object_r:hal_bluetooth_btlinux_exec:s0 - -/dev/wbrc u:object_r:wb_coexistence_dev:s0 -/dev/ttySAC16 u:object_r:hci_attach_dev:s0 - diff --git a/bcmbt/sepolicy/genfs_contexts b/bcmbt/sepolicy/genfs_contexts deleted file mode 100644 index 607e146..0000000 --- a/bcmbt/sepolicy/genfs_contexts +++ /dev/null @@ -1,7 +0,0 @@ -genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 -genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill2/state u:object_r:sysfs_bluetooth_writable:s0 -genfscon proc /bluetooth/sleep/lpm u:object_r:proc_bluetooth_writable:s0 -genfscon proc /bluetooth/sleep/btwrite u:object_r:proc_bluetooth_writable:s0 -genfscon proc /bluetooth/sleep/btwake u:object_r:proc_bluetooth_writable:s0 -genfscon proc /bluetooth/timesync u:object_r:proc_bluetooth_writable:s0 - diff --git a/bcmbt/sepolicy/hal_bluetooth_btlinux.te b/bcmbt/sepolicy/hal_bluetooth_btlinux.te deleted file mode 100644 index 263f689..0000000 --- a/bcmbt/sepolicy/hal_bluetooth_btlinux.te +++ /dev/null @@ -1,23 +0,0 @@ -add_hwservice(hal_bluetooth_btlinux, hal_bluetooth_coexistence_hwservice); -add_service(hal_bluetooth_btlinux, hal_bluetooth_coexistence_service); -get_prop(hal_bluetooth_btlinux, boot_status_prop) - -allow hal_bluetooth_btlinux sysfs_bluetooth_writable:file rw_file_perms; -allow hal_bluetooth_btlinux proc_bluetooth_writable:file rw_file_perms; -allow hal_bluetooth_btlinux hci_attach_dev:chr_file rw_file_perms; -allow hal_bluetooth_btlinux wb_coexistence_dev:chr_file rw_file_perms; -binder_call(hal_bluetooth_btlinux, servicemanager) - -# power stats -vndbinder_use(hal_bluetooth_btlinux) -allow hal_bluetooth_btlinux hal_power_stats_vendor_service:service_manager find; -binder_call(hal_bluetooth_btlinux, hal_power_stats_default) - -allow hal_bluetooth_btlinux sscoredump_vendor_data_crashinfo_file:dir create_dir_perms; -allow hal_bluetooth_btlinux sscoredump_vendor_data_crashinfo_file:file create_file_perms; - -userdebug_or_eng(` - allow hal_bluetooth_btlinux sscoredump_vendor_data_coredump_file:dir create_dir_perms; - allow hal_bluetooth_btlinux sscoredump_vendor_data_coredump_file:file create_file_perms; - allow hal_bluetooth_btlinux logbuffer_device:chr_file r_file_perms; -') diff --git a/bcmbt/sepolicy/hwservice.te b/bcmbt/sepolicy/hwservice.te deleted file mode 100644 index 5e36cd0..0000000 --- a/bcmbt/sepolicy/hwservice.te +++ /dev/null @@ -1,3 +0,0 @@ -# Bluetooth HAL extension -type hal_bluetooth_coexistence_hwservice, hwservice_manager_type, vendor_hwservice_type; - diff --git a/bcmbt/sepolicy/hwservice_contexts b/bcmbt/sepolicy/hwservice_contexts deleted file mode 100644 index 8480b4e..0000000 --- a/bcmbt/sepolicy/hwservice_contexts +++ /dev/null @@ -1,6 +0,0 @@ -# Bluetooth HAL extension -hardware.google.bluetooth.bt_channel_avoidance::IBTChannelAvoidance u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.sar::IBluetoothSar u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.ccc::IBluetoothCcc u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.ewp::IBluetoothEwp u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.ext::IBluetoothExt u:object_r:hal_bluetooth_coexistence_hwservice:s0 diff --git a/bcmbt/sepolicy/service.te b/bcmbt/sepolicy/service.te deleted file mode 100644 index b8403da..0000000 --- a/bcmbt/sepolicy/service.te +++ /dev/null @@ -1,2 +0,0 @@ -# Bluetooth HAL extension -type hal_bluetooth_coexistence_service, hal_service_type, service_manager_type; diff --git a/bcmbt/sepolicy/service_contexts b/bcmbt/sepolicy/service_contexts deleted file mode 100644 index e91eb1e..0000000 --- a/bcmbt/sepolicy/service_contexts +++ /dev/null @@ -1,8 +0,0 @@ -# Bluetooth HAL extension -vendor.google.bluetooth_ext.IBTChannelAvoidance/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothSar/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothCcc/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothEwp/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothExt/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothFinder/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothCco/default u:object_r:hal_bluetooth_coexistence_service:s0 diff --git a/betterbug/betterbug.mk b/betterbug/betterbug.mk deleted file mode 100644 index adfde01..0000000 --- a/betterbug/betterbug.mk +++ /dev/null @@ -1,7 +0,0 @@ -# When neither AOSP nor factory targets -ifeq (,$(filter aosp_% factory_% lineage_%, $(TARGET_PRODUCT))) - PRODUCT_PACKAGES += BetterBugStub -endif - -PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/betterbug/sepolicy/product/public -PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/betterbug/sepolicy/product/private diff --git a/betterbug/sepolicy/product/private/better_bug_app.te b/betterbug/sepolicy/product/private/better_bug_app.te deleted file mode 100644 index 26e0565..0000000 --- a/betterbug/sepolicy/product/private/better_bug_app.te +++ /dev/null @@ -1,47 +0,0 @@ -typeattribute better_bug_app coredomain; - -app_domain(better_bug_app) -net_domain(better_bug_app) - -allow better_bug_app app_api_service:service_manager find; -allow better_bug_app mediaserver_service:service_manager find; -allow better_bug_app radio_service:service_manager find; -allow better_bug_app system_api_service:service_manager find; - -allow better_bug_app privapp_data_file:file execute; -allow better_bug_app privapp_data_file:lnk_file r_file_perms; -allow better_bug_app shell_data_file:file r_file_perms; -allow better_bug_app shell_data_file:dir r_dir_perms; - -# Allow traceur to pass file descriptors through a content provider to betterbug -allow better_bug_app trace_data_file:file { getattr read }; - -# Allow betterbug to read profile reports generated by profcollect. -userdebug_or_eng(` - allow better_bug_app profcollectd_data_file:file r_file_perms; -') - -# Allow BetterBug access to WM traces attributes -allow better_bug_app wm_trace_data_file:dir r_dir_perms; -allow better_bug_app wm_trace_data_file:file getattr; - -# Allow the bug reporting frontend to read the presence and timestamp of the -# trace attached to the bugreport (but not its contents, which will go in the -# usual bugreport .zip file). This is used by the bug reporting UI to tell if -# the bugreport will contain a system trace or not while the bugreport is still -# in progress. -allow better_bug_app perfetto_traces_bugreport_data_file:dir r_dir_perms; -allow better_bug_app perfetto_traces_bugreport_data_file:file { getattr }; - -# Allow BetterBug to receive Perfetto traces through the framework -# (i.e. TracingServiceProxy) and sendfile them into their private -# directories for reporting when network and battery conditions are -# appropriate. -allow better_bug_app perfetto:fd use; -allow better_bug_app perfetto_traces_data_file:file { read getattr }; - -# Allow BetterBug to set property to start vendor.touch_dumpstate -set_prop(better_bug_app, ctl_start_prop) - -# Allow BetterBug to read system boot reason -get_prop(better_bug_app, system_boot_reason_prop) diff --git a/betterbug/sepolicy/product/private/seapp_contexts b/betterbug/sepolicy/product/private/seapp_contexts deleted file mode 100644 index 77fe3e1..0000000 --- a/betterbug/sepolicy/product/private/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# BetterBug -user=_app isPrivApp=true name=com.google.android.apps.internal.betterbug domain=better_bug_app type=privapp_data_file levelFrom=user diff --git a/betterbug/sepolicy/product/public/better_bug_app.te b/betterbug/sepolicy/product/public/better_bug_app.te deleted file mode 100644 index 9a14782..0000000 --- a/betterbug/sepolicy/product/public/better_bug_app.te +++ /dev/null @@ -1 +0,0 @@ -type better_bug_app, domain; diff --git a/bluetooth/bluetooth.mk b/bluetooth/bluetooth.mk deleted file mode 100644 index c0f043a..0000000 --- a/bluetooth/bluetooth.mk +++ /dev/null @@ -1,15 +0,0 @@ -PRODUCT_PACKAGES += \ - android.hardware.bluetooth-V1-ndk.so \ - android.hardware.bluetooth.finder-V1-ndk.so \ - android.hardware.bluetooth.ranging-V1-ndk.so \ - android.hardware.bluetooth-service.pixel \ - vendor.google.bluetooth_ext-V1-ndk.so \ - bt_vendor.conf \ - android.hardware.bluetooth.prebuilt.xml \ - android.hardware.bluetooth_le.prebuilt.xml - -BOARD_SEPOLICY_DIRS += device/google/gs-common/bluetooth/sepolicy -BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/powerstats - -DEVICE_MANIFEST_FILE += device/google/gs-common/bluetooth/manifest_bluetooth.xml -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/bluetooth/compatibility_matrix.xml diff --git a/bluetooth/compatibility_matrix.xml b/bluetooth/compatibility_matrix.xml deleted file mode 100644 index 65b0c6d..0000000 --- a/bluetooth/compatibility_matrix.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - vendor.google.bluetooth_ext - 1 - - IBluetoothFinder - default - - - IBluetoothCcc - default - - - IBTChannelAvoidance - default - - - IBluetoothSar - default - - - IBluetoothExt - default - - - IBluetoothEwp - default - - - diff --git a/bluetooth/dump/dumplog.mk b/bluetooth/dump/dumplog.mk deleted file mode 100644 index 2f1944e..0000000 --- a/bluetooth/dump/dumplog.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bluetooth/dump/sepolicy/ diff --git a/bluetooth/dump/sepolicy/dump.te b/bluetooth/dump/sepolicy/dump.te deleted file mode 100644 index fdd123e..0000000 --- a/bluetooth/dump/sepolicy/dump.te +++ /dev/null @@ -1,12 +0,0 @@ -# pixel bluetooth common hal service -pixel_bugreport(dump_bt) - -allow hal_dumpstate_default vendor_bt_data_file:dir { open read search }; -allow hal_dumpstate_default vendor_bt_data_file:file read; -allow dump_bt radio_vendor_data_file:dir create_dir_perms; -allow dump_bt radio_vendor_data_file:file create_file_perms; -allow dump_bt vendor_bt_data_file:dir r_dir_perms; -allow dump_bt vendor_bt_data_file:file r_file_perms; -allow dump_bt sscoredump_vendor_data_crashinfo_file:dir search; -allow dump_bt sscoredump_vendor_data_coredump_file:dir r_dir_perms; -allow dump_bt sscoredump_vendor_data_coredump_file:file r_file_perms; diff --git a/bluetooth/dump/sepolicy/file_contexts b/bluetooth/dump/sepolicy/file_contexts deleted file mode 100644 index da28d10..0000000 --- a/bluetooth/dump/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# bt common hal dump_bt service -/vendor/bin/dump/dump_bt u:object_r:dump_bt_exec:s0 diff --git a/bluetooth/manifest_bluetooth.xml b/bluetooth/manifest_bluetooth.xml deleted file mode 100644 index a72f1c9..0000000 --- a/bluetooth/manifest_bluetooth.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - android.hardware.bluetooth - 1 - IBluetoothHci/default - - - android.hardware.bluetooth.finder - 1 - IBluetoothFinder/default - - - android.hardware.bluetooth.ranging - 1 - IBluetoothChannelSounding/default - - - vendor.google.bluetooth_ext - 1 - IBTChannelAvoidance/default - IBluetoothCcc/default - IBluetoothEwp/default - IBluetoothExt/default - IBluetoothFinder/default - IBluetoothSar/default - - diff --git a/bluetooth/sepolicy/device.te b/bluetooth/sepolicy/device.te deleted file mode 100644 index a256332..0000000 --- a/bluetooth/sepolicy/device.te +++ /dev/null @@ -1,3 +0,0 @@ -# Bt Wifi Coexistence device -type wb_coexistence_dev, dev_type; - diff --git a/bluetooth/sepolicy/file_contexts b/bluetooth/sepolicy/file_contexts deleted file mode 100644 index e7c2617..0000000 --- a/bluetooth/sepolicy/file_contexts +++ /dev/null @@ -1,6 +0,0 @@ -# Bluetooth -/vendor/bin/hw/android\.hardware\.bluetooth-service\.pixel u:object_r:hal_bluetooth_btlinux_exec:s0 - -/dev/wbrc u:object_r:wb_coexistence_dev:s0 -/dev/ttySAC16 u:object_r:hci_attach_dev:s0 - diff --git a/bluetooth/sepolicy/genfs_contexts b/bluetooth/sepolicy/genfs_contexts deleted file mode 100644 index 899041b..0000000 --- a/bluetooth/sepolicy/genfs_contexts +++ /dev/null @@ -1,8 +0,0 @@ -# Bluetooth pin control device node -genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 -genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill2/state u:object_r:sysfs_bluetooth_writable:s0 -genfscon proc /bluetooth/sleep/lpm u:object_r:proc_bluetooth_writable:s0 -genfscon proc /bluetooth/sleep/btwrite u:object_r:proc_bluetooth_writable:s0 -genfscon proc /bluetooth/sleep/btwake u:object_r:proc_bluetooth_writable:s0 -genfscon proc /bluetooth/timesync u:object_r:proc_bluetooth_writable:s0 - diff --git a/bluetooth/sepolicy/hal_bluetooth_btlinux.te b/bluetooth/sepolicy/hal_bluetooth_btlinux.te deleted file mode 100644 index 0c85cb0..0000000 --- a/bluetooth/sepolicy/hal_bluetooth_btlinux.te +++ /dev/null @@ -1,19 +0,0 @@ -# coexistence device file node -add_hwservice(hal_bluetooth_btlinux, hal_bluetooth_coexistence_hwservice); -add_service(hal_bluetooth_btlinux, hal_bluetooth_coexistence_service); -allow hal_bluetooth_btlinux wb_coexistence_dev:chr_file rw_file_perms; - -# power stats -allow hal_bluetooth_btlinux hal_power_stats_vendor_service:service_manager find; -binder_call(hal_bluetooth_btlinux, hal_power_stats_default) - -# bt firmware dump -allow hal_bluetooth_btlinux aconfig_storage_metadata_file:dir search; -allow hal_bluetooth_btlinux sscoredump_vendor_data_crashinfo_file:dir rw_dir_perms; -allow hal_bluetooth_btlinux sscoredump_vendor_data_crashinfo_file:file rw_file_perms; - -userdebug_or_eng(` - allow hal_bluetooth_btlinux sscoredump_vendor_data_coredump_file:dir create_dir_perms; - allow hal_bluetooth_btlinux sscoredump_vendor_data_coredump_file:file create_file_perms; - allow hal_bluetooth_btlinux logbuffer_device:chr_file r_file_perms; -') diff --git a/bluetooth/sepolicy/hwservice.te b/bluetooth/sepolicy/hwservice.te deleted file mode 100644 index 5e36cd0..0000000 --- a/bluetooth/sepolicy/hwservice.te +++ /dev/null @@ -1,3 +0,0 @@ -# Bluetooth HAL extension -type hal_bluetooth_coexistence_hwservice, hwservice_manager_type, vendor_hwservice_type; - diff --git a/bluetooth/sepolicy/hwservice_contexts b/bluetooth/sepolicy/hwservice_contexts deleted file mode 100644 index 8480b4e..0000000 --- a/bluetooth/sepolicy/hwservice_contexts +++ /dev/null @@ -1,6 +0,0 @@ -# Bluetooth HAL extension -hardware.google.bluetooth.bt_channel_avoidance::IBTChannelAvoidance u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.sar::IBluetoothSar u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.ccc::IBluetoothCcc u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.ewp::IBluetoothEwp u:object_r:hal_bluetooth_coexistence_hwservice:s0 -hardware.google.bluetooth.ext::IBluetoothExt u:object_r:hal_bluetooth_coexistence_hwservice:s0 diff --git a/bluetooth/sepolicy/service.te b/bluetooth/sepolicy/service.te deleted file mode 100644 index b8403da..0000000 --- a/bluetooth/sepolicy/service.te +++ /dev/null @@ -1,2 +0,0 @@ -# Bluetooth HAL extension -type hal_bluetooth_coexistence_service, hal_service_type, service_manager_type; diff --git a/bluetooth/sepolicy/service_contexts b/bluetooth/sepolicy/service_contexts deleted file mode 100644 index 4aecc90..0000000 --- a/bluetooth/sepolicy/service_contexts +++ /dev/null @@ -1,7 +0,0 @@ -# Bluetooth HAL extension -vendor.google.bluetooth_ext.IBTChannelAvoidance/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothSar/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothCcc/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothEwp/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothExt/default u:object_r:hal_bluetooth_coexistence_service:s0 -vendor.google.bluetooth_ext.IBluetoothFinder/default u:object_r:hal_bluetooth_coexistence_service:s0 diff --git a/bootctrl/1.2/Android.bp b/bootctrl/1.2/Android.bp deleted file mode 100644 index ad0b0e1..0000000 --- a/bootctrl/1.2/Android.bp +++ /dev/null @@ -1,89 +0,0 @@ -// -// Copyright (C) 2020 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 { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "//device/google/gs-common:device_google_gs-common_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: [ - "//device/google/gs-common:device_google_gs-common_license", - ], -} - -cc_binary { - name: "android.hardware.boot@1.2-service-pixel", - defaults: ["hidl_defaults"], - relative_install_path: "hw", - vendor: true, - init_rc: ["android.hardware.boot@1.2-service-pixel.rc"], - srcs: [ - "BootControl.cpp", - "GptUtils.cpp", - "service.cpp" - ], - shared_libs: [ - "libbase", - "liblog", - "libhidlbase", - "libutils", - "libcutils", - "libz", - "libtrusty", - "android.hardware.boot@1.0", - "android.hardware.boot@1.1", - "android.hardware.boot@1.2", - ], - static_libs: [ - "libboot_control", - "libbootloader_message_vendor", - "libfstab", - ], -} - -cc_library { - name: "android.hardware.boot@1.2-impl-pixel", - stem: "android.hardware.boot@1.0-impl-1.2-impl-pixel", - recovery: true, - srcs: [ - "BootControl.cpp", - "GptUtils.cpp", - ], - relative_install_path: "hw", - shared_libs: [ - "libbase", - "liblog", - "libhidlbase", - "libutils", - "libcutils", - "libz", - "libtrusty", - "android.hardware.boot@1.0", - "android.hardware.boot@1.1", - "android.hardware.boot@1.2", - ], - static_libs: [ - "libboot_control", - "libbootloader_message_vendor", - "libfstab", - ], -} diff --git a/bootctrl/1.2/BootControl.cpp b/bootctrl/1.2/BootControl.cpp deleted file mode 100644 index 54764a0..0000000 --- a/bootctrl/1.2/BootControl.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/* - * Copyright (C) 2020 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 "bootcontrolhal" - -#include "BootControl.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "DevInfo.h" -#include "GptUtils.h" - -namespace android { -namespace hardware { -namespace boot { -namespace V1_2 { -namespace implementation { - -using android::bootable::GetMiscVirtualAbMergeStatus; -using android::bootable::InitMiscVirtualAbMessageIfNeeded; -using android::bootable::SetMiscVirtualAbMergeStatus; -using android::hardware::boot::V1_0::BoolResult; -using android::hardware::boot::V1_0::CommandResult; -using android::hardware::boot::V1_1::MergeStatus; - -namespace { - -// clang-format off - -#define BOOT_A_PATH "/dev/block/by-name/boot_a" -#define BOOT_B_PATH "/dev/block/by-name/boot_b" -#define DEVINFO_PATH "/dev/block/by-name/devinfo" - -#define BLOW_AR_PATH "/sys/kernel/boot_control/blow_ar" - -// slot flags -#define AB_ATTR_PRIORITY_SHIFT 52 -#define AB_ATTR_PRIORITY_MASK (3UL << AB_ATTR_PRIORITY_SHIFT) -#define AB_ATTR_ACTIVE_SHIFT 54 -#define AB_ATTR_ACTIVE (1UL << AB_ATTR_ACTIVE_SHIFT) -#define AB_ATTR_RETRY_COUNT_SHIFT (55) -#define AB_ATTR_RETRY_COUNT_MASK (7UL << AB_ATTR_RETRY_COUNT_SHIFT) -#define AB_ATTR_SUCCESSFUL (1UL << 58) -#define AB_ATTR_UNBOOTABLE (1UL << 59) - -#define AB_ATTR_MAX_PRIORITY 3UL -#define AB_ATTR_MAX_RETRY_COUNT 3UL - -// clang-format on - -static std::string getDevPath(uint32_t slot) { - char real_path[PATH_MAX]; - - const char *path = slot == 0 ? BOOT_A_PATH : BOOT_B_PATH; - - int ret = readlink(path, real_path, sizeof real_path); - if (ret < 0) { - ALOGE("readlink failed for boot device %s\n", strerror(errno)); - return std::string(); - } - - std::string dp(real_path); - // extract /dev/sda.. part - return dp.substr(0, sizeof "/dev/block/sdX" - 1); -} - -static bool isSlotFlagSet(uint32_t slot, uint64_t flag) { - std::string dev_path = getDevPath(slot); - if (dev_path.empty()) { - ALOGI("Could not get device path for slot %d\n", slot); - return false; - } - - GptUtils gpt(dev_path); - if (gpt.Load()) { - ALOGI("failed to load gpt data\n"); - return false; - } - - gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); - if (e == nullptr) { - ALOGI("failed to get gpt entry\n"); - return false; - } - - return !!(e->attr & flag); -} - -static bool setSlotFlag(uint32_t slot, uint64_t flag) { - std::string dev_path = getDevPath(slot); - if (dev_path.empty()) { - ALOGI("Could not get device path for slot %d\n", slot); - return false; - } - - GptUtils gpt(dev_path); - if (gpt.Load()) { - ALOGI("failed to load gpt data\n"); - return false; - } - - gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); - if (e == nullptr) { - ALOGI("failed to get gpt entry\n"); - return false; - } - - e->attr |= flag; - gpt.Sync(); - - return true; -} - -static bool is_devinfo_valid; -static bool is_devinfo_initialized; -static std::mutex devinfo_lock; -static devinfo_t devinfo; - -static bool isDevInfoValid() { - const std::lock_guard lock(devinfo_lock); - - if (is_devinfo_initialized) { - return is_devinfo_valid; - } - - is_devinfo_initialized = true; - - android::base::unique_fd fd(open(DEVINFO_PATH, O_RDONLY)); - android::base::ReadFully(fd, &devinfo, sizeof devinfo); - - if (devinfo.magic != DEVINFO_MAGIC) { - return is_devinfo_valid; - } - - uint32_t version = ((uint32_t)devinfo.ver_major << 16) | devinfo.ver_minor; - // only version 3.3+ supports A/B data - if (version >= 0x0003'0003) { - is_devinfo_valid = true; - } - - return is_devinfo_valid; -} - -static bool DevInfoSync() { - if (!isDevInfoValid()) { - return false; - } - - android::base::unique_fd fd(open(DEVINFO_PATH, O_WRONLY | O_DSYNC)); - return android::base::WriteFully(fd, &devinfo, sizeof devinfo); -} - -static void DevInfoInitSlot(devinfo_ab_slot_data_t &slot_data) { - slot_data.retry_count = AB_ATTR_MAX_RETRY_COUNT; - slot_data.unbootable = 0; - slot_data.successful = 0; - slot_data.active = 1; - slot_data.fastboot_ok = 0; -} - -static int blow_otp_AR(bool secure) { - static const char *dev_name = "/dev/trusty-ipc-dev0"; - static const char *otp_name = "com.android.trusty.otp_manager.tidl"; - int fd = 1, ret = 0; - uint32_t cmd = secure? OTP_CMD_write_antirbk_secure_ap : OTP_CMD_write_antirbk_non_secure_ap; - fd = tipc_connect(dev_name, otp_name); - if (fd < 0) { - ALOGI("Failed to connect to OTP_MGR ns TA - is it missing?\n"); - ret = -1; - return ret; - } - - struct otp_mgr_req_base req = { - .command = cmd, - .resp_payload_size = 0, - }; - struct iovec iov[] = { - { - .iov_base = &req, - .iov_len = sizeof(req), - }, - }; - - int rc = tipc_send(fd, iov, 1, NULL, 0); - if (rc != sizeof(req)) { - ALOGI("Send fail! %x\n", rc); - return rc; - } - - struct otp_mgr_rsp_base resp; - rc = read(fd, &resp, sizeof(resp)); - if (rc < 0) { - ALOGI("Read fail! %x\n", rc); - return rc; - } - - if (rc < sizeof(resp)) { - ALOGI("Not enough data! %x\n", rc); - return -EIO; - } - - if (resp.command != (cmd | OTP_RESP_BIT)) { - ALOGI("Wrong command! %x\n", resp.command); - return -EINVAL; - } - - if (resp.result != 0) { - fprintf(stderr, "AR writing error! %x\n", resp.result); - return -EINVAL; - } - - tipc_close(fd); - return 0; -} - -static bool blowAR_zuma() { - int ret = blow_otp_AR(true); - if (ret) { - ALOGI("Blow secure anti-rollback OTP failed"); - return false; - } - - ret = blow_otp_AR(false); - if (ret) { - ALOGI("Blow non-secure anti-rollback OTP failed"); - return false; - } - - return true; -} - -static bool blowAR_gs101() { - android::base::unique_fd fd(open(BLOW_AR_PATH, O_WRONLY | O_DSYNC)); - return android::base::WriteStringToFd("1", fd); -} - -static bool blowAR() { - const auto& platform = ::android::base::GetProperty("ro.boot.hardware.platform", ""); - - if (platform == "gs101") { - return blowAR_gs101(); - } else if (platform == "gs201" || platform == "zuma" || platform == "zumapro") { - return blowAR_zuma(); - } - - return false; -} - -} // namespace - -// Methods from ::android::hardware::boot::V1_0::IBootControl follow. -Return BootControl::getNumberSlots() { - uint32_t slots = 0; - - if (access(BOOT_A_PATH, F_OK) == 0) - slots++; - - if (access(BOOT_B_PATH, F_OK) == 0) - slots++; - - return slots; -} - -Return BootControl::getCurrentSlot() { - char suffix[PROPERTY_VALUE_MAX]; - property_get("ro.boot.slot_suffix", suffix, "_a"); - return std::string(suffix) == "_b" ? 1 : 0; -} - -Return BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) { - if (getNumberSlots() == 0) { - // no slots, just return true otherwise Android keeps trying - _hidl_cb({true, ""}); - return Void(); - } - - bool ret; - if (isDevInfoValid()) { - auto const slot = getCurrentSlot(); - devinfo.ab_data.slots[slot].successful = 1; - ret = DevInfoSync(); - } else { - ret = setSlotFlag(getCurrentSlot(), AB_ATTR_SUCCESSFUL); - } - - if (!ret) { - _hidl_cb({false, "Failed to set successful flag"}); - return Void(); - } - - if (!blowAR()) { - ALOGE("Failed to blow anti-rollback counter"); - // Ignore the error, since ABL will re-trigger it on reboot - } - - _hidl_cb({true, ""}); - return Void(); -} - -Return BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) { - if (slot >= 2) { - _hidl_cb({false, "Invalid slot"}); - return Void(); - } - - if (isDevInfoValid()) { - auto &active_slot_data = devinfo.ab_data.slots[slot]; - auto &inactive_slot_data = devinfo.ab_data.slots[!slot]; - - inactive_slot_data.active = 0; - DevInfoInitSlot(active_slot_data); - - if (!DevInfoSync()) { - _hidl_cb({false, "Could not update DevInfo data"}); - return Void(); - } - } else { - std::string dev_path = getDevPath(slot); - if (dev_path.empty()) { - _hidl_cb({false, "Could not get device path for slot"}); - return Void(); - } - - GptUtils gpt(dev_path); - if (gpt.Load()) { - _hidl_cb({false, "failed to load gpt data"}); - return Void(); - } - - gpt_entry *active_entry = gpt.GetPartitionEntry(slot == 0 ? "boot_a" : "boot_b"); - gpt_entry *inactive_entry = gpt.GetPartitionEntry(slot == 0 ? "boot_b" : "boot_a"); - if (active_entry == nullptr || inactive_entry == nullptr) { - _hidl_cb({false, "failed to get entries for boot partitions"}); - return Void(); - } - - ALOGV("slot active attributes %lx\n", active_entry->attr); - ALOGV("slot inactive attributes %lx\n", inactive_entry->attr); - - // update attributes for active and inactive - inactive_entry->attr &= ~AB_ATTR_ACTIVE; - active_entry->attr = AB_ATTR_ACTIVE | (AB_ATTR_MAX_PRIORITY << AB_ATTR_PRIORITY_SHIFT) | - (AB_ATTR_MAX_RETRY_COUNT << AB_ATTR_RETRY_COUNT_SHIFT); - } - - char boot_dev[PROPERTY_VALUE_MAX]; - property_get("ro.boot.bootdevice", boot_dev, ""); - if (boot_dev[0] == '\0') { - ALOGI("failed to get ro.boot.bootdevice. try ro.boot.boot_devices\n"); - property_get("ro.boot.boot_devices", boot_dev, ""); - if (boot_dev[0] == '\0') { - _hidl_cb({false, "invalid ro.boot.bootdevice and ro.boot.boot_devices prop"}); - return Void(); - } - } - - std::string boot_lun_path = - std::string("/sys/devices/platform/") + boot_dev + "/pixel/boot_lun_enabled"; - int fd = open(boot_lun_path.c_str(), O_RDWR | O_DSYNC); - if (fd < 0) { - // Try old path for kernels < 5.4 - // TODO: remove once kernel 4.19 support is deprecated - std::string boot_lun_path = - std::string("/sys/devices/platform/") + boot_dev + "/attributes/boot_lun_enabled"; - fd = open(boot_lun_path.c_str(), O_RDWR | O_DSYNC); - if (fd < 0) { - _hidl_cb({false, "failed to open ufs attr boot_lun_enabled"}); - return Void(); - } - } - - // - // bBootLunEn - // 0x1 => Boot LU A = enabled, Boot LU B = disable - // 0x2 => Boot LU A = disable, Boot LU B = enabled - // - int ret = android::base::WriteStringToFd(slot == 0 ? "1" : "2", fd); - close(fd); - if (ret < 0) { - _hidl_cb({false, "faied to write boot_lun_enabled attribute"}); - return Void(); - } - - _hidl_cb({true, ""}); - return Void(); -} - -Return BootControl::setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) { - if (slot >= 2) { - _hidl_cb({false, "Invalid slot"}); - return Void(); - } - - if (isDevInfoValid()) { - auto &slot_data = devinfo.ab_data.slots[slot]; - slot_data.unbootable = 1; - if (!DevInfoSync()) { - _hidl_cb({false, "Could not update DevInfo data"}); - return Void(); - } - } else { - std::string dev_path = getDevPath(slot); - if (dev_path.empty()) { - _hidl_cb({false, "Could not get device path for slot"}); - return Void(); - } - - GptUtils gpt(dev_path); - gpt.Load(); - - gpt_entry *e = gpt.GetPartitionEntry(slot ? "boot_b" : "boot_a"); - e->attr |= AB_ATTR_UNBOOTABLE; - - gpt.Sync(); - } - - _hidl_cb({true, ""}); - return Void(); -} - -Return<::android::hardware::boot::V1_0::BoolResult> BootControl::isSlotBootable(uint32_t slot) { - if (getNumberSlots() == 0) - return BoolResult::FALSE; - if (slot >= getNumberSlots()) - return BoolResult::INVALID_SLOT; - - bool unbootable; - if (isDevInfoValid()) { - auto &slot_data = devinfo.ab_data.slots[slot]; - unbootable = !!slot_data.unbootable; - } else { - unbootable = isSlotFlagSet(slot, AB_ATTR_UNBOOTABLE); - } - - return unbootable ? BoolResult::FALSE : BoolResult::TRUE; -} - -Return<::android::hardware::boot::V1_0::BoolResult> BootControl::isSlotMarkedSuccessful( - uint32_t slot) { - if (getNumberSlots() == 0) { - // just return true so that we don't we another call trying to mark it as successful - // when there is no slots - return BoolResult::TRUE; - } - if (slot >= getNumberSlots()) - return BoolResult::INVALID_SLOT; - - bool successful; - if (isDevInfoValid()) { - auto &slot_data = devinfo.ab_data.slots[slot]; - successful = !!slot_data.successful; - } else { - successful = isSlotFlagSet(slot, AB_ATTR_SUCCESSFUL); - } - - return successful ? BoolResult::TRUE : BoolResult::FALSE; -} - -Return BootControl::getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) { - _hidl_cb(slot == 0 ? "_a" : slot == 1 ? "_b" : ""); - return Void(); -} - -// Methods from ::android::hardware::boot::V1_1::IBootControl follow. -bool BootControl::Init() { - return InitMiscVirtualAbMessageIfNeeded(); -} - -Return BootControl::setSnapshotMergeStatus( - ::android::hardware::boot::V1_1::MergeStatus status) { - return SetMiscVirtualAbMergeStatus(getCurrentSlot(), status); -} - -Return<::android::hardware::boot::V1_1::MergeStatus> BootControl::getSnapshotMergeStatus() { - MergeStatus status; - if (!GetMiscVirtualAbMergeStatus(getCurrentSlot(), &status)) { - return MergeStatus::UNKNOWN; - } - return status; -} - -// Methods from ::android::hardware::boot::V1_2::IBootControl follow. -Return BootControl::getActiveBootSlot() { - if (getNumberSlots() == 0) - return 0; - - if (isDevInfoValid()) - return devinfo.ab_data.slots[1].active ? 1 : 0; - return isSlotFlagSet(1, AB_ATTR_ACTIVE) ? 1 : 0; -} - -// Methods from ::android::hidl::base::V1_0::IBase follow. - -IBootControl *HIDL_FETCH_IBootControl(const char * /* name */) { - auto module = new BootControl(); - - module->Init(); - - return module; -} - -} // namespace implementation -} // namespace V1_2 -} // namespace boot -} // namespace hardware -} // namespace android diff --git a/bootctrl/1.2/BootControl.h b/bootctrl/1.2/BootControl.h deleted file mode 100644 index 45b7efa..0000000 --- a/bootctrl/1.2/BootControl.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2020 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 -#include -#include - -namespace android { -namespace hardware { -namespace boot { -namespace V1_2 { -namespace implementation { - -using ::android::sp; -using ::android::hardware::hidl_array; -using ::android::hardware::hidl_memory; -using ::android::hardware::hidl_string; -using ::android::hardware::hidl_vec; -using ::android::hardware::Return; -using ::android::hardware::Void; - -struct BootControl : public IBootControl { - bool Init(); - - // Methods from ::android::hardware::boot::V1_0::IBootControl follow. - Return getNumberSlots() override; - Return getCurrentSlot() override; - Return markBootSuccessful(markBootSuccessful_cb _hidl_cb) override; - Return setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override; - Return setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override; - Return<::android::hardware::boot::V1_0::BoolResult> isSlotBootable(uint32_t slot) override; - Return<::android::hardware::boot::V1_0::BoolResult> isSlotMarkedSuccessful( - uint32_t slot) override; - Return getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override; - - // Methods from ::android::hardware::boot::V1_1::IBootControl follow. - Return setSnapshotMergeStatus( - ::android::hardware::boot::V1_1::MergeStatus status) override; - Return<::android::hardware::boot::V1_1::MergeStatus> getSnapshotMergeStatus() override; - - // Methods from ::android::hardware::boot::V1_2::IBootControl follow. - Return getActiveBootSlot() override; - - // Methods from ::android::hidl::base::V1_0::IBase follow. -}; - -// FIXME: most likely delete, this is only for passthrough implementations -extern "C" IBootControl *HIDL_FETCH_IBootControl(const char *name); - -enum otpmgr_command : uint32_t { - OTP_REQ_SHIFT = 1, - OTP_RESP_BIT = 1, - OTP_CMD_write_antirbk_non_secure_ap = (7 << OTP_REQ_SHIFT), - OTP_CMD_write_antirbk_secure_ap = (8 << OTP_REQ_SHIFT), -}; - -struct otp_mgr_req_base { - uint32_t command; - uint32_t resp_payload_size; - uint8_t handle; -}__packed; - -struct otp_mgr_rsp_base { - uint32_t command; - uint32_t resp_payload_size; - int result; -}__packed; - -} // namespace implementation -} // namespace V1_2 -} // namespace boot -} // namespace hardware -} // namespace android diff --git a/bootctrl/1.2/DevInfo.h b/bootctrl/1.2/DevInfo.h deleted file mode 100644 index a09a83a..0000000 --- a/bootctrl/1.2/DevInfo.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2021 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 - -namespace android { -namespace hardware { -namespace boot { -namespace V1_2 { -namespace implementation { - -// -// definitions taken from ABL code -// - -constexpr uint32_t DEVINFO_MAGIC = 0x49564544; -constexpr size_t DEVINFO_AB_SLOT_COUNT = 2; - -struct devinfo_ab_slot_data_t { - uint8_t retry_count; - uint8_t unbootable : 1; - uint8_t successful : 1; - uint8_t active : 1; - uint8_t fastboot_ok : 1; - uint8_t : 4; - uint8_t unused[2]; -} __attribute__((packed)); - -typedef struct { - devinfo_ab_slot_data_t slots[DEVINFO_AB_SLOT_COUNT]; -} __attribute__((packed)) devinfo_ab_data_t; - -struct devinfo_t { - uint32_t magic; - uint16_t ver_major; - uint16_t ver_minor; - uint8_t unused[40]; - devinfo_ab_data_t ab_data; - uint8_t unused1[72]; // use remaining up to complete 128 bytes -} __attribute__((packed)); - -static_assert(sizeof(devinfo_t) == 128, "invalid devinfo struct size"); - -} // namespace implementation -} // namespace V1_2 -} // namespace boot -} // namespace hardware -} // namespace android diff --git a/bootctrl/1.2/GptUtils.cpp b/bootctrl/1.2/GptUtils.cpp deleted file mode 100644 index 25088e7..0000000 --- a/bootctrl/1.2/GptUtils.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (C) 2019 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 "bootcontrolhal" - -#include "GptUtils.h" - -#include -#include -#include -#include -#include - -namespace android { -namespace hardware { -namespace boot { -namespace V1_2 { -namespace implementation { - -namespace { - -static int ValidateGptHeader(gpt_header *gpt) { - if (gpt->signature != GPT_SIGNATURE) { - ALOGE("invalid gpt signature 0x%lx\n", gpt->signature); - return -1; - } - - if (gpt->header_size != sizeof(gpt_header)) { - ALOGE("invalid gpt header size %u\n", gpt->header_size); - return -1; - } - - if (gpt->entry_size != sizeof(gpt_entry)) { - ALOGE("invalid gpt entry size %u\n", gpt->entry_size); - return -1; - } - - return 0; -} - -} // namespace - -GptUtils::GptUtils(const std::string dev_path) : dev_path(dev_path), fd(0) {} - -int GptUtils::Load(void) { - fd = open(dev_path.c_str(), O_RDWR); - if (fd < 0) { - ALOGE("failed to open block dev %s, %d\n", dev_path.c_str(), errno); - return -1; - } - - int ret = ioctl(fd, BLKSSZGET, &block_size); - if (ret < 0) { - ALOGE("failed to get block size %d\n", errno); - return -1; - } - - // read primary header - lseek64(fd, block_size, SEEK_SET); - ret = read(fd, &gpt_primary, sizeof gpt_primary); - if (ret < 0) { - ALOGE("failed to read gpt primary header %d\n", errno); - return -1; - } - - if (ValidateGptHeader(&gpt_primary)) { - ALOGE("error validating gpt header\n"); - return -1; - } - - // read partition entries - entry_array.resize(gpt_primary.entry_count); - uint32_t entries_size = gpt_primary.entry_size * gpt_primary.entry_count; - lseek64(fd, block_size * gpt_primary.start_lba, SEEK_SET); - ret = read(fd, entry_array.data(), entries_size); - if (ret < 0) { - ALOGE("failed to read gpt partition entries %d\n", errno); - return -1; - } - - // read gpt back header - lseek64(fd, block_size * gpt_primary.backup_lba, SEEK_SET); - ret = read(fd, &gpt_backup, sizeof gpt_backup); - if (ret < 0) { - ALOGE("failed to read gpt backup header %d\n", errno); - return -1; - } - - if (ValidateGptHeader(&gpt_backup)) { - ALOGW("error validating gpt backup\n"); // just warn about it, not fail - } - - // Create map - auto get_name = [](const uint16_t *efi_name) { - char name[37] = {}; - for (int i = 0; efi_name[i] && i < sizeof name - 1; ++i) name[i] = efi_name[i]; - return std::string(name); - }; - - for (auto const &e : entry_array) { - if (e.name[0] == 0) - break; // stop at the first partition with no name - std::string s = get_name(e.name); - entries[s] = const_cast(&e); - } - - return 0; -} - -gpt_entry *GptUtils::GetPartitionEntry(std::string name) { - return entries.find(name) != entries.end() ? entries[name] : nullptr; -} - -int GptUtils::Sync(void) { - if (!fd) - return -1; - - // calculate crc and check if we need to update gpt - gpt_primary.entries_crc32 = crc32(0, reinterpret_cast(entry_array.data()), - entry_array.size() * sizeof(gpt_entry)); - - // save old crc - uint32_t crc = gpt_primary.crc32; - gpt_primary.crc32 = 0; - - gpt_primary.crc32 = crc32(0, reinterpret_cast(&gpt_primary), sizeof gpt_primary); - if (crc == gpt_primary.crc32) - return 0; // nothing to do (no changes) - - ALOGI("updating GPT\n"); - - lseek64(fd, block_size * gpt_primary.current_lba, SEEK_SET); - int ret = write(fd, &gpt_primary, sizeof gpt_primary); - if (ret < 0) { - ALOGE("failed to write gpt primary header %d\n", errno); - return -1; - } - - lseek64(fd, block_size * gpt_primary.start_lba, SEEK_SET); - ret = write(fd, entry_array.data(), entry_array.size() * sizeof(gpt_entry)); - if (ret < 0) { - ALOGE("failed to write gpt partition entries %d\n", errno); - return -1; - } - - // update GPT backup entries and backup - lseek64(fd, block_size * gpt_backup.start_lba, SEEK_SET); - ret = write(fd, entry_array.data(), entry_array.size() * sizeof(gpt_entry)); - if (ret < 0) { - ALOGE("failed to write gpt backup partition entries %d\n", errno); - return -1; - } - - gpt_backup.entries_crc32 = gpt_primary.entries_crc32; - gpt_backup.crc32 = 0; - gpt_backup.crc32 = crc32(0, reinterpret_cast(&gpt_backup), sizeof gpt_backup); - lseek64(fd, block_size * gpt_primary.backup_lba, SEEK_SET); - ret = write(fd, &gpt_backup, sizeof gpt_backup); - if (ret < 0) { - ALOGE("failed to write gpt backup header %d\n", errno); - return -1; - } - - fsync(fd); - - return 0; -} - -GptUtils::~GptUtils() { - if (fd) { - Sync(); - close(fd); - } -} - -} // namespace implementation -} // namespace V1_2 -} // namespace boot -} // namespace hardware -} // namespace android diff --git a/bootctrl/1.2/GptUtils.h b/bootctrl/1.2/GptUtils.h deleted file mode 100644 index a2bed33..0000000 --- a/bootctrl/1.2/GptUtils.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2019 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 -#include -#include - -namespace android { -namespace hardware { -namespace boot { -namespace V1_2 { -namespace implementation { - -#define GPT_SIGNATURE 0x5452415020494645UL - -typedef struct { - uint8_t type_guid[16]; - uint8_t guid[16]; - uint64_t first_lba; - uint64_t last_lba; - uint64_t attr; - uint16_t name[36]; -} __attribute__((packed)) gpt_entry; - -typedef struct { - uint64_t signature; - uint32_t revision; - uint32_t header_size; - uint32_t crc32; - uint32_t reserved; - uint64_t current_lba; - uint64_t backup_lba; - uint64_t first_usable_lba; - uint64_t last_usable_lba; - uint8_t disk_guid[16]; - uint64_t start_lba; - uint32_t entry_count; - uint32_t entry_size; - uint32_t entries_crc32; -} __attribute__((packed)) gpt_header; - -class GptUtils { - public: - GptUtils(const std::string dev_path); - int Load(void); - gpt_entry *GetPartitionEntry(std::string name); - int Sync(void); - ~GptUtils(); - - private: - std::string dev_path; - int fd; - uint32_t block_size; - gpt_header gpt_primary; - gpt_header gpt_backup; - std::vector entry_array; - std::map entries; -}; - -} // namespace implementation -} // namespace V1_2 -} // namespace boot -} // namespace hardware -} // namespace android diff --git a/bootctrl/1.2/android.hardware.boot@1.2-service-pixel.rc b/bootctrl/1.2/android.hardware.boot@1.2-service-pixel.rc deleted file mode 100644 index ff7d2f3..0000000 --- a/bootctrl/1.2/android.hardware.boot@1.2-service-pixel.rc +++ /dev/null @@ -1,7 +0,0 @@ -service vendor.boot-hal-1-2 /vendor/bin/hw/android.hardware.boot@1.2-service-pixel - interface android.hardware.boot@1.0::IBootControl default - interface android.hardware.boot@1.1::IBootControl default - interface android.hardware.boot@1.2::IBootControl default - class early_hal - user root - group root drmrpc diff --git a/bootctrl/1.2/service.cpp b/bootctrl/1.2/service.cpp deleted file mode 100644 index f07682e..0000000 --- a/bootctrl/1.2/service.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2020 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 "android.hardware.boot@1.2-service" - -#include -#include -#include -#include - -#include "BootControl.h" - -using ::android::status_t; - -using ::android::hardware::boot::V1_2::IBootControl; - -using ::android::hardware::boot::V1_2::implementation::BootControl; -// using ::android::hardware::boot::implementation::BootControl; - -int main(int /* argc */, char * /* argv */[]) { - // This function must be called before you join to ensure the proper - // number of threads are created. The threadpool will never exceed - // size one because of this call. - ::android::hardware::configureRpcThreadpool(1 /*threads*/, true /*willJoin*/); - - ::android::sp bootctrl = new BootControl(); - const status_t status = bootctrl->registerAsService(); - if (status != ::android::OK) { - return 1; // or handle error - } - - // Adds this thread to the threadpool, resulting in one total - // thread in the threadpool. We could also do other things, but - // would have to specify 'false' to willJoin in configureRpcThreadpool. - ::android::hardware::joinRpcThreadpool(); - return 1; // joinRpcThreadpool should never return -} diff --git a/bootctrl/bootctrl_aidl.mk b/bootctrl/bootctrl_aidl.mk deleted file mode 100644 index e9d7051..0000000 --- a/bootctrl/bootctrl_aidl.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_PACKAGES += \ - android.hardware.boot-service.default-pixel \ - android.hardware.boot-service.default_recovery-pixel - -PRODUCT_SOONG_NAMESPACES += device/google/gs-common/bootctrl/aidl -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bootctrl/sepolicy/aidl diff --git a/bootctrl/bootctrl_hidl_1.2.mk b/bootctrl/bootctrl_hidl_1.2.mk deleted file mode 100644 index ef25066..0000000 --- a/bootctrl/bootctrl_hidl_1.2.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_PACKAGES += \ - android.hardware.boot@1.2-impl-pixel \ - android.hardware.boot@1.2-service-pixel - -PRODUCT_SOONG_NAMESPACES += device/google/gs-common/bootctrl/1.2 -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/bootctrl/sepolicy/1.2 diff --git a/bootctrl/sepolicy/1.2/device.te b/bootctrl/sepolicy/1.2/device.te deleted file mode 100644 index 4fd0240..0000000 --- a/bootctrl/sepolicy/1.2/device.te +++ /dev/null @@ -1,5 +0,0 @@ -# devinfo block device -type devinfo_block_device, dev_type; - -# OTA -type sda_block_device, dev_type; diff --git a/bootctrl/sepolicy/1.2/file.te b/bootctrl/sepolicy/1.2/file.te deleted file mode 100644 index 5357fa9..0000000 --- a/bootctrl/sepolicy/1.2/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# sysfs -type sysfs_ota, sysfs_type, fs_type; diff --git a/bootctrl/sepolicy/1.2/file_contexts b/bootctrl/sepolicy/1.2/file_contexts deleted file mode 100644 index c456356..0000000 --- a/bootctrl/sepolicy/1.2/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/android\.hardware\.boot@1\.2-service-pixel u:object_r:hal_bootctl_default_exec:s0 diff --git a/bootctrl/sepolicy/1.2/hal_bootctl_default.te b/bootctrl/sepolicy/1.2/hal_bootctl_default.te deleted file mode 100644 index fe017f9..0000000 --- a/bootctrl/sepolicy/1.2/hal_bootctl_default.te +++ /dev/null @@ -1,3 +0,0 @@ -allow hal_bootctl_default devinfo_block_device:blk_file rw_file_perms; -allow hal_bootctl_default sda_block_device:blk_file rw_file_perms; -allow hal_bootctl_default sysfs_ota:file rw_file_perms; diff --git a/bootctrl/sepolicy/aidl/device.te b/bootctrl/sepolicy/aidl/device.te deleted file mode 100644 index 4fd0240..0000000 --- a/bootctrl/sepolicy/aidl/device.te +++ /dev/null @@ -1,5 +0,0 @@ -# devinfo block device -type devinfo_block_device, dev_type; - -# OTA -type sda_block_device, dev_type; diff --git a/bootctrl/sepolicy/aidl/file.te b/bootctrl/sepolicy/aidl/file.te deleted file mode 100644 index 5357fa9..0000000 --- a/bootctrl/sepolicy/aidl/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# sysfs -type sysfs_ota, sysfs_type, fs_type; diff --git a/bootctrl/sepolicy/aidl/file_contexts b/bootctrl/sepolicy/aidl/file_contexts deleted file mode 100644 index 339896f..0000000 --- a/bootctrl/sepolicy/aidl/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/android\.hardware\.boot-service\.default-pixel u:object_r:hal_bootctl_default_exec:s0 diff --git a/bootctrl/sepolicy/aidl/hal_bootctl_default.te b/bootctrl/sepolicy/aidl/hal_bootctl_default.te deleted file mode 100644 index 2ffeb27..0000000 --- a/bootctrl/sepolicy/aidl/hal_bootctl_default.te +++ /dev/null @@ -1,8 +0,0 @@ -allow hal_bootctl_default devinfo_block_device:blk_file rw_file_perms; -allow hal_bootctl_default sda_block_device:blk_file rw_file_perms; -allow hal_bootctl_default sysfs_ota:file rw_file_perms; -allow hal_bootctl_default tee_device:chr_file rw_file_perms; - -recovery_only(` - allow hal_bootctl_default rootfs:dir r_dir_perms; -') diff --git a/camera/Android.bp b/camera/Android.bp deleted file mode 100644 index 063173f..0000000 --- a/camera/Android.bp +++ /dev/null @@ -1,51 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -prebuilt_etc { - name: "lyric_preview_dis_xml", - vendor: true, - filename: "vendor.android.hardware.camera.preview-dis.xml", - src: "vendor.android.hardware.camera.preview-dis.xml", - sub_dir: "permissions", -} - -prebuilt_etc { - name: "concurrent_foldable_dual_front_xml", - vendor: true, - filename: "com.google.pixel.camera.concurrent_foldable_dual_front.xml", - src: "com.google.pixel.camera.concurrent_foldable_dual_front.xml", - sub_dir: "permissions", -} - -prebuilt_etc { - name: "libg3a_standalone_gabc_rc", - vendor: true, - proprietary: true, - init_rc: ["libg3a_gabc.rc"], - src: "libg3a_gabc.rc", -} - -prebuilt_etc { - name: "libg3a_standalone_gaf_rc", - vendor: true, - proprietary: true, - init_rc: ["libg3a_gaf.rc"], - src: "libg3a_gaf.rc", -} - -prebuilt_etc { - name: "libg3a_standalone_ghawb_rc", - vendor: true, - proprietary: true, - init_rc: ["libg3a_ghawb.rc"], - src: "libg3a_ghawb.rc", -} - -prebuilt_etc { - name: "vendor-apex-allowlist-lyric.xml", - src: "vendor-apex-allowlist-lyric.xml", - vendor: true, - sub_dir: "sysconfig", - filename_from_src: true, -} diff --git a/camera/OWNERS b/camera/OWNERS deleted file mode 100644 index d5ac048..0000000 --- a/camera/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -krzysio@google.com -yromanenko@google.com diff --git a/camera/com.google.pixel.camera.concurrent_foldable_dual_front.xml b/camera/com.google.pixel.camera.concurrent_foldable_dual_front.xml deleted file mode 100644 index e2dda0e..0000000 --- a/camera/com.google.pixel.camera.concurrent_foldable_dual_front.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/camera/compatibility_matrix.xml b/camera/compatibility_matrix.xml deleted file mode 100644 index cd4b76e..0000000 --- a/camera/compatibility_matrix.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - com.google.pixel.camera.services.binder - 1 - - IServiceBinder - default - - - - 0.0.0 - - diff --git a/camera/device_framework_matrix_product.xml b/camera/device_framework_matrix_product.xml deleted file mode 100644 index 171dfa8..0000000 --- a/camera/device_framework_matrix_product.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - com.google.pixel.camera.connectivity.hal.provider - 1 - - ICameraProvider - default - - - diff --git a/camera/dump.mk b/camera/dump.mk deleted file mode 100644 index 922e76a..0000000 --- a/camera/dump.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/vendor -PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/product/public -PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/camera/sepolicy/product/private diff --git a/camera/libg3a_gabc.rc b/camera/libg3a_gabc.rc deleted file mode 100644 index c092edd..0000000 --- a/camera/libg3a_gabc.rc +++ /dev/null @@ -1,28 +0,0 @@ -# override default log levels. -on boot - setprop log.tag.GABC E - -# backward-compatible system props. -on property:persist.vendor.camera.gabc.debug_level=0 - setprop log.tag.GABC S - -on property:persist.vendor.camera.gabc.debug_level=1 - setprop log.tag.GABC V - -on property:persist.vendor.camera.gabc.debug_level=2 - setprop log.tag.GABC V - -on property:persist.vendor.camera.gabc.debug_level=3 - setprop log.tag.GABC D - -on property:persist.vendor.camera.gabc.debug_level=4 - setprop log.tag.GABC I - -on property:persist.vendor.camera.gabc.debug_level=5 - setprop log.tag.GABC W - -on property:persist.vendor.camera.gabc.debug_level=6 - setprop log.tag.GABC E - -on property:persist.vendor.camera.gabc.debug_level=7 - setprop log.tag.GABC A diff --git a/camera/libg3a_gaf.rc b/camera/libg3a_gaf.rc deleted file mode 100644 index 4b2234c..0000000 --- a/camera/libg3a_gaf.rc +++ /dev/null @@ -1,83 +0,0 @@ -# override default log levels. -on boot - setprop log.tag.GAF I - -# backward-compatible system props. -on property:persist.vendor.camera.af.debug_level=0 - setprop log.tag.GAF S - -on property:persist.vendor.camera.af.debug_level=1 - setprop log.tag.GAF V - -on property:persist.vendor.camera.af.debug_level=2 - setprop log.tag.GAF V - -on property:persist.vendor.camera.af.debug_level=3 - setprop log.tag.GAF D - -on property:persist.vendor.camera.af.debug_level=4 - setprop log.tag.GAF I - -on property:persist.vendor.camera.af.debug_level=5 - setprop log.tag.GAF W - -on property:persist.vendor.camera.af.debug_level=6 - setprop log.tag.GAF E - -on property:persist.vendor.camera.af.debug_level=7 - setprop log.tag.GAF A - -on property:persist.vendor.camera.af.video_debug_enable=2 - setprop vendor.camera.3a.log_level 1 - setprop log.tag.3a.gcrd.af.parser.input V - setprop log.tag.3a.gcrd.af.parser.output V - setprop log.tag.3a.gcrd.af.processor V - setprop log.tag.3a.gcrd.af.engine V - setprop log.tag.3a.gcrd.dtm V - -on property:persist.vendor.camera.af.video_debug_enable=0 - setprop vendor.camera.3a.log_level 6 - setprop log.tag.3a.gcrd.af.parser.input E - setprop log.tag.3a.gcrd.af.parser.output E - setprop log.tag.3a.gcrd.af.processor E - setprop log.tag.3a.gcrd.af.engine E - setprop log.tag.3a.gcrd.dtm E - -on property:persist.vendor.camera.af.default_focus_only=false - setprop persist.vendor.camera.af.ignore_ctrl_focus_region false - setprop persist.vendor.camera.af.ignore_face 0 - setprop persist.vendor.camera.af.force_saliency_consumption "" - -on property:persist.vendor.camera.af.default_focus_only=true - setprop persist.vendor.camera.af.ignore_ctrl_focus_region true - setprop persist.vendor.camera.af.ignore_face 1 - setprop persist.vendor.camera.af.force_saliency_consumption false - -# Reset every related properties -on property:persist.vendor.camera.af.standalone_searchlet=reset - setprop persist.vendor.camera.af.ignore_pd \"\" - setprop persist.vendor.camera.af.ignore_tof \"\" - setprop persist.vendor.camera.af.ignore_cdaf \"\" - setprop persist.vendor.camera.af.ignore_gyro \"\" - setprop persist.vendor.camera.af.ignore_3a \"\" - setprop vendor.camera.debug.enable_saliency \"\" - -# Standalone framework: PDAF -on property:persist.vendor.camera.af.standalone_searchlet=pdaf - setprop persist.vendor.camera.af.ignore_tof 1 - setprop persist.vendor.camera.af.ignore_gyro 1 - setprop persist.vendor.camera.af.ignore_3a 1 - setprop vendor.camera.debug.enable_saliency 0 - -# Standalone framework: LDAF -on property:persist.vendor.camera.af.standalone_searchlet=ldaf - setprop persist.vendor.camera.af.ignore_pd 7 - setprop persist.vendor.camera.af.ignore_gyro 1 - setprop persist.vendor.camera.af.ignore_3a 1 - setprop vendor.camera.debug.enable_saliency 0 - -# Standalone framework: CDAF -on property:persist.vendor.camera.af.standalone_searchlet=cdaf - setprop persist.vendor.camera.af.ignore_pd 7 - setprop persist.vendor.camera.af.ignore_tof 1 - setprop vendor.camera.debug.enable_saliency 0 diff --git a/camera/libg3a_ghawb.rc b/camera/libg3a_ghawb.rc deleted file mode 100644 index 4ca6717..0000000 --- a/camera/libg3a_ghawb.rc +++ /dev/null @@ -1,28 +0,0 @@ -# override default log levels. -on boot - setprop log.tag.GHAWB E - -# backward-compatible system props. -on property:persist.vendor.camera.ghawb.debug_level=0 - setprop log.tag.GHAWB S - -on property:persist.vendor.camera.ghawb.debug_level=1 - setprop log.tag.GHAWB V - -on property:persist.vendor.camera.ghawb.debug_level=2 - setprop log.tag.GHAWB V - -on property:persist.vendor.camera.ghawb.debug_level=3 - setprop log.tag.GHAWB D - -on property:persist.vendor.camera.ghawb.debug_level=4 - setprop log.tag.GHAWB I - -on property:persist.vendor.camera.ghawb.debug_level=5 - setprop log.tag.GHAWB W - -on property:persist.vendor.camera.ghawb.debug_level=6 - setprop log.tag.GHAWB E - -on property:persist.vendor.camera.ghawb.debug_level=7 - setprop log.tag.GHAWB A diff --git a/camera/lyric.mk b/camera/lyric.mk deleted file mode 100644 index 88ca30a..0000000 --- a/camera/lyric.mk +++ /dev/null @@ -1,29 +0,0 @@ -PRODUCT_SOONG_NAMESPACES += \ - hardware/google/camera - -$(call soong_config_set,lyric,use_lyric_camera_hal,true) -$(call soong_config_set,google3a_config,gcam_awb,true) -$(call soong_config_set,google3a_config,ghawb_truetone,true) - -# Flag controls whether Lyric apex can be located in the dist-directory. -$(call soong_config_set, lyric, dist_lyric_apex, $(RELEASE_PIXEL_DIST_LYRIC_APEX)) - -# Init-time log settings for Google 3A -PRODUCT_PACKAGES += libg3a_standalone_gabc_rc -PRODUCT_PACKAGES += libg3a_standalone_gaf_rc -PRODUCT_PACKAGES += libg3a_standalone_ghawb_rc - -# Vendor APEX which contains the camera HAL -PRODUCT_PACKAGES += com.google.pixel.camera.hal -PRODUCT_PACKAGES += venodr-apex-allowlist-lyric.xml -PRODUCT_PACKAGES += init.camera.set-interrupts-ownership -PRODUCT_PACKAGES += lyric_preview_dis_xml - -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += \ - device/google/gs-common/camera/device_framework_matrix_product.xml - -DEVICE_MATRIX_FILE += \ - device/google/gs-common/camera/compatibility_matrix.xml - -# sepolicy dir is added in dump.mk. -# Make doesn't deduplicate sepolicy dirs, so including it here causes build errors. diff --git a/camera/lyric_soong_variables.md b/camera/lyric_soong_variables.md deleted file mode 100644 index 4289109..0000000 --- a/camera/lyric_soong_variables.md +++ /dev/null @@ -1,56 +0,0 @@ -# Lyric Soong variables - -## `kernel_version` - -Example: -``` -$(call soong_config_set,lyric,kernel_version,v515) -``` -Linux kernel version on the device. Determines the version of the LWIS userspace -API to use in Lyric. - -## `soc` - -Example: -``` -$(call soong_config_set,lyric,soc,gs101) -``` -The codename for the chip used in the device. Currently only Google silicon -is supported. - -## `camera_hardware` - -Example: -``` -$(call soong_config_set,lyric,camera_hardware,oriole) -``` -Specifies the set of sensors and peripherals present on the device. Determines -the DeviceContext class that will be used. - -## `tuning_product` - -Example: -``` -$(call soong_config_set,lyric,tuning_product,oriole) -``` -Specifies the set of tuning data to use. This may be different than -`camera_hardware` because not all devices have their own tuning data; -development-only devices only have the default tuning for their SoC. - -## `target_device` - -Example: -``` -$(call soong_config_set,google3a_config,target_device,oriole) -``` -A mixture of `camera_hardware` and `tuning_product` used by 3A. - -## `radioext_interface_type` - -Example: -``` -$(call soong_config_set,lyric,radioext_interface_type,aidl) -``` -Specifies which interface type to use in the RadioExt client when communicating -with the RadioExt service. The possible values are "hidl" and "aidl". -Devices launching with Android 15 no longer support HIDL. diff --git a/camera/sepolicy/product/private/seapp_contexts b/camera/sepolicy/product/private/seapp_contexts deleted file mode 100644 index e78385e..0000000 --- a/camera/sepolicy/product/private/seapp_contexts +++ /dev/null @@ -1,9 +0,0 @@ -# Pixel PeristentBackgroundCameraServices -user=system seinfo=platform name=com.google.pixel.camera.services domain=vendor_pbcs_app type=system_app_data_file levelFrom=all -# The :* will allow all services, which run in their own processes, to use the same vendor_pbcs_app domain. -user=system seinfo=platform name=com.google.pixel.camera.services:* domain=vendor_pbcs_app type=system_app_data_file levelFrom=all - -# Pixel Camera Services -user=_app seinfo=CameraServices name=com.google.android.apps.camera.services domain=vendor_pcs_app type=app_data_file levelFrom=all -# The :* will allow all services, which run in their own processes, to use the same vendor_pcs_app domain. -user=_app seinfo=CameraServices name=com.google.android.apps.camera.services:* domain=vendor_pcs_app type=app_data_file levelFrom=all diff --git a/camera/sepolicy/product/private/service_contexts b/camera/sepolicy/product/private/service_contexts deleted file mode 100644 index 0cb84b4..0000000 --- a/camera/sepolicy/product/private/service_contexts +++ /dev/null @@ -1,5 +0,0 @@ -com.google.pixel.camera.services.binder.IServiceBinder/default u:object_r:camera_binder_service:s0 - -com.google.pixel.camera.services.cameraidremapper.ICameraIdRemapper/default u:object_r:camera_cameraidremapper_service:s0 - -com.google.pixel.camera.services.lyricconfigprovider.ILyricConfigProvider/default u:object_r:camera_lyricconfigprovider_service:s0 diff --git a/camera/sepolicy/product/private/vendor_pbcs_app.te b/camera/sepolicy/product/private/vendor_pbcs_app.te deleted file mode 100644 index b8a52d2..0000000 --- a/camera/sepolicy/product/private/vendor_pbcs_app.te +++ /dev/null @@ -1,18 +0,0 @@ -typeattribute vendor_pbcs_app coredomain; - -app_domain(vendor_pbcs_app); - -dontaudit vendor_pbcs_app system_app_data_file:dir *; - -allow vendor_pbcs_app app_api_service:service_manager find; -# Allow PBCS to find Camera Service. -allow vendor_pbcs_app cameraserver_service:service_manager find; - -# Allow PBCS to add the ServiceBinder service to ServiceManager. -add_service(vendor_pbcs_app, camera_binder_service); - -# Allow PBCS to add the CameraIdRemapper service to ServiceManager. -add_service(vendor_pbcs_app, camera_cameraidremapper_service); - -# Allow PBCS to add the LyricConfigProvider service to ServiceManager. -add_service(vendor_pbcs_app, camera_lyricconfigprovider_service); diff --git a/camera/sepolicy/product/private/vendor_pcs_app.te b/camera/sepolicy/product/private/vendor_pcs_app.te deleted file mode 100644 index d41adb4..0000000 --- a/camera/sepolicy/product/private/vendor_pcs_app.te +++ /dev/null @@ -1,34 +0,0 @@ -typeattribute vendor_pcs_app coredomain; - -app_domain(vendor_pcs_app); -net_domain(vendor_pcs_app); -bluetooth_domain(vendor_pcs_app); - -allow vendor_pcs_app { - app_api_service - audioserver_service - cameraserver_service - camera_cameraidremapper_service - camera_lyricconfigprovider_service - drmserver_service - mediametrics_service - mediaserver_service - nfc_service - radio_service -}: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) - diff --git a/camera/sepolicy/product/public/service.te b/camera/sepolicy/product/public/service.te deleted file mode 100644 index 2cdc125..0000000 --- a/camera/sepolicy/product/public/service.te +++ /dev/null @@ -1,5 +0,0 @@ -type camera_binder_service, hal_service_type, protected_service, service_manager_type; - -type camera_cameraidremapper_service, hal_service_type, protected_service, service_manager_type; - -type camera_lyricconfigprovider_service, hal_service_type, protected_service, service_manager_type; diff --git a/camera/sepolicy/product/public/vendor_pbcs_app.te b/camera/sepolicy/product/public/vendor_pbcs_app.te deleted file mode 100644 index 7180719..0000000 --- a/camera/sepolicy/product/public/vendor_pbcs_app.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_pbcs_app, domain; diff --git a/camera/sepolicy/product/public/vendor_pcs_app.te b/camera/sepolicy/product/public/vendor_pcs_app.te deleted file mode 100644 index fb8b0a1..0000000 --- a/camera/sepolicy/product/public/vendor_pcs_app.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_pcs_app, domain; diff --git a/camera/sepolicy/vendor/dump_camera.te b/camera/sepolicy/vendor/dump_camera.te deleted file mode 100644 index c431184..0000000 --- a/camera/sepolicy/vendor/dump_camera.te +++ /dev/null @@ -1,9 +0,0 @@ -pixel_bugreport(dump_camera) - -userdebug_or_eng(` - allow dump_camera vendor_camera_data_file:dir r_dir_perms; - allow dump_camera vendor_camera_data_file:file create_file_perms; - allow dump_camera radio_vendor_data_file:dir create_dir_perms; - allow dump_camera radio_vendor_data_file:file create_file_perms; - get_prop(dump_camera, vendor_camera_debug_prop) -') diff --git a/camera/sepolicy/vendor/file.te b/camera/sepolicy/vendor/file.te deleted file mode 100644 index 5f4a142..0000000 --- a/camera/sepolicy/vendor/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type vendor_camera_data_file, file_type, data_file_type; - diff --git a/camera/sepolicy/vendor/file_contexts b/camera/sepolicy/vendor/file_contexts deleted file mode 100644 index bc21b02..0000000 --- a/camera/sepolicy/vendor/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/bin/dump/dump_camera u:object_r:dump_camera_exec:s0 -/vendor/bin/init\.camera\.set-interrupts-ownership u:object_r:init-camera-set-interrupts-ownership_exec:s0 - -# Data -/data/vendor/camera(/.*)? u:object_r:vendor_camera_data_file:s0 diff --git a/camera/sepolicy/vendor/hal_camera_default.te b/camera/sepolicy/vendor/hal_camera_default.te deleted file mode 100644 index ebb58b8..0000000 --- a/camera/sepolicy/vendor/hal_camera_default.te +++ /dev/null @@ -1,12 +0,0 @@ -allow hal_camera_default camera_binder_service:service_manager find; -# Allow Lyric Hal to find the LyricConfigProvider service through ServiceManager. -allow hal_camera_default camera_lyricconfigprovider_service:service_manager find; - -allow hal_camera_default hal_pixel_remote_camera_service:service_manager find; - -binder_call(hal_camera_default, vendor_pbcs_app); - -binder_call(hal_camera_default, vendor_pcs_app); - -# Allow Lyric HAL to start Image Processing HAL -add_service(hal_camera_default, vendor_image_processing_hal_service) diff --git a/camera/sepolicy/vendor/init.camera.set-interrupts-ownership.te b/camera/sepolicy/vendor/init.camera.set-interrupts-ownership.te deleted file mode 100644 index 781e68d..0000000 --- a/camera/sepolicy/vendor/init.camera.set-interrupts-ownership.te +++ /dev/null @@ -1,10 +0,0 @@ -type init-camera-set-interrupts-ownership, domain; -type init-camera-set-interrupts-ownership_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(init-camera-set-interrupts-ownership) - -allow init-camera-set-interrupts-ownership vendor_toolbox_exec:file rx_file_perms; -allow init-camera-set-interrupts-ownership proc_interrupts:file r_file_perms; -allow init-camera-set-interrupts-ownership proc_irq:dir r_dir_perms; -allow init-camera-set-interrupts-ownership proc_irq:file { r_file_perms setattr }; -allow init-camera-set-interrupts-ownership self:capability { chown setuid setgid }; diff --git a/camera/sepolicy/vendor/property.te b/camera/sepolicy/vendor/property.te deleted file mode 100644 index 1f899b6..0000000 --- a/camera/sepolicy/vendor/property.te +++ /dev/null @@ -1,3 +0,0 @@ -vendor_internal_prop(vendor_camera_debug_prop) -system_vendor_config_prop(vendor_camera_pbcs_debug_prop) - diff --git a/camera/sepolicy/vendor/property_contexts b/camera/sepolicy/vendor/property_contexts deleted file mode 100644 index 0093487..0000000 --- a/camera/sepolicy/vendor/property_contexts +++ /dev/null @@ -1,4 +0,0 @@ -vendor.camera.debug. u:object_r:vendor_camera_debug_prop:s0 -persist.vendor.camera.pbcs.debug. u:object_r:vendor_camera_pbcs_debug_prop:s0 -vendor.camera.pbcs.debug. u:object_r:vendor_camera_pbcs_debug_prop:s0 - diff --git a/camera/sepolicy/vendor/service.te b/camera/sepolicy/vendor/service.te deleted file mode 100644 index 757bf6d..0000000 --- a/camera/sepolicy/vendor/service.te +++ /dev/null @@ -1,3 +0,0 @@ -type hal_pixel_remote_camera_service, hal_service_type, protected_service, service_manager_type; - -type vendor_image_processing_hal_service, hal_service_type, protected_service, service_manager_type; diff --git a/camera/sepolicy/vendor/service_contexts b/camera/sepolicy/vendor/service_contexts deleted file mode 100644 index 7a2d6ff..0000000 --- a/camera/sepolicy/vendor/service_contexts +++ /dev/null @@ -1,3 +0,0 @@ -com.google.pixel.camera.connectivity.hal.provider.ICameraProvider/default u:object_r:hal_pixel_remote_camera_service:s0 - -com.google.android.imageprocessing.hal.IImageProcessingHal/default u:object_r:vendor_image_processing_hal_service:s0 diff --git a/camera/sepolicy/vendor/vendor_pbcs_app.te b/camera/sepolicy/vendor/vendor_pbcs_app.te deleted file mode 100644 index 965ef54..0000000 --- a/camera/sepolicy/vendor/vendor_pbcs_app.te +++ /dev/null @@ -1,12 +0,0 @@ -# Allow PBCS to add the ServiceBinder service to ServiceManager. -add_service(vendor_pbcs_app, camera_binder_service); -# Allow PBCS to add the LyricConfigProvider service to ServiceManager. -add_service(vendor_pbcs_app, camera_lyricconfigprovider_service); -# Allow PBCS to add the CameraIdRemapper service to ServiceManager. -add_service(vendor_pbcs_app, camera_cameraidremapper_service); - -# Allow PBCS to read debug system properties of the form vendor.camera.pbcs.debug.* -# and persist.vendor.camera.pbcs.debug.* -get_prop(vendor_pbcs_app, vendor_camera_pbcs_debug_prop); - -binder_call(vendor_pbcs_app, hal_camera_default); diff --git a/camera/sepolicy/vendor/vendor_pcs_app.te b/camera/sepolicy/vendor/vendor_pcs_app.te deleted file mode 100644 index 91102fb..0000000 --- a/camera/sepolicy/vendor/vendor_pcs_app.te +++ /dev/null @@ -1,23 +0,0 @@ -allow vendor_pcs_app { - camera_lyricconfigprovider_service - camera_cameraidremapper_service - edgetpu_app_service -}:service_manager find; - -allow vendor_pcs_app hal_pixel_remote_camera_service:service_manager add; - -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 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 port:tcp_socket name_connect; -allow vendor_pcs_app port:udp_socket name_bind; -allow vendor_pcs_app netd:unix_stream_socket connectto; -allow vendor_pcs_app node:udp_socket node_bind; - -allow netd vendor_pcs_app:unpriv_socket_class_set create_socket_perms_no_ioctl; -allow netd vendor_pcs_app:fd use; diff --git a/camera/vendor-apex-allowlist-lyric.xml b/camera/vendor-apex-allowlist-lyric.xml deleted file mode 100644 index 2bcdb72..0000000 --- a/camera/vendor-apex-allowlist-lyric.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/camera/vendor.android.hardware.camera.preview-dis.xml b/camera/vendor.android.hardware.camera.preview-dis.xml deleted file mode 100644 index ae54eef..0000000 --- a/camera/vendor.android.hardware.camera.preview-dis.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/check_current_prebuilt/check_current_prebuilt.mk b/check_current_prebuilt/check_current_prebuilt.mk deleted file mode 100644 index 93c103e..0000000 --- a/check_current_prebuilt/check_current_prebuilt.mk +++ /dev/null @@ -1,32 +0,0 @@ -PIXEL_PREBUILT_SYMLINK_PATH=$(OUT_DIR)/pixel -$(shell rm -rf pixel_current_*) -$(shell rm -rf $(PIXEL_PREBUILT_SYMLINK_PATH)/pixel_current_*) -$(shell mkdir -p $(PIXEL_PREBUILT_SYMLINK_PATH)) - -# Create symlink for bootloader -$(shell rm -f "pixel_current_bootloader") -ifdef BOOTLOADER_FILE_PATH -$(shell ln -sf ../../${BOOTLOADER_FILE_PATH} $(PIXEL_PREBUILT_SYMLINK_PATH)/"pixel_current_bootloader") -else ifdef BOOTLOADER_RADIO_FILE_PATH -$(shell ln -sf ../../${BOOTLOADER_RADIO_FILE_PATH} $(PIXEL_PREBUILT_SYMLINK_PATH)/"pixel_current_bootloader") -endif - -# Create symlink for kernel -$(shell rm -f "pixel_current_kernel") -ifdef TARGET_KERNEL_DIR -$(shell ln -sf ../../${TARGET_KERNEL_DIR} $(PIXEL_PREBUILT_SYMLINK_PATH)/"pixel_current_kernel") -endif - -# Create symlink for radio -$(shell rm -f "pixel_current_radio") -ifdef RADIO_FILE_PATH -$(shell ln -sf ../../${RADIO_FILE_PATH} $(PIXEL_PREBUILT_SYMLINK_PATH)/"pixel_current_radio") -else ifdef BOOTLOADER_RADIO_FILE_PATH -$(shell ln -sf ../../${BOOTLOADER_RADIO_FILE_PATH} $(PIXEL_PREBUILT_SYMLINK_PATH)/"pixel_current_radio") -endif - -# Create symlink for radiocfg -$(shell rm -f "pixel_current_radiocfg") -ifdef SRC_MDM_CFG_DIR -$(shell ln -sf ../../${SRC_MDM_CFG_DIR} $(PIXEL_PREBUILT_SYMLINK_PATH)/"pixel_current_radiocfg") -endif diff --git a/chre/README.txt b/chre/README.txt deleted file mode 100644 index 3bdea2b..0000000 --- a/chre/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -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. diff --git a/chre/hal.mk b/chre/hal.mk deleted file mode 100644 index 13ebb7f..0000000 --- a/chre/hal.mk +++ /dev/null @@ -1,2 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/chre/sepolicy/ -PRODUCT_PACKAGES += android.hardware.contexthub-service.generic \ No newline at end of file diff --git a/chre/sepolicy/file_contexts b/chre/sepolicy/file_contexts deleted file mode 100644 index 0659579..0000000 --- a/chre/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/android\.hardware\.contexthub-service\.generic u:object_r:hal_contexthub_default_exec:s0 diff --git a/chre/sepolicy/hal_contexthub_default.te b/chre/sepolicy/hal_contexthub_default.te deleted file mode 100644 index 50e7ca3..0000000 --- a/chre/sepolicy/hal_contexthub_default.te +++ /dev/null @@ -1,40 +0,0 @@ -# -# 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) - -# Allow access for AoC properties. -get_prop(hal_contexthub_default, vendor_aoc_prop) diff --git a/chre/sepolicy/property.te b/chre/sepolicy/property.te deleted file mode 100644 index f2a98eb..0000000 --- a/chre/sepolicy/property.te +++ /dev/null @@ -1 +0,0 @@ -vendor_internal_prop(vendor_chre_hal_prop) \ No newline at end of file diff --git a/chre/sepolicy/property_contexts b/chre/sepolicy/property_contexts deleted file mode 100644 index f3d3fd8..0000000 --- a/chre/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.chre.multiclient_hal u:object_r:vendor_chre_hal_prop:s0 \ No newline at end of file diff --git a/chre/sepolicy/vendor_init.te b/chre/sepolicy/vendor_init.te deleted file mode 100644 index d1a70fe..0000000 --- a/chre/sepolicy/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, vendor_chre_hal_prop) \ No newline at end of file diff --git a/dauntless/Android.bp b/dauntless/Android.bp deleted file mode 100644 index bd365a7..0000000 --- a/dauntless/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_gsc.sh", - src: "dump_gsc.sh", - vendor: true, - sub_dir: "dump", -} diff --git a/dauntless/dump_gsc.sh b/dauntless/dump_gsc.sh deleted file mode 100644 index 7966d1b..0000000 --- a/dauntless/dump_gsc.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/vendor/bin/sh -echo "Citadel VERSION\n" -vendor/bin/hw/citadel_updater -lv -echo "Citadel STATS\n" -vendor/bin/hw/citadel_updater --stats -echo "GSC DEBUG DUMP\n" -vendor/bin/hw/citadel_updater -D diff --git a/dauntless/gsc.mk b/dauntless/gsc.mk deleted file mode 100644 index 80f115a..0000000 --- a/dauntless/gsc.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Dauntless -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dauntless/sepolicy diff --git a/dauntless/sepolicy/citadel_provision.te b/dauntless/sepolicy/citadel_provision.te deleted file mode 100644 index 5605085..0000000 --- a/dauntless/sepolicy/citadel_provision.te +++ /dev/null @@ -1,6 +0,0 @@ -type citadel_provision, domain; -type citadel_provision_exec, exec_type, vendor_file_type, file_type; - -userdebug_or_eng(` - init_daemon_domain(citadel_provision) -') diff --git a/dauntless/sepolicy/citadeld.te b/dauntless/sepolicy/citadeld.te deleted file mode 100644 index 60c633c..0000000 --- a/dauntless/sepolicy/citadeld.te +++ /dev/null @@ -1,15 +0,0 @@ -type citadeld, domain; -type citadeld_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(citadeld) - -add_service(citadeld, citadeld_service) -binder_use(citadeld) -vndbinder_use(citadeld) -binder_call(citadeld, system_server) - -allow citadeld citadel_device:chr_file rw_file_perms; -allow citadeld fwk_stats_service:service_manager find; -allow citadeld hal_power_stats_vendor_service:service_manager find; - -set_prop(citadeld, vendor_nos_citadel_version); diff --git a/dauntless/sepolicy/device.te b/dauntless/sepolicy/device.te deleted file mode 100644 index f63186f..0000000 --- a/dauntless/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type citadel_device, dev_type; diff --git a/dauntless/sepolicy/dump_gsc.te b/dauntless/sepolicy/dump_gsc.te deleted file mode 100644 index 8a3580b..0000000 --- a/dauntless/sepolicy/dump_gsc.te +++ /dev/null @@ -1,12 +0,0 @@ -type dump_gsc, domain; -type dump_gsc_exec, exec_type, vendor_file_type, file_type; -domain_auto_trans(hal_dumpstate_default, dump_gsc_exec, dump_gsc) -hal_client_domain(dump_gsc, hal_dumpstate) - -allow dump_gsc dumpstate:fd use; -allow dump_gsc dumpstate:fifo_file { write getattr }; -allow dump_gsc shell_data_file:file { write getattr }; -allow dump_gsc citadel_updater:file execute_no_trans; -allow dump_gsc citadeld_service:service_manager find; -binder_call(dump_gsc, citadeld) -vndbinder_use(dump_gsc) diff --git a/dauntless/sepolicy/fastbootd.te b/dauntless/sepolicy/fastbootd.te deleted file mode 100644 index c8c0e29..0000000 --- a/dauntless/sepolicy/fastbootd.te +++ /dev/null @@ -1,3 +0,0 @@ -recovery_only(` - allow fastbootd citadel_device:chr_file rw_file_perms; -') diff --git a/dauntless/sepolicy/file.te b/dauntless/sepolicy/file.te deleted file mode 100644 index cfc0dea..0000000 --- a/dauntless/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type citadel_updater, vendor_file_type, file_type; diff --git a/dauntless/sepolicy/file_contexts b/dauntless/sepolicy/file_contexts deleted file mode 100644 index 0fba0da..0000000 --- a/dauntless/sepolicy/file_contexts +++ /dev/null @@ -1,13 +0,0 @@ -/vendor/bin/dump/dump_gsc\.sh u:object_r:dump_gsc_exec:s0 -/vendor/bin/CitadelProvision u:object_r:citadel_provision_exec:s0 -/vendor/bin/hw/init_citadel u:object_r:init_citadel_exec:s0 -/vendor/bin/hw/android\.hardware\.security\.keymint-service\.citadel u:object_r:hal_keymint_citadel_exec:s0 -/vendor/bin/hw/android\.hardware\.weaver@1\.0-service\.citadel u:object_r:hal_weaver_citadel_exec:s0 -/vendor/bin/hw/android\.hardware\.weaver-service\.citadel u:object_r:hal_weaver_citadel_exec:s0 -/vendor/bin/hw/android\.hardware\.identity@1\.0-service\.citadel u:object_r:hal_identity_citadel_exec:s0 -/vendor/bin/hw/android\.hardware\.authsecret-service\.citadel u:object_r:hal_authsecret_citadel_exec:s0 -/vendor/bin/hw/android\.hardware\.oemlock-service\.citadel u:object_r:hal_oemlock_citadel_exec:s0 -/vendor/bin/hw/citadel_updater u:object_r:citadel_updater:s0 -/vendor/bin/hw/citadeld u:object_r:citadeld_exec:s0 - -/dev/gsc0 u:object_r:citadel_device:s0 diff --git a/dauntless/sepolicy/hal_authsecret_citadel.te b/dauntless/sepolicy/hal_authsecret_citadel.te deleted file mode 100644 index 029d957..0000000 --- a/dauntless/sepolicy/hal_authsecret_citadel.te +++ /dev/null @@ -1,9 +0,0 @@ -type hal_authsecret_citadel, domain; -type hal_authsecret_citadel_exec, exec_type, vendor_file_type, file_type; - -vndbinder_use(hal_authsecret_citadel) -binder_call(hal_authsecret_citadel, citadeld) -allow hal_authsecret_citadel citadeld_service:service_manager find; - -hal_server_domain(hal_authsecret_citadel, hal_authsecret) -init_daemon_domain(hal_authsecret_citadel) diff --git a/dauntless/sepolicy/hal_identity_citadel.te b/dauntless/sepolicy/hal_identity_citadel.te deleted file mode 100644 index c181e27..0000000 --- a/dauntless/sepolicy/hal_identity_citadel.te +++ /dev/null @@ -1,11 +0,0 @@ -type hal_identity_citadel, domain; -type hal_identity_citadel_exec, exec_type, vendor_file_type, file_type; - -vndbinder_use(hal_identity_citadel) -binder_call(hal_identity_citadel, citadeld) -allow hal_identity_citadel citadeld_service:service_manager find; -allow hal_identity_citadel hal_keymint_citadel:binder call; - -hal_server_domain(hal_identity_citadel, hal_identity) -hal_server_domain(hal_identity_citadel, hal_keymint) -init_daemon_domain(hal_identity_citadel) diff --git a/dauntless/sepolicy/hal_keymint_citadel.te b/dauntless/sepolicy/hal_keymint_citadel.te deleted file mode 100644 index e1a6177..0000000 --- a/dauntless/sepolicy/hal_keymint_citadel.te +++ /dev/null @@ -1,9 +0,0 @@ -type hal_keymint_citadel, domain; -type hal_keymint_citadel_exec, exec_type, vendor_file_type, file_type; - -hal_server_domain(hal_keymint_citadel, hal_keymint) -init_daemon_domain(hal_keymint_citadel) -vndbinder_use(hal_keymint_citadel) -get_prop(hal_keymint_citadel, vendor_security_patch_level_prop) -allow hal_keymint_citadel citadeld_service:service_manager find; -binder_call(hal_keymint_citadel, citadeld) diff --git a/dauntless/sepolicy/hal_oemlock_citadel.te b/dauntless/sepolicy/hal_oemlock_citadel.te deleted file mode 100644 index d3ff719..0000000 --- a/dauntless/sepolicy/hal_oemlock_citadel.te +++ /dev/null @@ -1,9 +0,0 @@ -type hal_oemlock_citadel, domain; -type hal_oemlock_citadel_exec, exec_type, vendor_file_type, file_type; - -vndbinder_use(hal_oemlock_citadel) -binder_call(hal_oemlock_citadel, citadeld) -allow hal_oemlock_citadel citadeld_service:service_manager find; - -hal_server_domain(hal_oemlock_citadel, hal_oemlock) -init_daemon_domain(hal_oemlock_citadel) diff --git a/dauntless/sepolicy/hal_weaver_citadel.te b/dauntless/sepolicy/hal_weaver_citadel.te deleted file mode 100644 index 3c5ca8e..0000000 --- a/dauntless/sepolicy/hal_weaver_citadel.te +++ /dev/null @@ -1,14 +0,0 @@ -type hal_weaver_citadel, domain; -type hal_weaver_citadel_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(hal_weaver_citadel) -hal_server_domain(hal_weaver_citadel, hal_weaver) -hal_server_domain(hal_weaver_citadel, hal_oemlock) -hal_server_domain(hal_weaver_citadel, hal_authsecret) -vndbinder_use(hal_weaver_citadel) -binder_call(hal_weaver_citadel, citadeld) - -allow hal_weaver_citadel citadeld_service:service_manager find; - -# Allow callbacks -allow citadeld hal_weaver_citadel:binder call; diff --git a/dauntless/sepolicy/init_citadel.te b/dauntless/sepolicy/init_citadel.te deleted file mode 100644 index 2e986d0..0000000 --- a/dauntless/sepolicy/init_citadel.te +++ /dev/null @@ -1,15 +0,0 @@ -type init_citadel, domain; -type init_citadel_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(init_citadel) - -# Citadel communication must be via citadeld -vndbinder_use(init_citadel) -binder_call(init_citadel, citadeld) -allow init_citadel citadeld_service:service_manager find; - -# Many standard utils are actually vendor_toolbox (like xxd) -allow init_citadel vendor_toolbox_exec:file rx_file_perms; - -# init_citadel needs to invoke citadel_updater -allow init_citadel citadel_updater:file rx_file_perms; diff --git a/dauntless/sepolicy/property.te b/dauntless/sepolicy/property.te deleted file mode 100644 index 2e1c4ec..0000000 --- a/dauntless/sepolicy/property.te +++ /dev/null @@ -1 +0,0 @@ -vendor_internal_prop(vendor_nos_citadel_version) diff --git a/dauntless/sepolicy/property_contexts b/dauntless/sepolicy/property_contexts deleted file mode 100644 index 835de17..0000000 --- a/dauntless/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.nos.citadel.version u:object_r:vendor_nos_citadel_version:s0 diff --git a/dauntless/sepolicy/recovery.te b/dauntless/sepolicy/recovery.te deleted file mode 100644 index c68244f..0000000 --- a/dauntless/sepolicy/recovery.te +++ /dev/null @@ -1,3 +0,0 @@ -recovery_only(` - allow recovery citadel_device:chr_file rw_file_perms; -') diff --git a/dauntless/sepolicy/service_contexts b/dauntless/sepolicy/service_contexts deleted file mode 100644 index ac6a186..0000000 --- a/dauntless/sepolicy/service_contexts +++ /dev/null @@ -1,3 +0,0 @@ -android.hardware.security.keymint.IKeyMintDevice/strongbox u:object_r:hal_keymint_service:s0 -android.hardware.security.sharedsecret.ISharedSecret/strongbox u:object_r:hal_sharedsecret_service:s0 -android.hardware.security.keymint.IRemotelyProvisionedComponent/strongbox u:object_r:hal_remotelyprovisionedcomponent_service:s0 diff --git a/dauntless/sepolicy/vndservice.te b/dauntless/sepolicy/vndservice.te deleted file mode 100644 index 880c09c..0000000 --- a/dauntless/sepolicy/vndservice.te +++ /dev/null @@ -1 +0,0 @@ -type citadeld_service, vndservice_manager_type; diff --git a/dauntless/sepolicy/vndservice_contexts b/dauntless/sepolicy/vndservice_contexts deleted file mode 100644 index b4df996..0000000 --- a/dauntless/sepolicy/vndservice_contexts +++ /dev/null @@ -1 +0,0 @@ -android.hardware.citadel.ICitadeld u:object_r:citadeld_service:s0 diff --git a/dauntless/sepolicy/vndservicemanager.te b/dauntless/sepolicy/vndservicemanager.te deleted file mode 100644 index 335cd2b..0000000 --- a/dauntless/sepolicy/vndservicemanager.te +++ /dev/null @@ -1 +0,0 @@ -binder_call(vndservicemanager, hal_keymint_citadel) diff --git a/device.mk b/device.mk deleted file mode 100644 index 7f7288f..0000000 --- a/device.mk +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (C) 2021 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. -# - -ifeq (,$(filter true, $(PRODUCT_WITHOUT_TTS_VOICE_PACKS))) -include device/google/gs-common/tts/voice_packs.mk -endif - -PRODUCT_SOONG_NAMESPACES += \ - device/google/gs-common/powerstats - -# Disable OMX -PRODUCT_PROPERTY_OVERRIDES += \ - vendor.media.omx=0 - -# Installs gsi keys into ramdisk, to boot a developer GSI with verified boot. -$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk) - -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.software.ipsec_tunnel_migration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnel_migration.xml - -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += \ - device/google/gs-common/vintf/framework_compatibility_matrix.xml diff --git a/display/Android.bp b/display/Android.bp deleted file mode 100644 index cd6739b..0000000 --- a/display/Android.bp +++ /dev/null @@ -1,65 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_exynos_display", - srcs: ["exynos/dump_display.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} - -cc_binary { - name: "dump_exynos_second_display", - srcs: ["exynos/dump_second_display.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} - -cc_binary { - name: "dump_pixel_display", - srcs: ["pixel/dump_display.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} - -cc_binary { - name: "dump_pixel_second_display", - srcs: ["pixel/dump_second_display.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/display/dump_exynos_display.mk b/display/dump_exynos_display.mk deleted file mode 100644 index 2770d14..0000000 --- a/display/dump_exynos_display.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy/exynos - -PRODUCT_PACKAGES += dump_exynos_display diff --git a/display/dump_exynos_second_display.mk b/display/dump_exynos_second_display.mk deleted file mode 100644 index 5a6afe6..0000000 --- a/display/dump_exynos_second_display.mk +++ /dev/null @@ -1,3 +0,0 @@ -PRODUCT_PACKAGES += dump_exynos_second_display -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display/exynos - diff --git a/display/dump_pixel_display.mk b/display/dump_pixel_display.mk deleted file mode 100644 index e43865b..0000000 --- a/display/dump_pixel_display.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy/pixel - -PRODUCT_PACKAGES += dump_pixel_display diff --git a/display/dump_pixel_second_display.mk b/display/dump_pixel_second_display.mk deleted file mode 100644 index 15cf7fd..0000000 --- a/display/dump_pixel_second_display.mk +++ /dev/null @@ -1,3 +0,0 @@ -PRODUCT_PACKAGES += dump_pixel_second_display -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display/pixel - diff --git a/display/exynos/dump_display.cpp b/display/exynos/dump_display.cpp deleted file mode 100644 index 2e03a63..0000000 --- a/display/exynos/dump_display.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - -int main() { - setbuf(stdout, NULL); - dumpFileContent("DECON-0 counters", "/sys/class/drm/card0/device/decon0/counters"); - dumpFileContent("CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event"); - runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v"); - - dumpFileContent("Primary panel name", "/sys/class/drm/card0/device/primary-panel/panel_name"); - dumpFileContent("Primary panel extra info", "/sys/class/drm/card0/device/primary-panel/panel_extinfo"); - dumpFileContent("Primary panel power Vreg", "/sys/class/drm/card0/device/primary-panel/panel_pwr_vreg"); - dumpFileContent("Primary panel power mode register", "/sys/class/drm/card0/device/primary-panel/power_mode"); - return 0; -} diff --git a/display/exynos/dump_second_display.cpp b/display/exynos/dump_second_display.cpp deleted file mode 100644 index c05ce9a..0000000 --- a/display/exynos/dump_second_display.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 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. - */ -#include - -int main() { - dumpFileContent("DECON-1 counters", "/sys/class/drm/card0/device/decon1/counters"); - dumpFileContent("CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event"); - - dumpFileContent("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name"); - dumpFileContent("Secondary panel extra info", "/sys/class/drm/card0/device/secondary-panel/panel_extinfo"); - dumpFileContent("Secondary panel power mode register", "/sys/class/drm/card0/device/secondary-panel/power_mode"); - return 0; -} diff --git a/display/pixel/dump_display.cpp b/display/pixel/dump_display.cpp deleted file mode 100644 index b4a2d25..0000000 --- a/display/pixel/dump_display.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - -int main() { - setbuf(stdout, NULL); - dumpFileContent("CRTC-0 status", "/sys/kernel/debug/dri/0/crtc-0/status"); - dumpFileContent("DRM State", "/sys/kernel/debug/dri/0/state"); - runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v"); - - dumpFileContent("Primary panel name", "/sys/class/drm/card0/device/primary-panel/panel_name"); - dumpFileContent("Primary panel extra info", "/sys/class/drm/card0/device/primary-panel/panel_extinfo"); - dumpFileContent("Primary panel power Vreg", "/sys/class/drm/card0/device/primary-panel/panel_pwr_vreg"); - dumpFileContent("Primary panel power mode register", "/sys/class/drm/card0/device/primary-panel/power_mode"); - return 0; -} diff --git a/display/pixel/dump_second_display.cpp b/display/pixel/dump_second_display.cpp deleted file mode 100644 index 92e6e99..0000000 --- a/display/pixel/dump_second_display.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 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. - */ -#include - -int main() { - dumpFileContent("CRTC-1 status", "/sys/kernel/debug/dri/0/crtc-1/status"); - - dumpFileContent("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name"); - dumpFileContent("Secondary panel extra info", "/sys/class/drm/card0/device/secondary-panel/panel_extinfo"); - dumpFileContent("Secondary panel power mode register", "/sys/class/drm/card0/device/secondary-panel/power_mode"); - return 0; -} diff --git a/display/sepolicy/exynos/dump_display.te b/display/sepolicy/exynos/dump_display.te deleted file mode 100644 index 0b4f0c7..0000000 --- a/display/sepolicy/exynos/dump_display.te +++ /dev/null @@ -1,15 +0,0 @@ -# Display (dump for bugreport) -pixel_bugreport(dump_exynos_display) - -allow dump_exynos_display sysfs_display:file r_file_perms; -allow dump_exynos_display vendor_displaycolor_service:service_manager find; -binder_call(dump_exynos_display, hal_graphics_composer_default) -allow dump_exynos_display vendor_dumpsys:file execute_no_trans; -allow dump_exynos_display vendor_shell_exec:file execute_no_trans; - -userdebug_or_eng(` - allow dump_exynos_display vendor_dri_debugfs:dir r_dir_perms; - allow dump_exynos_display vendor_dri_debugfs:file r_file_perms; -') -vndbinder_use(dump_exynos_display) - diff --git a/display/sepolicy/exynos/dump_display_userdebug.te b/display/sepolicy/exynos/dump_display_userdebug.te deleted file mode 100644 index 1b8dd11..0000000 --- a/display/sepolicy/exynos/dump_display_userdebug.te +++ /dev/null @@ -1,11 +0,0 @@ -# Display eng/userdebug (dump for bugreport) -pixel_bugreport(dump_exynos_display_userdebug) - -userdebug_or_eng(` - allow dump_exynos_display_userdebug vendor_toolbox_exec:file execute_no_trans; - allow dump_exynos_display_userdebug vendor_log_file:dir search; - allow dump_exynos_display_userdebug vendor_hwc_log_file:dir r_dir_perms; - allow dump_exynos_display_userdebug vendor_hwc_log_file:file r_file_perms; - allow dump_exynos_display_userdebug debugfs_tracing_instances:dir search; - allow dump_exynos_display_userdebug debugfs_tracing_instances:file r_file_perms; -') diff --git a/display/sepolicy/exynos/file.te b/display/sepolicy/exynos/file.te deleted file mode 100644 index e3f2382..0000000 --- a/display/sepolicy/exynos/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type vendor_hwc_log_file, file_type, data_file_type; -type vendor_dri_debugfs, fs_type, debugfs_type; - diff --git a/display/sepolicy/exynos/file_contexts b/display/sepolicy/exynos/file_contexts deleted file mode 100644 index 2a0854f..0000000 --- a/display/sepolicy/exynos/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_exynos_display_userdebug_exec:s0 -/vendor/bin/dump/dump_exynos_display u:object_r:dump_exynos_display_exec:s0 - -/data/vendor/log/hwc(/.*)? u:object_r:vendor_hwc_log_file:s0 - diff --git a/display/sepolicy/exynos/genfs_contexts b/display/sepolicy/exynos/genfs_contexts deleted file mode 100644 index 7c46278..0000000 --- a/display/sepolicy/exynos/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ - -genfscon debugfs /dri/0/crtc- u:object_r:vendor_dri_debugfs:s0 -genfscon sysfs /module/drm/parameters/debug u:object_r:sysfs_display:s0 diff --git a/display/sepolicy/exynos/hal_graphics_composer_default.te b/display/sepolicy/exynos/hal_graphics_composer_default.te deleted file mode 100644 index 86e2d96..0000000 --- a/display/sepolicy/exynos/hal_graphics_composer_default.te +++ /dev/null @@ -1,3 +0,0 @@ -allow hal_graphics_composer_default dump_exynos_display:fifo_file { append write }; -allow hal_graphics_composer_default dump_exynos_display:fd use; - diff --git a/display/sepolicy/exynos/vndservice.te b/display/sepolicy/exynos/vndservice.te deleted file mode 100644 index 5c3693b..0000000 --- a/display/sepolicy/exynos/vndservice.te +++ /dev/null @@ -1,2 +0,0 @@ -type vendor_displaycolor_service, vndservice_manager_type; - diff --git a/display/sepolicy/exynos/vndservice_contexts b/display/sepolicy/exynos/vndservice_contexts deleted file mode 100644 index 9276f97..0000000 --- a/display/sepolicy/exynos/vndservice_contexts +++ /dev/null @@ -1,2 +0,0 @@ -displaycolor u:object_r:vendor_displaycolor_service:s0 - diff --git a/display/sepolicy/pixel/dump_display.te b/display/sepolicy/pixel/dump_display.te deleted file mode 100644 index 5f7c5c0..0000000 --- a/display/sepolicy/pixel/dump_display.te +++ /dev/null @@ -1,15 +0,0 @@ -# Display (dump for bugreport) -pixel_bugreport(dump_pixel_display) - -allow dump_pixel_display sysfs_display:file r_file_perms; -allow dump_pixel_display vendor_displaycolor_service:service_manager find; -binder_call(dump_pixel_display, hal_graphics_composer_default) -allow dump_pixel_display vendor_dumpsys:file execute_no_trans; -allow dump_pixel_display vendor_shell_exec:file execute_no_trans; - -userdebug_or_eng(` - allow dump_pixel_display vendor_dri_debugfs:dir r_dir_perms; - allow dump_pixel_display vendor_dri_debugfs:file r_file_perms; -') -vndbinder_use(dump_pixel_display) - diff --git a/display/sepolicy/pixel/dump_display_userdebug.te b/display/sepolicy/pixel/dump_display_userdebug.te deleted file mode 100644 index 33b9da6..0000000 --- a/display/sepolicy/pixel/dump_display_userdebug.te +++ /dev/null @@ -1,11 +0,0 @@ -# Display eng/userdebug (dump for bugreport) -pixel_bugreport(dump_pixel_display_userdebug) - -userdebug_or_eng(` - allow dump_pixel_display_userdebug vendor_toolbox_exec:file execute_no_trans; - allow dump_pixel_display_userdebug vendor_log_file:dir search; - allow dump_pixel_display_userdebug vendor_hwc_log_file:dir r_dir_perms; - allow dump_pixel_display_userdebug vendor_hwc_log_file:file r_file_perms; - allow dump_pixel_display_userdebug debugfs_tracing_instances:dir search; - allow dump_pixel_display_userdebug debugfs_tracing_instances:file r_file_perms; -') diff --git a/display/sepolicy/pixel/file.te b/display/sepolicy/pixel/file.te deleted file mode 100644 index e3f2382..0000000 --- a/display/sepolicy/pixel/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type vendor_hwc_log_file, file_type, data_file_type; -type vendor_dri_debugfs, fs_type, debugfs_type; - diff --git a/display/sepolicy/pixel/file_contexts b/display/sepolicy/pixel/file_contexts deleted file mode 100644 index 17fb960..0000000 --- a/display/sepolicy/pixel/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_pixel_display_userdebug_exec:s0 -/vendor/bin/dump/dump_pixel_display u:object_r:dump_pixel_display_exec:s0 - -/data/vendor/log/hwc(/.*)? u:object_r:vendor_hwc_log_file:s0 - diff --git a/display/sepolicy/pixel/genfs_contexts b/display/sepolicy/pixel/genfs_contexts deleted file mode 100644 index 4237cc5..0000000 --- a/display/sepolicy/pixel/genfs_contexts +++ /dev/null @@ -1,4 +0,0 @@ - -genfscon debugfs /dri/0/crtc- u:object_r:vendor_dri_debugfs:s0 -genfscon debugfs /dri/0/state u:object_r:vendor_dri_debugfs:s0 -genfscon sysfs /module/drm/parameters/debug u:object_r:sysfs_display:s0 diff --git a/display/sepolicy/pixel/hal_graphics_composer_default.te b/display/sepolicy/pixel/hal_graphics_composer_default.te deleted file mode 100644 index 9e028a0..0000000 --- a/display/sepolicy/pixel/hal_graphics_composer_default.te +++ /dev/null @@ -1,3 +0,0 @@ -allow hal_graphics_composer_default dump_pixel_display:fifo_file { append write }; -allow hal_graphics_composer_default dump_pixel_display:fd use; - diff --git a/display/sepolicy/pixel/vndservice.te b/display/sepolicy/pixel/vndservice.te deleted file mode 100644 index 5c3693b..0000000 --- a/display/sepolicy/pixel/vndservice.te +++ /dev/null @@ -1,2 +0,0 @@ -type vendor_displaycolor_service, vndservice_manager_type; - diff --git a/display/sepolicy/pixel/vndservice_contexts b/display/sepolicy/pixel/vndservice_contexts deleted file mode 100644 index 9276f97..0000000 --- a/display/sepolicy/pixel/vndservice_contexts +++ /dev/null @@ -1,2 +0,0 @@ -displaycolor u:object_r:vendor_displaycolor_service:s0 - diff --git a/display/sepolicy_second_display/exynos/dump_second_display.te b/display/sepolicy_second_display/exynos/dump_second_display.te deleted file mode 100644 index 70e86b8..0000000 --- a/display/sepolicy_second_display/exynos/dump_second_display.te +++ /dev/null @@ -1,9 +0,0 @@ -pixel_bugreport(dump_exynos_second_display) - -allow dump_exynos_second_display sysfs_display:file r_file_perms; - -userdebug_or_eng(` - allow dump_exynos_second_display vendor_dri_debugfs:dir r_dir_perms; - allow dump_exynos_second_display vendor_dri_debugfs:file r_file_perms; -') - diff --git a/display/sepolicy_second_display/exynos/file_contexts b/display/sepolicy_second_display/exynos/file_contexts deleted file mode 100644 index 02150f5..0000000 --- a/display/sepolicy_second_display/exynos/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_exynos_second_display u:object_r:dump_exynos_second_display_exec:s0 - diff --git a/display/sepolicy_second_display/pixel/dump_second_display.te b/display/sepolicy_second_display/pixel/dump_second_display.te deleted file mode 100644 index 12dc81f..0000000 --- a/display/sepolicy_second_display/pixel/dump_second_display.te +++ /dev/null @@ -1,9 +0,0 @@ -pixel_bugreport(dump_pixel_second_display) - -allow dump_pixel_second_display sysfs_display:file r_file_perms; - -userdebug_or_eng(` - allow dump_pixel_second_display vendor_dri_debugfs:dir r_dir_perms; - allow dump_pixel_second_display vendor_dri_debugfs:file r_file_perms; -') - diff --git a/display/sepolicy_second_display/pixel/file_contexts b/display/sepolicy_second_display/pixel/file_contexts deleted file mode 100644 index 686c63a..0000000 --- a/display/sepolicy_second_display/pixel/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_pixel_second_display u:object_r:dump_pixel_second_display_exec:s0 - diff --git a/display_logbuffer/Android.bp b/display_logbuffer/Android.bp deleted file mode 100644 index e2859d9..0000000 --- a/display_logbuffer/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_display_logbuffer", - srcs: ["dump_display_logbuffer.cpp"], - init_rc: ["init.display_logbuffer.rc"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/display_logbuffer/dump.mk b/display_logbuffer/dump.mk deleted file mode 100644 index 9808c1d..0000000 --- a/display_logbuffer/dump.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display_logbuffer/sepolicy - -PRODUCT_PACKAGES += dump_display_logbuffer diff --git a/display_logbuffer/dump_display_logbuffer.cpp b/display_logbuffer/dump_display_logbuffer.cpp deleted file mode 100644 index 7477c8c..0000000 --- a/display_logbuffer/dump_display_logbuffer.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - -const char* logbuffer_paths[][2] = { - {"DSIM0", "/dev/logbuffer_dsim0"}, - {"DSIM1", "/dev/logbuffer_dsim1"}, -}; - -int main() { - for (auto &logbuffer_path : logbuffer_paths) { - if(!access(logbuffer_path[1], R_OK)) { - dumpFileContent(logbuffer_path[0], logbuffer_path[1]); - } - } - - return 0; -} \ No newline at end of file diff --git a/display_logbuffer/init.display_logbuffer.rc b/display_logbuffer/init.display_logbuffer.rc deleted file mode 100644 index 717b7f0..0000000 --- a/display_logbuffer/init.display_logbuffer.rc +++ /dev/null @@ -1,3 +0,0 @@ -on property:ro.build.type=eng - chown system system /dev/logbuffer_dsim0 - chown system system /dev/logbuffer_dsim1 diff --git a/display_logbuffer/sepolicy/device.te b/display_logbuffer/sepolicy/device.te deleted file mode 100644 index 94432f4..0000000 --- a/display_logbuffer/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type display_log_device, dev_type; \ No newline at end of file diff --git a/display_logbuffer/sepolicy/dump_display_logbuffer.te b/display_logbuffer/sepolicy/dump_display_logbuffer.te deleted file mode 100644 index 34da48c..0000000 --- a/display_logbuffer/sepolicy/dump_display_logbuffer.te +++ /dev/null @@ -1,3 +0,0 @@ -pixel_bugreport(dump_display_logbuffer) - -allow dump_display_logbuffer display_log_device:chr_file r_file_perms; \ No newline at end of file diff --git a/display_logbuffer/sepolicy/file_contexts b/display_logbuffer/sepolicy/file_contexts deleted file mode 100644 index 7425214..0000000 --- a/display_logbuffer/sepolicy/file_contexts +++ /dev/null @@ -1,4 +0,0 @@ -/vendor/bin/dump/dump_display_logbuffer u:object_r:dump_display_logbuffer_exec:s0 - -/dev/logbuffer_dsim0 u:object_r:display_log_device:s0 -/dev/logbuffer_dsim1 u:object_r:display_log_device:s0 diff --git a/dump_chip_info/Android.bp b/dump_chip_info/Android.bp deleted file mode 100644 index 4a13160..0000000 --- a/dump_chip_info/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_chip_info", - srcs: ["dump_chip_info.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/dump_chip_info/chip_info.mk b/dump_chip_info/chip_info.mk deleted file mode 100644 index a0d8317..0000000 --- a/dump_chip_info/chip_info.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dump_chip_info/sepolicy - -PRODUCT_PACKAGES += dump_chip_info diff --git a/dump_chip_info/dump_chip_info.cpp b/dump_chip_info/dump_chip_info.cpp deleted file mode 100644 index bbd0065..0000000 --- a/dump_chip_info/dump_chip_info.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 -#include - -int main() { - dumpFileContent("ap_rom_patch_ver", "/sys/devices/system/goog-chip-info/ap_rom_patch_ver"); - dumpFileContent("gpcm_asic_id", "/sys/devices/system/goog-chip-info/gpcm_asic_id"); - dumpFileContent("device_table", "/sys/devices/system/goog-chip-info/device_table"); - dumpFileContent("dvfs_table", "/sys/devices/system/goog-chip-info/dvfs_table"); - dumpFileContent("hw_feature_table", "/sys/devices/system/goog-chip-info/hw_feature_table"); - dumpFileContent("ids_table", "/sys/devices/system/goog-chip-info/ids_table"); - - return 0; -} diff --git a/dump_chip_info/sepolicy/dump_chip_info.te b/dump_chip_info/sepolicy/dump_chip_info.te deleted file mode 100644 index 936d425..0000000 --- a/dump_chip_info/sepolicy/dump_chip_info.te +++ /dev/null @@ -1,3 +0,0 @@ -# -pixel_bugreport(dump_chip_info) -allow dump_chip_info sysfs_chip_info:file r_file_perms; diff --git a/dump_chip_info/sepolicy/file.te b/dump_chip_info/sepolicy/file.te deleted file mode 100644 index 80900b0..0000000 --- a/dump_chip_info/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# -type sysfs_chip_info, sysfs_type, fs_type; diff --git a/dump_chip_info/sepolicy/file_contexts b/dump_chip_info/sepolicy/file_contexts deleted file mode 100644 index b9f4b21..0000000 --- a/dump_chip_info/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_chip_info u:object_r:dump_chip_info_exec:s0 diff --git a/dump_chip_info/sepolicy/genfs_contexts b/dump_chip_info/sepolicy/genfs_contexts deleted file mode 100644 index ce42be1..0000000 --- a/dump_chip_info/sepolicy/genfs_contexts +++ /dev/null @@ -1,6 +0,0 @@ -genfscon sysfs /devices/system/goog-chip-info/ap_rom_patch_ver u:object_r:sysfs_chip_info:s0 -genfscon sysfs /devices/system/goog-chip-info/gpcm_asic_id u:object_r:sysfs_chip_info:s0 -genfscon sysfs /devices/system/goog-chip-info/device_table u:object_r:sysfs_chip_info:s0 -genfscon sysfs /devices/system/goog-chip-info/dvfs_table u:object_r:sysfs_chip_info:s0 -genfscon sysfs /devices/system/goog-chip-info/hw_feature_table u:object_r:sysfs_chip_info:s0 -genfscon sysfs /devices/system/goog-chip-info/ids_table u:object_r:sysfs_chip_info:s0 diff --git a/edgetpu/edgetpu.mk b/edgetpu/edgetpu.mk deleted file mode 100644 index 9f7e1de..0000000 --- a/edgetpu/edgetpu.mk +++ /dev/null @@ -1,35 +0,0 @@ -# TPU logging service -PRODUCT_PACKAGES += \ - android.hardware.edgetpu.logging@service-edgetpu-logging -# TPU NN AIDL HAL -PRODUCT_PACKAGES += \ - android.hardware.neuralnetworks@service-darwinn-aidl -# TPU application service -PRODUCT_PACKAGES += \ - vendor.google.edgetpu_app_service@1.0-service -# TPU vendor service -PRODUCT_PACKAGES += \ - vendor.google.edgetpu_vendor_service@1.0-service -# TPU HAL client library -PRODUCT_PACKAGES += \ - libedgetpu_client.google -# TPU metrics logger library -PRODUCT_PACKAGES += \ - libmetrics_logger -# TPU TFlite Delegate -PRODUCT_PACKAGES += \ - libedgetpu_util -# TPU Tachyon HAL service -PRODUCT_PACKAGES += com.google.edgetpu.tachyon-service -# TPU Tachyon C API library -PRODUCT_PACKAGES += libedgetpu_tachyon.google - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/edgetpu/sepolicy - -# Tflite Darwinn delegate property -PRODUCT_VENDOR_PROPERTIES += vendor.edgetpu.tflite_delegate.force_disable_io_coherency=0 - -# Edgetpu CPU scheduler property -PRODUCT_VENDOR_PROPERTIES += vendor.edgetpu.cpu_scheduler.policy=FIFO -PRODUCT_VENDOR_PROPERTIES += vendor.edgetpu.cpu_scheduler.priority=99 - diff --git a/edgetpu/sepolicy/appdomain.te b/edgetpu/sepolicy/appdomain.te deleted file mode 100644 index d3239ab..0000000 --- a/edgetpu/sepolicy/appdomain.te +++ /dev/null @@ -1,8 +0,0 @@ -# Allow apps to read tflite DarwiNN delegate properties -get_prop(appdomain, vendor_tflite_delegate_prop) - -# Allow apps to read DarwiNN runtime properties -get_prop(appdomain, vendor_edgetpu_runtime_prop) - -# Allow apps to read hetero runtime properties -get_prop(appdomain, vendor_hetero_runtime_prop) diff --git a/edgetpu/sepolicy/device.te b/edgetpu/sepolicy/device.te deleted file mode 100644 index 78e918a..0000000 --- a/edgetpu/sepolicy/device.te +++ /dev/null @@ -1,2 +0,0 @@ -# EdgeTPU device (DarwiNN) -type edgetpu_device, dev_type, mlstrustedobject, isolated_compute_allowed_device; diff --git a/edgetpu/sepolicy/edgetpu_app_service.te b/edgetpu/sepolicy/edgetpu_app_service.te deleted file mode 100644 index 838f476..0000000 --- a/edgetpu/sepolicy/edgetpu_app_service.te +++ /dev/null @@ -1,49 +0,0 @@ -# EdgeTPU app server process which runs the EdgeTPU binder service. -type edgetpu_app_server, coredomain, domain; -type edgetpu_app_server_exec, exec_type, system_file_type, file_type; -init_daemon_domain(edgetpu_app_server) - -# The server will use binder calls. -binder_use(edgetpu_app_server); - -# The server will serve a binder service. -binder_service(edgetpu_app_server); - -# EdgeTPU server to register the service to service_manager. -add_service(edgetpu_app_server, edgetpu_app_service); - -# EdgeTPU service needs to access /dev/abrolhos. -allow edgetpu_app_server edgetpu_device:chr_file rw_file_perms; -allow edgetpu_app_server sysfs_edgetpu:dir r_dir_perms; -allow edgetpu_app_server sysfs_edgetpu:file rw_file_perms; - -# Applications are not allowed to open the EdgeTPU device directly. -neverallow appdomain edgetpu_device:chr_file { open }; - -# Allow EdgeTPU service to access the Package Manager service. -allow edgetpu_app_server package_native_service:service_manager find; -binder_call(edgetpu_app_server, system_server); - -# Allow EdgeTPU service to read EdgeTPU service related system properties. -get_prop(edgetpu_app_server, vendor_edgetpu_service_prop); -# Allow EdgeTPU service to read device_configs that are set by the cloud server. -get_prop(edgetpu_app_server, device_config_edgetpu_native_prop); - -# Allow EdgeTPU service to generate Perfetto traces. -perfetto_producer(edgetpu_app_server); - -# Allow EdgeTPU service to connect to the EdgeTPU vendor version of the service. -allow edgetpu_app_server edgetpu_vendor_service:service_manager find; -binder_call(edgetpu_app_server, edgetpu_vendor_server); - -# Allow EdgeTPU service to log to stats service. (metrics) -allow edgetpu_app_server fwk_stats_service:service_manager find; - -# Allow mlock without size restriction -allow edgetpu_app_server self:capability ipc_lock; - -# Need to effectively read file mapped file when mmap + mlocked. -allow edgetpu_app_server privapp_data_file:file { map read}; - -# For shell level testing of mlock -allow edgetpu_app_server shell_data_file:file { map read}; diff --git a/edgetpu/sepolicy/edgetpu_dba_service.te b/edgetpu/sepolicy/edgetpu_dba_service.te deleted file mode 100644 index f6ecd09..0000000 --- a/edgetpu/sepolicy/edgetpu_dba_service.te +++ /dev/null @@ -1,55 +0,0 @@ -# EdgeTPU DBA service. -type edgetpu_dba_server, domain; -type edgetpu_dba_server_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(edgetpu_dba_server) - -# The vendor service will use binder calls. -binder_use(edgetpu_dba_server); - -# The vendor service will serve a binder service. -binder_service(edgetpu_dba_server); - -# EdgeTPU DBA service to register the service to service_manager. -add_service(edgetpu_dba_server, edgetpu_dba_service); - -# Allow EdgeTPU DBA service to access the edgetpu_app_service. -allow edgetpu_dba_server edgetpu_app_service:service_manager find; -binder_call(edgetpu_dba_server, edgetpu_app_server); - -# Allow EdgeTPU DBA service to look for TPU instance in /dev/edgetpu or /dev/edgetpu-soc. -allow edgetpu_dba_server edgetpu_device:chr_file rw_file_perms; - -# Allow EdgeTPU DBA service to request power hints from the Power Service. -hal_client_domain(edgetpu_dba_server, hal_power) - -# Allow EdgeTPU DBA service to access hardware buffers and ION memory. -allow edgetpu_dba_server hal_allocator:fd use; -allow edgetpu_dba_server hal_graphics_mapper_hwservice:hwservice_manager find; -allow edgetpu_dba_server hal_graphics_allocator:fd use; -allow edgetpu_dba_server gpu_device:chr_file rw_file_perms; -allow edgetpu_dba_server gpu_device:dir r_dir_perms; -allow edgetpu_dba_server ion_device:chr_file r_file_perms; - -# Allow EdgeTPU DBA service to read the overcommit_memory info. -allow edgetpu_dba_server proc_overcommit_memory:file r_file_perms; - -# Allow EdgeTPU DBA service to read the kernel version. -# This is done inside the InitGoogle. -allow edgetpu_dba_server proc_version:file r_file_perms; - -# Allow EdgeTPU DBA service to send trace packets to Perfetto with SELinux enabled -# under userdebug builds. -userdebug_or_eng(`perfetto_producer(edgetpu_dba_server)') - -# Allow EdgeTPU DBA service to read tflite DarwiNN delegate properties -get_prop(edgetpu_dba_server, vendor_tflite_delegate_prop) -# Allow EdgeTPU DBA service to read DarwiNN runtime properties -get_prop(edgetpu_dba_server, vendor_edgetpu_runtime_prop) -# Allow EdgeTPU DBA service to read hetero runtime properties -get_prop(edgetpu_dba_server, vendor_hetero_runtime_prop) -# Allow EdgeTPU DBA service to read EdgeTPU CPU scheduler properties -get_prop(edgetpu_dba_server, vendor_edgetpu_cpu_scheduler_prop) - -# Allow DMA Buf access. -allow edgetpu_dba_server dmabuf_system_heap_device:chr_file r_file_perms; - diff --git a/edgetpu/sepolicy/edgetpu_logging.te b/edgetpu/sepolicy/edgetpu_logging.te deleted file mode 100644 index 2cd9ea4..0000000 --- a/edgetpu/sepolicy/edgetpu_logging.te +++ /dev/null @@ -1,15 +0,0 @@ -type edgetpu_logging, domain; -type edgetpu_logging_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(edgetpu_logging) - -# The logging service accesses /dev/ -allow edgetpu_logging edgetpu_device:chr_file rw_file_perms; - -# Allows the logging service to access /sys/class/edgetpu -allow edgetpu_logging sysfs_edgetpu:dir search; -allow edgetpu_logging sysfs_edgetpu:file rw_file_perms; - -# Allow TPU logging service to log to stats service. (metrics) -allow edgetpu_logging fwk_stats_service:service_manager find; -binder_call(edgetpu_logging, system_server); -binder_use(edgetpu_logging) diff --git a/edgetpu/sepolicy/edgetpu_tachyon_service.te b/edgetpu/sepolicy/edgetpu_tachyon_service.te deleted file mode 100644 index 642b469..0000000 --- a/edgetpu/sepolicy/edgetpu_tachyon_service.te +++ /dev/null @@ -1,68 +0,0 @@ -# Tachyon service. -type edgetpu_tachyon_server, domain; -type edgetpu_tachyon_server_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(edgetpu_tachyon_server) - -# The vendor service will use binder calls. -binder_use(edgetpu_tachyon_server); - -# The vendor service will serve a binder service. -binder_service(edgetpu_tachyon_server); - -# Tachyon service to register the service to service_manager. -add_service(edgetpu_tachyon_server, edgetpu_tachyon_service); - -# Allow Tachyon service to access the edgetpu_app_service. -allow edgetpu_tachyon_server edgetpu_app_service:service_manager find; -binder_call(edgetpu_tachyon_server, edgetpu_app_server); - -# Allow Tachyon service to look for TPU instance in /dev/edgetpu or /dev/edgetpu-soc. -allow edgetpu_tachyon_server edgetpu_device:chr_file rw_file_perms; - -# Allow Tachyon service to access hardware buffers and ION memory. -allow edgetpu_tachyon_server hal_allocator:fd use; -allow edgetpu_tachyon_server hal_graphics_mapper_hwservice:hwservice_manager find; -allow edgetpu_tachyon_server hal_graphics_allocator:fd use; -allow edgetpu_tachyon_server gpu_device:chr_file rw_file_perms; -allow edgetpu_tachyon_server gpu_device:dir r_dir_perms; -allow edgetpu_tachyon_server ion_device:chr_file r_file_perms; - -# Allow Tachyon service to access camera hal via binder. -binder_call(edgetpu_tachyon_server, hal_camera_default); - -# Allow Tachyon service to access dmabuf sysytem. -allow edgetpu_tachyon_server dmabuf_system_heap_device:chr_file r_file_perms; - -# Allow Tachyon service to read the overcommit_memory info. -allow edgetpu_tachyon_server proc_overcommit_memory:file r_file_perms; - -# Allow Tachyon service to read the kernel version. -# This is done inside the InitGoogle. -allow edgetpu_tachyon_server proc_version:file r_file_perms; - -# Allow Tachyon service to send trace packets to Perfetto with SELinux enabled -# under userdebug builds. -perfetto_producer(edgetpu_tachyon_server) - -# Allow Tachyon service to read tflite DarwiNN delegate properties -get_prop(edgetpu_tachyon_server, vendor_tflite_delegate_prop) -# Allow Tachyon service to read DarwiNN runtime properties -get_prop(edgetpu_tachyon_server, vendor_edgetpu_runtime_prop) -# Allow Tachyon service to read hetero runtime properties -get_prop(edgetpu_tachyon_server, vendor_hetero_runtime_prop) -# Allow Tachyon service to read EdgeTPU CPU scheduler properties -get_prop(edgetpu_tachyon_server, vendor_edgetpu_cpu_scheduler_prop) - -# Allow mlock without size restriction -allow edgetpu_tachyon_server self:capability ipc_lock; - -# Need to effectively read file mapped file when mmap + mlocked. -allow edgetpu_tachyon_server privapp_data_file:file { map read}; - -# For shell level testing of mlock -userdebug_or_eng(` - allow edgetpu_tachyon_server shell_data_file:file { map read}; -') - -# For shell level testing -binder_call(edgetpu_tachyon_server, shell); diff --git a/edgetpu/sepolicy/edgetpu_vendor_server.te b/edgetpu/sepolicy/edgetpu_vendor_server.te deleted file mode 100644 index 4c03744..0000000 --- a/edgetpu/sepolicy/edgetpu_vendor_server.te +++ /dev/null @@ -1,34 +0,0 @@ -# EdgeTPU vendor service. -type edgetpu_vendor_server, domain; -type edgetpu_vendor_server_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(edgetpu_vendor_server) - -# The vendor service will use binder calls. -binder_use(edgetpu_vendor_server); - -# The vendor service will serve a binder service. -binder_service(edgetpu_vendor_server); - -# EdgeTPU vendor service to register the service to service_manager. -add_service(edgetpu_vendor_server, edgetpu_vendor_service); - -# Allow communications between other vendor services. -allow edgetpu_vendor_server vndbinder_device:chr_file { read write open ioctl map }; - -# Allow EdgeTPU vendor service to access its data files. -allow edgetpu_vendor_server edgetpu_vendor_service_data_file:file create_file_perms; -allow edgetpu_vendor_server edgetpu_vendor_service_data_file:dir create_dir_perms; - -# Allow EdgeTPU vendor service to access Android shared memory allocated -# by the camera hal for on-device compilation. -allow edgetpu_vendor_server hal_camera_default:fd use; - -# Allow EdgeTPU vendor service to read the kernel version. -# This is done inside the InitGoogle. -allow edgetpu_vendor_server proc_version:file r_file_perms; - -# Allow EdgeTPU vendor service to read the overcommit_memory info. -allow edgetpu_vendor_server proc_overcommit_memory:file r_file_perms; - -# Allow EdgeTPU vendor service to read hetero runtime properties -get_prop(edgetpu_vendor_server, vendor_hetero_runtime_prop) diff --git a/edgetpu/sepolicy/file.te b/edgetpu/sepolicy/file.te deleted file mode 100644 index 5b3c8b5..0000000 --- a/edgetpu/sepolicy/file.te +++ /dev/null @@ -1,8 +0,0 @@ -# EdgeTPU sysfs -type sysfs_edgetpu, sysfs_type, fs_type; - -# EdgeTPU hal data file -type hal_neuralnetworks_darwinn_data_file, file_type, data_file_type; - -# EdgeTPU vendor service data file -type edgetpu_vendor_service_data_file, file_type, data_file_type; diff --git a/edgetpu/sepolicy/file_contexts b/edgetpu/sepolicy/file_contexts deleted file mode 100644 index 6190fcf..0000000 --- a/edgetpu/sepolicy/file_contexts +++ /dev/null @@ -1,34 +0,0 @@ -# EdgeTPU logging service -/vendor/bin/hw/android\.hardware\.edgetpu\.logging@service-edgetpu-logging u:object_r:edgetpu_logging_exec:s0 - -# NeuralNetworks file contexts -/vendor/bin/hw/android\.hardware\.neuralnetworks@service-darwinn-aidl u:object_r:hal_neuralnetworks_darwinn_exec:s0 - -# EdgeTPU service binaries and libraries -/system_ext/bin/hw/vendor\.google\.edgetpu_app_service@1\.0-service u:object_r:edgetpu_app_server_exec:s0 - -# EdgeTPU vendor service -/vendor/bin/hw/vendor\.google\.edgetpu_vendor_service@1\.0-service u:object_r:edgetpu_vendor_server_exec:s0 - -# EdgeTPU metrics logging service. -/vendor/lib64/libedgetpu_client\.google\.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 -# EdgeTPU runtime libraries -/vendor/lib64/com\.google\.edgetpu_app_service-V[1-4]-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 Tachyon libraries -/vendor/lib64/libedgetpu_tachyon\.google\.so u:object_r:same_process_hal_file:s0 - -# EdgeTPU data files -/data/vendor/hal_neuralnetworks_darwinn(/.*)? u:object_r:hal_neuralnetworks_darwinn_data_file:s0 -/data/vendor/edgetpu(/.*)? u:object_r:edgetpu_vendor_service_data_file:s0 - -# EdgeTPU DBA service -/vendor/bin/hw/com\.google\.edgetpu.dba-service u:object_r:edgetpu_dba_server_exec:s0 - -# Tachyon service -/vendor/bin/hw/com\.google\.edgetpu.tachyon-service u:object_r:edgetpu_tachyon_server_exec:s0 - -# libfmq.so is dynamically loaded by the Tachyon client-side library libedgetpu_tachyon.google.so -/vendor/lib64/libfmq\.so u:object_r:same_process_hal_file:s0 diff --git a/edgetpu/sepolicy/hal_audio_default.te b/edgetpu/sepolicy/hal_audio_default.te deleted file mode 100644 index 4d58e0b..0000000 --- a/edgetpu/sepolicy/hal_audio_default.te +++ /dev/null @@ -1,30 +0,0 @@ -# Allow the audio hal to access the EdgeTPU service and the -# Android shared memory allocated by the EdgeTPU service for -# on-device compilation. -allow hal_audio_default edgetpu_device:chr_file rw_file_perms; -allow hal_audio_default edgetpu_vendor_service:service_manager find; -binder_call(hal_audio_default, edgetpu_vendor_server) - -# Allow edgetpu_app_service as well, due to the EdgeTpu metrics logging -# library has a dependency on edgetpu_app_service, see b/275016466. -allow hal_audio_default edgetpu_app_service:service_manager find; -binder_call(hal_audio_default, edgetpu_app_server) - -# Allow audio HAL to read tflite Darwinn delegate properties -get_prop(hal_audio_default, vendor_tflite_delegate_prop) - -# Allow audio HAL to read DarwiNN runtime properties -get_prop(hal_audio_default, vendor_edgetpu_runtime_prop) - -# Allow audio HAL to read hetero runtime properties -get_prop(hal_audio_default, vendor_hetero_runtime_prop) - -# Allow DMA Buf access. -allow hal_audio_default dmabuf_system_heap_device:chr_file r_file_perms; - -# Allow audio HAL to connect to the stats service for logging EdgeTpu metrics. -allow hal_audio_default fwk_stats_service:service_manager find; - -# Allow audio HAL to send EdgeTpu trace packets to Perfetto. -# Enable for prod devices, see: go/darwinn-perfetto-critical-events -perfetto_producer(hal_audio_default) diff --git a/edgetpu/sepolicy/hal_camera_default.te b/edgetpu/sepolicy/hal_camera_default.te deleted file mode 100644 index e84f5dc..0000000 --- a/edgetpu/sepolicy/hal_camera_default.te +++ /dev/null @@ -1,15 +0,0 @@ -# Allow camera HAL to read tflite DarwiNN delegate properties -get_prop(hal_camera_default, vendor_tflite_delegate_prop) - -# Allow camera HAL to read DarwiNN runtime properties -get_prop(hal_camera_default, vendor_edgetpu_runtime_prop) - -# Allow camera HAL to read hetero runtime properties -get_prop(hal_camera_default, vendor_hetero_runtime_prop) - -# Allow camera HAL to access tachyon HAL -allow hal_camera_default edgetpu_tachyon_service:service_manager find; - -# Allow camera HAL to communicate with tachyon hal using binder calls -binder_call(hal_camera_default, edgetpu_tachyon_server); - diff --git a/edgetpu/sepolicy/hal_neuralnetworks_darwinn.te b/edgetpu/sepolicy/hal_neuralnetworks_darwinn.te deleted file mode 100644 index abdbcd7..0000000 --- a/edgetpu/sepolicy/hal_neuralnetworks_darwinn.te +++ /dev/null @@ -1,70 +0,0 @@ -# Sepolicies for EdgeTPU -type hal_neuralnetworks_darwinn, domain; -hal_server_domain(hal_neuralnetworks_darwinn, hal_neuralnetworks) - -type hal_neuralnetworks_darwinn_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(hal_neuralnetworks_darwinn) - -# The TPU HAL looks for TPU instance in /dev/abrolhos -allow hal_neuralnetworks_darwinn edgetpu_device:chr_file rw_file_perms; - -# Allow DarwiNN service to use a client-provided fd residing in /vendor/etc/. -allow hal_neuralnetworks_darwinn vendor_configs_file:file r_file_perms; - -# Allow DarwiNN service to access data files. -allow hal_neuralnetworks_darwinn hal_neuralnetworks_darwinn_data_file:file create_file_perms; -allow hal_neuralnetworks_darwinn hal_neuralnetworks_darwinn_data_file:dir rw_dir_perms; - -# Allow DarwiNN service to access unix sockets for IPC. -allow hal_neuralnetworks_darwinn hal_neuralnetworks_darwinn_data_file:sock_file { create unlink rw_file_perms }; - -# Register to hwbinder service. -# add_hwservice() is granted by hal_server_domain + hal_neuralnetworks.te -hwbinder_use(hal_neuralnetworks_darwinn) -get_prop(hal_neuralnetworks_darwinn, hwservicemanager_prop) - -# Allow TPU HAL to read the kernel version. -# This is done inside the InitGoogle. -allow hal_neuralnetworks_darwinn proc_version:file r_file_perms; - -# Allow TPU NNAPI HAL to log to stats service. (metrics) -allow hal_neuralnetworks_darwinn fwk_stats_service:service_manager find; -binder_call(hal_neuralnetworks_darwinn, system_server); -binder_use(hal_neuralnetworks_darwinn) - -# Allow TPU NNAPI HAL to request power hints from the Power Service -hal_client_domain(hal_neuralnetworks_darwinn, hal_power) - -# TPU NNAPI to register the service to service_manager. -add_service(hal_neuralnetworks_darwinn, edgetpu_nnapi_service); - -# Allow TPU NNAPI HAL to read the overcommit_memory info. -allow hal_neuralnetworks_darwinn proc_overcommit_memory:file r_file_perms; - -# Allows the logging service to access /sys/class/edgetpu -allow hal_neuralnetworks_darwinn sysfs_edgetpu:dir r_dir_perms; -allow hal_neuralnetworks_darwinn sysfs_edgetpu:file r_file_perms; - -# Allows the NNAPI HAL to access the edgetpu_app_service -allow hal_neuralnetworks_darwinn edgetpu_app_service:service_manager find; -binder_call(hal_neuralnetworks_darwinn, edgetpu_app_server); - -# Allow NNAPI HAL to send trace packets to Perfetto with SELinux enabled -# under userdebug builds. -userdebug_or_eng(`perfetto_producer(hal_neuralnetworks_darwinn)') - -# Allow NNAPI HAL to read tflite DarwiNN delegate properties -get_prop(hal_neuralnetworks_darwinn, vendor_tflite_delegate_prop) -# Allow NNAPI HAL to read DarwiNN runtime properties -get_prop(hal_neuralnetworks_darwinn, vendor_edgetpu_runtime_prop) -# Allow NNAPI HAL to read hetero runtime properties -get_prop(hal_neuralnetworks_darwinn, vendor_hetero_runtime_prop) - -# Allow DMA Buf access. -allow hal_neuralnetworks_darwinn dmabuf_system_heap_device:chr_file r_file_perms; - -# Allows the NNAPI HAL to access the graphics_allocator_service. -# This is required for shared memory buffer allocation. -# Context:- b/361711471. -hal_client_domain(hal_neuralnetworks_darwinn, hal_graphics_allocator); -allow hal_neuralnetworks_darwinn hal_graphics_allocator_service:service_manager find; diff --git a/edgetpu/sepolicy/priv_app.te b/edgetpu/sepolicy/priv_app.te deleted file mode 100644 index 579cc61..0000000 --- a/edgetpu/sepolicy/priv_app.te +++ /dev/null @@ -1,12 +0,0 @@ -# Allows privileged applications to discover the EdgeTPU service. -allow priv_app edgetpu_app_service:service_manager find; - -# Allows privileged applications to discover the NNAPI TPU service. -allow priv_app edgetpu_nnapi_service:service_manager find; - -# Allows privileged applications to access the EdgeTPU device, except open, -# which is guarded by the EdgeTPU service. -allow priv_app edgetpu_device:chr_file { getattr read write ioctl map }; - -# Allows EdgeTPU Tachyon service to call the app. -binder_call(edgetpu_tachyon_server, priv_app); diff --git a/edgetpu/sepolicy/property.te b/edgetpu/sepolicy/property.te deleted file mode 100644 index f0ec931..0000000 --- a/edgetpu/sepolicy/property.te +++ /dev/null @@ -1,17 +0,0 @@ -# EdgeTPU service requires system public properties -# since it lives under /system_ext/. -system_public_prop(vendor_edgetpu_service_prop) - -# Tflite DarwiNN delegate properties are written once by vendor_init, -# and then read by apps, camera hal, and some DarwiNN vendor services. -system_vendor_config_prop(vendor_tflite_delegate_prop) - -# The EdgeTPU CPU scheduler properties are written once by vendor_init, -# and then read by HAL service. -system_vendor_config_prop(vendor_edgetpu_cpu_scheduler_prop) - -# DarwiNN runtime properties. -system_vendor_config_prop(vendor_edgetpu_runtime_prop) - -# Hetero runtime properties, including tracing levels. -system_vendor_config_prop(vendor_hetero_runtime_prop) diff --git a/edgetpu/sepolicy/property_contexts b/edgetpu/sepolicy/property_contexts deleted file mode 100644 index 76c394f..0000000 --- a/edgetpu/sepolicy/property_contexts +++ /dev/null @@ -1,10 +0,0 @@ -# for EdgeTPU -vendor.edgetpu.service. u:object_r:vendor_edgetpu_service_prop:s0 -vendor.edgetpu.cpu_scheduler. u:object_r:vendor_edgetpu_cpu_scheduler_prop:s0 -vendor.edgetpu.runtime. u:object_r:vendor_edgetpu_runtime_prop:s0 - -# for DarwinnDelegate -vendor.edgetpu.tflite_delegate. u:object_r:vendor_tflite_delegate_prop:s0 - -# for hetero runtime -vendor.google.silicon. u:object_r:vendor_hetero_runtime_prop:s0 diff --git a/edgetpu/sepolicy/service.te b/edgetpu/sepolicy/service.te deleted file mode 100644 index 5ea2006..0000000 --- a/edgetpu/sepolicy/service.te +++ /dev/null @@ -1,7 +0,0 @@ -type edgetpu_nnapi_service, app_api_service, service_manager_type, isolated_compute_allowed_service; -type edgetpu_vendor_service, service_manager_type, hal_service_type; -type edgetpu_dba_service, app_api_service, service_manager_type, isolated_compute_allowed_service; -type edgetpu_tachyon_service, app_api_service, service_manager_type, isolated_compute_allowed_service; - -# EdgeTPU binder service type declaration. -type edgetpu_app_service, service_manager_type, isolated_compute_allowed_service; diff --git a/edgetpu/sepolicy/service_contexts b/edgetpu/sepolicy/service_contexts deleted file mode 100644 index 31684eb..0000000 --- a/edgetpu/sepolicy/service_contexts +++ /dev/null @@ -1,13 +0,0 @@ - -com.google.edgetpu.IEdgeTpuVendorService/default u:object_r:edgetpu_vendor_service:s0 -# TPU NNAPI Service -android.hardware.neuralnetworks.IDevice/google-edgetpu u:object_r:edgetpu_nnapi_service:s0 - -# EdgeTPU service -com.google.edgetpu.IEdgeTpuAppService/default u:object_r:edgetpu_app_service:s0 - -# EdgeTPU DBA Service -com.google.edgetpu.dba.IDevice/default u:object_r:edgetpu_dba_service:s0 - -# Tachyon Service -com.google.edgetpu.tachyon.IComputeService/default u:object_r:edgetpu_tachyon_service:s0 diff --git a/edgetpu/sepolicy/untrusted_app_all.te b/edgetpu/sepolicy/untrusted_app_all.te deleted file mode 100644 index 3c92900..0000000 --- a/edgetpu/sepolicy/untrusted_app_all.te +++ /dev/null @@ -1,9 +0,0 @@ -# Allows applications to discover the EdgeTPU service. -allow untrusted_app_all edgetpu_app_service:service_manager find; - -# Allows applications to access the EdgeTPU device, except open, which is guarded -# by the EdgeTPU service. -allow untrusted_app_all edgetpu_device:chr_file { getattr read write ioctl map }; - -# Allows EdgeTPU Tachyon service to call the app. -binder_call(edgetpu_tachyon_server, untrusted_app_all); diff --git a/edgetpu/sepolicy/vendor_init.te b/edgetpu/sepolicy/vendor_init.te deleted file mode 100644 index d0ee1f9..0000000 --- a/edgetpu/sepolicy/vendor_init.te +++ /dev/null @@ -1,4 +0,0 @@ -# Allow vendor_init to set tflite Darwinn delegate properties -set_prop(vendor_init, vendor_tflite_delegate_prop) -# Allow vendor_init to set the EdgeTPU CPU scheduler properties. -set_prop(vendor_init, vendor_edgetpu_cpu_scheduler_prop) diff --git a/esim/Android.bp b/esim/Android.bp deleted file mode 100644 index a2427f1..0000000 --- a/esim/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -prebuilt_etc { - name: "init.esim-gs.rc", - src: "init.esim-gs.rc", - vendor: true, - sub_dir: "init", -} diff --git a/esim/OWNERS b/esim/OWNERS deleted file mode 100644 index 157ecd6..0000000 --- a/esim/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -kiwonp@google.com -mewan@google.com \ No newline at end of file diff --git a/esim/esim.mk b/esim/esim.mk deleted file mode 100644 index 487f15e..0000000 --- a/esim/esim.mk +++ /dev/null @@ -1,10 +0,0 @@ -## Configuration for eSIM bootstrap - -# Enable eSIM bootstrap by default -PRODUCT_PRODUCT_PROPERTIES += setupwizard.feature.provisioning_profile_mode=true - -# init.rc and sepolcy to conditionally disable eSIM bootstrap -PRODUCT_PACKAGES += init.esim-gs.rc -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/esim/sepolicy/vendor -SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/esim/sepolicy/system_ext/public -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/esim/sepolicy/system_ext/private diff --git a/esim/init.esim-gs.rc b/esim/init.esim-gs.rc deleted file mode 100644 index ce27334..0000000 --- a/esim/init.esim-gs.rc +++ /dev/null @@ -1,11 +0,0 @@ -# Disable bootstrap when bootloader is unlocked in user build -on property:ro.build.type=user && property:ro.boot.flash.locked=0 - setprop setupwizard.feature.provisioning_profile_mode false - -# Disable bootstrap for UGS devices -on property:ro.boot.warranty.sku=UGS - setprop setupwizard.feature.provisioning_profile_mode false - -# Disable bootstrap for DVT devices shipping to non-US carriers -on property:ro.boot.warranty.sku=BOF - setprop setupwizard.feature.provisioning_profile_mode false diff --git a/esim/sepolicy/system_ext/private/gmscore_app.te b/esim/sepolicy/system_ext/private/gmscore_app.te deleted file mode 100644 index 4dc1639..0000000 --- a/esim/sepolicy/system_ext/private/gmscore_app.te +++ /dev/null @@ -1,2 +0,0 @@ -# Allow to read setupwizard_feature_prop -get_prop(gmscore_app, setupwizard_feature_prop) diff --git a/esim/sepolicy/system_ext/private/priv_app.te b/esim/sepolicy/system_ext/private/priv_app.te deleted file mode 100644 index 90bc371..0000000 --- a/esim/sepolicy/system_ext/private/priv_app.te +++ /dev/null @@ -1,2 +0,0 @@ -# Allow to read setupwizard_feature_prop -get_prop(priv_app, setupwizard_feature_prop) diff --git a/esim/sepolicy/system_ext/private/property_contexts b/esim/sepolicy/system_ext/private/property_contexts deleted file mode 100644 index 464a289..0000000 --- a/esim/sepolicy/system_ext/private/property_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# setupwizard -setupwizard.feature.provisioning_profile_mode u:object_r:setupwizard_feature_prop:s0 diff --git a/esim/sepolicy/system_ext/public/property.te b/esim/sepolicy/system_ext/public/property.te deleted file mode 100644 index 96cb3b3..0000000 --- a/esim/sepolicy/system_ext/public/property.te +++ /dev/null @@ -1,2 +0,0 @@ -# setupwizard -system_public_prop(setupwizard_feature_prop) diff --git a/esim/sepolicy/vendor/vendor_init.te b/esim/sepolicy/vendor/vendor_init.te deleted file mode 100644 index c9cb14e..0000000 --- a/esim/sepolicy/vendor/vendor_init.te +++ /dev/null @@ -1,2 +0,0 @@ -# setupwizard -set_prop(vendor_init, setupwizard_feature_prop) diff --git a/euiccpixel_app/euiccpixel_app_st54.mk b/euiccpixel_app/euiccpixel_app_st54.mk deleted file mode 100644 index e96d06c..0000000 --- a/euiccpixel_app/euiccpixel_app_st54.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/euiccpixel_app/sepolicy/common -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/euiccpixel_app/sepolicy/st54 -PRODUCT_PACKAGES += EuiccSupportPixel-P23 diff --git a/euiccpixel_app/sepolicy/common/certs/EuiccSupportPixel.x509.pem b/euiccpixel_app/sepolicy/common/certs/EuiccSupportPixel.x509.pem deleted file mode 100644 index be303df..0000000 --- a/euiccpixel_app/sepolicy/common/certs/EuiccSupportPixel.x509.pem +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF2zCCA8OgAwIBAgIVAIFP2e+Gh4wn4YFsSI7fRB6AXjIsMA0GCSqGSIb3DQEBCwUAMH4xCzAJ -BgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQw -EgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEaMBgGA1UEAxMRRXVpY2NTdXBw -b3J0UGl4ZWwwHhcNMTkwMjI4MTkyMjE4WhcNNDkwMjI4MTkyMjE4WjB+MQswCQYDVQQGEwJVUzET -MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29v -Z2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxGjAYBgNVBAMTEUV1aWNjU3VwcG9ydFBpeGVsMIIC -IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqklePqeltzqnyXVch9eJRXFBRQQIBIJWhcXb -WIP/kZ28ISnQ2SrZisdxqtvRIeInxb7lU1rRQDfqCFSp/vMZ3l25Ryn6OVLFP4bxV1vO797t7Ef/ -amYA1mFKBsD4KLaIGj0/2RpGesneCOb0jWl2yRgIO2Ez7Y4YgWU/IoickZDLp1u6/7e7E/Qq9OXK -aXvtBSzooGrYC7eyKn7O21FOfz5cQRo4BipjJqXG5Ez8Vi+m/dL1IFRZheYttEf3v390vBcb0oJ0 -oYPzLxmnb1LchjZC3yLAknRA0hNt8clvJ3tjXFjtzCGKsQsT4rnvvGFFABJTCf3EdEiwBNS5U4ho -+9+EtH7PpuoC+uVv2rLv/Gb7stlGQGx32KmK2CfKED3PdNqoT7WRx6nvVjCk3i7afdUcxQxcS9td -5r80CB1bQEhS2sWLWB21PJrfMugWUJO5Bwz6u0es8dP+4FAHojIaF6iwB5ZYIuHGcEaOviHm4jOK -rrGMlLqTwuEhq2aVIP55u7XRV98JLs2hlE5DJOWCIsPxybUDiddFvR+yzi/4FimsxJlEmaQAQcki -uJ9DceVP03StPzFJSDRlqa4yF6xkZW5piNoANQ4MyI67V2Qf8g/L1UPYAi4hUMxQGo7Clw2hBRag -ZTm65Xc7+ovBYxl5YaXAmNoJbss34Lw8tdrn4EECAwEAAaNQME4wDAYDVR0TBAUwAwEB/zAdBgNV -HQ4EFgQU+hQdFrOGuCDI+bbebssw9TL5FcYwHwYDVR0jBBgwFoAU+hQdFrOGuCDI+bbebssw9TL5 -FcYwDQYJKoZIhvcNAQELBQADggIBAGmyZHXddei/zUUMowiyi/MTtqXf9hKDEN4zhAXkuiuHxqA9 -Ii0J1Sxz2dd5NkqMmtePKYFSGA884yVm1KAne/uoCWj57IK3jswiRYnKhXa293DxA/K9wY27IGbp -ulSuuxbpjjV2tqGUuoNQGKX7Oy6s0GcibyZFc+LpD7ttGk5QoLC9qQdpXZgUv/yG2B99ERSXLCaL -EWMNP/oVZQOCQGfsFM1fPLn3X0ZuCOQg9bljxFf3jTl+H6PIAhpCjKeeUQYLc41eQkCyR/f67aRB -GvO4YDpXLn9eH23B+26rjPyFiVtMJ/jJZ7UEPeJ3XBj1COS/X7p9gGRS5rtfr9z7XxuMxvG0JU9U -XA+bMfOOfCqflvw6IyUg+oxjBFIhgiP4fxna51+BqpctvB0OeRwUm6y4nN06AwqtD8SteQrEn0b0 -IDWOKlVeh0lJWrDDEHr55dXSF+CbOPUDmMxmGoulOEOy/qSWIQi8BfvdX+e88CmracNRYVffLuQj -pRYN3TeiCJd+6/X9/x1Q8VLW7vOAb6uRyE2lOjX40DYBxK3xSq6J7Vp38f6z0vtQm2sAAQ4xqqon -A9tB5p+nJlYHgSxXOZx3C13Rs/eMmiGCKkSpCTnGCgBC7PfJDdMK6SLw5Gn4oyGoZo4fXbADuHrU -0JD1T1qdCm3aUSEmFgEA4rOL/0K3 ------END CERTIFICATE----- diff --git a/euiccpixel_app/sepolicy/common/euiccpixel_app.te b/euiccpixel_app/sepolicy/common/euiccpixel_app.te deleted file mode 100644 index c38cb24..0000000 --- a/euiccpixel_app/sepolicy/common/euiccpixel_app.te +++ /dev/null @@ -1,27 +0,0 @@ -# Euiccpixel_app -type euiccpixel_app, domain; -app_domain(euiccpixel_app) - -allow euiccpixel_app activity_service:service_manager find; -allow euiccpixel_app netstats_service:service_manager find; -allow euiccpixel_app content_capture_service:service_manager find; -allow euiccpixel_app activity_task_service:service_manager find; -allow euiccpixel_app gpu_service:service_manager find; -allow euiccpixel_app voiceinteraction_service:service_manager find; -allow euiccpixel_app autofill_service:service_manager find; -allow euiccpixel_app sensitive_content_protection_service:service_manager find; -allow euiccpixel_app hint_service:service_manager find; -allow euiccpixel_app audio_service:service_manager find; -allow euiccpixel_app batterystats_service:service_manager find; -allow euiccpixel_app batteryproperties_service:service_manager find; -allow euiccpixel_app permission_checker_service:service_manager find; -allow euiccpixel_app radio_service:service_manager find; -allow euiccpixel_app nfc_service:service_manager find; - -set_prop(euiccpixel_app, vendor_secure_element_prop) -set_prop(euiccpixel_app, vendor_modem_prop) -get_prop(euiccpixel_app, dck_prop) - -# b/265286368 framework UI rendering properties and file access -dontaudit euiccpixel_app default_prop:file { read }; - diff --git a/euiccpixel_app/sepolicy/common/keys.conf b/euiccpixel_app/sepolicy/common/keys.conf deleted file mode 100644 index 7071a2a..0000000 --- a/euiccpixel_app/sepolicy/common/keys.conf +++ /dev/null @@ -1,2 +0,0 @@ -[@EUICCSUPPORTPIXEL] -ALL : device/google/gs-common/euiccpixel_app/sepolicy/common/certs/EuiccSupportPixel.x509.pem diff --git a/euiccpixel_app/sepolicy/common/mac_permissions.xml b/euiccpixel_app/sepolicy/common/mac_permissions.xml deleted file mode 100644 index 0eab982..0000000 --- a/euiccpixel_app/sepolicy/common/mac_permissions.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - diff --git a/euiccpixel_app/sepolicy/common/seapp_contexts b/euiccpixel_app/sepolicy/common/seapp_contexts deleted file mode 100644 index 9501a3a..0000000 --- a/euiccpixel_app/sepolicy/common/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Domain for EuiccSupportPixel -user=_app isPrivApp=true seinfo=EuiccSupportPixel name=com.google.euiccpixel domain=euiccpixel_app type=app_data_file levelFrom=all diff --git a/euiccpixel_app/sepolicy/st54/euiccpixel_app.te b/euiccpixel_app/sepolicy/st54/euiccpixel_app.te deleted file mode 100644 index 3d81a57..0000000 --- a/euiccpixel_app/sepolicy/st54/euiccpixel_app.te +++ /dev/null @@ -1,8 +0,0 @@ -# euiccpixel requires st54spi for firmware upgrade -userdebug_or_eng(` - net_domain(euiccpixel_app) - - # Access to directly upgrade firmware on st54spi_device used for engineering devices - typeattribute st54spi_device mlstrustedobject; - allow euiccpixel_app st54spi_device:chr_file rw_file_perms; -') diff --git a/fingerprint/Android.bp b/fingerprint/Android.bp deleted file mode 100644 index b5bd008..0000000 --- a/fingerprint/Android.bp +++ /dev/null @@ -1,21 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_fingerprint", - srcs: ["dump_fingerprint.cpp"], - init_rc: ["init.fingerprint.dump.rc"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/fingerprint/dump_fingerprint.cpp b/fingerprint/dump_fingerprint.cpp deleted file mode 100644 index 1c8c7cd..0000000 --- a/fingerprint/dump_fingerprint.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 -#include -#include -#include -#include - -static constexpr const char *kTombstonesDirPath = "/data/vendor/tombstones/fingerprint/"; - -int main() { - printf("------ Fingerprint tombstones ------\n"); - std::unique_ptr tombstones_dir(opendir(kTombstonesDirPath), closedir); - if (tombstones_dir) { - dirent *entry; - while ((entry = readdir(tombstones_dir.get())) != nullptr) { - std::string file_name(entry->d_name); - if (!strcmp(file_name.c_str(), ".") || !strcmp(file_name.c_str(), "..")) - continue; - std::string file_path(kTombstonesDirPath + file_name); - dumpFileContent(file_name.c_str(), file_path.c_str()); - } - } - - return 0; -} diff --git a/fingerprint/fingerprint.mk b/fingerprint/fingerprint.mk deleted file mode 100644 index fb3ceda..0000000 --- a/fingerprint/fingerprint.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/fingerprint/sepolicy - -PRODUCT_PACKAGES += dump_fingerprint diff --git a/fingerprint/init.fingerprint.dump.rc b/fingerprint/init.fingerprint.dump.rc deleted file mode 100644 index f00cdc4..0000000 --- a/fingerprint/init.fingerprint.dump.rc +++ /dev/null @@ -1,2 +0,0 @@ -on post-fs-data - mkdir /data/vendor/tombstones/fingerprint 0770 system system diff --git a/fingerprint/sepolicy/dump_fingerprint.te b/fingerprint/sepolicy/dump_fingerprint.te deleted file mode 100644 index 9af033b..0000000 --- a/fingerprint/sepolicy/dump_fingerprint.te +++ /dev/null @@ -1,5 +0,0 @@ -pixel_bugreport(dump_fingerprint) - -allow dump_fingerprint fingerprint_vendor_data_file:dir r_dir_perms; -allow dump_fingerprint fingerprint_vendor_data_file:file r_file_perms; - diff --git a/fingerprint/sepolicy/file_contexts b/fingerprint/sepolicy/file_contexts deleted file mode 100644 index a035703..0000000 --- a/fingerprint/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_fingerprint u:object_r:dump_fingerprint_exec:s0 -/data/vendor/tombstones/fingerprint(/.*)? u:object_r:fingerprint_vendor_data_file:s0 diff --git a/fingerprint/sepolicy/hal_fingerprint.te b/fingerprint/sepolicy/hal_fingerprint.te deleted file mode 100644 index 6e1af7e..0000000 --- a/fingerprint/sepolicy/hal_fingerprint.te +++ /dev/null @@ -1 +0,0 @@ -allow hal_fingerprint trusty_log_device:chr_file r_file_perms; diff --git a/fingerprint/sepolicy/service_contexts b/fingerprint/sepolicy/service_contexts deleted file mode 100644 index 4cc220f..0000000 --- a/fingerprint/sepolicy/service_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Fingerprint HAL extension -vendor.goodix.hardware.biometrics.fingerprint.IGoodixFingerprintDaemon/default u:object_r:hal_fingerprint_service:s0 diff --git a/gcam_app/gcam.mk b/gcam_app/gcam.mk deleted file mode 100644 index 38c7b69..0000000 --- a/gcam_app/gcam.mk +++ /dev/null @@ -1,8 +0,0 @@ -# vendor -BOARD_SEPOLICY_DIRS += device/google/gs-common/gcam_app/sepolicy/vendor - -# product -PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/gcam_app/sepolicy/product/public -PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/gcam_app/sepolicy//product/private - -PRODUCT_PACKAGES += GoogleCamera diff --git a/gcam_app/sepolicy/product/private/debug_camera_app.te b/gcam_app/sepolicy/product/private/debug_camera_app.te deleted file mode 100644 index 9d4643d..0000000 --- a/gcam_app/sepolicy/product/private/debug_camera_app.te +++ /dev/null @@ -1,17 +0,0 @@ -# GCANext and GCAEng. -typeattribute debug_camera_app coredomain; - -userdebug_or_eng(` - app_domain(debug_camera_app) - net_domain(debug_camera_app) - - allow debug_camera_app app_api_service:service_manager find; - allow debug_camera_app audioserver_service:service_manager find; - allow debug_camera_app cameraserver_service:service_manager find; - allow debug_camera_app mediaextractor_service:service_manager find; - allow debug_camera_app mediametrics_service:service_manager find; - allow debug_camera_app mediaserver_service:service_manager find; - - # Allows GCA_Eng & GCA-Next to access the PowerHAL. - hal_client_domain(debug_camera_app, hal_power) -') diff --git a/gcam_app/sepolicy/product/private/google_camera_app.te b/gcam_app/sepolicy/product/private/google_camera_app.te deleted file mode 100644 index 2d3d73c..0000000 --- a/gcam_app/sepolicy/product/private/google_camera_app.te +++ /dev/null @@ -1,17 +0,0 @@ -# GCARelease and GCADogfood. -typeattribute google_camera_app coredomain; -app_domain(google_camera_app) -net_domain(google_camera_app) - -allow google_camera_app app_api_service:service_manager find; -allow google_camera_app audioserver_service:service_manager find; -allow google_camera_app cameraserver_service:service_manager find; -allow google_camera_app mediaextractor_service:service_manager find; -allow google_camera_app mediametrics_service:service_manager find; -allow google_camera_app mediaserver_service:service_manager find; - -# Allows GCA to access the PowerHAL. -hal_client_domain(google_camera_app, hal_power) - -# Library code may try to access vendor properties, but should be denied -dontaudit google_camera_app vendor_default_prop:file { getattr map open }; diff --git a/gcam_app/sepolicy/product/private/seapp_contexts b/gcam_app/sepolicy/product/private/seapp_contexts deleted file mode 100644 index 9ba54b7..0000000 --- a/gcam_app/sepolicy/product/private/seapp_contexts +++ /dev/null @@ -1,12 +0,0 @@ -# Google Camera -user=_app isPrivApp=true seinfo=google name=com.google.android.GoogleCamera domain=google_camera_app type=app_data_file levelFrom=all - -# Google Camera Eng -user=_app seinfo=CameraEng name=com.google.android.GoogleCameraEng domain=debug_camera_app type=app_data_file levelFrom=all - -# Also allow GoogleCameraNext, the fishfood version, the same access as GoogleCamera -user=_app seinfo=CameraFishfood name=com.google.android.apps.googlecamera.fishfood domain=google_camera_app type=app_data_file levelFrom=all - -# Also label GoogleCameraNext, built with debug keys as debug_camera_app. -user=_app seinfo=CameraEng name=com.google.android.apps.googlecamera.fishfood domain=debug_camera_app type=app_data_file levelFrom=all - diff --git a/gcam_app/sepolicy/vendor/certs/app.x509.pem b/gcam_app/sepolicy/vendor/certs/app.x509.pem deleted file mode 100644 index 8e3e627..0000000 --- a/gcam_app/sepolicy/vendor/certs/app.x509.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYD -VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4g -VmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UE -AxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAe -Fw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzET -MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4G -A1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9p -ZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZI -hvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR -24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVy -xW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8X -W8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC -69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexA -cKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkw -HQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0c -xb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UE -CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMH -QW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAG -CSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1Ud -EwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrP -zgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXcla -XjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05a -IskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+a -ayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUW -Ev9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs= ------END CERTIFICATE----- diff --git a/gcam_app/sepolicy/vendor/certs/camera_eng.x509.pem b/gcam_app/sepolicy/vendor/certs/camera_eng.x509.pem deleted file mode 100644 index 011a9ec..0000000 --- a/gcam_app/sepolicy/vendor/certs/camera_eng.x509.pem +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICpzCCAmWgAwIBAgIEUAV8QjALBgcqhkjOOAQDBQAwNzELMAkGA1UEBhMCVVMx -EDAOBgNVBAoTB0FuZHJvaWQxFjAUBgNVBAMTDUFuZHJvaWQgRGVidWcwHhcNMTIw -NzE3MTQ1MjUwWhcNMjIwNzE1MTQ1MjUwWjA3MQswCQYDVQQGEwJVUzEQMA4GA1UE -ChMHQW5kcm9pZDEWMBQGA1UEAxMNQW5kcm9pZCBEZWJ1ZzCCAbcwggEsBgcqhkjO -OAQBMIIBHwKBgQD9f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR -+1k9jVj6v8X1ujD2y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb -+DtX58aophUPBPuD9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwIVAJdg -UI8VIwvMspK5gqLrhAvwWBz1AoGBAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlX -TAs9B4JnUVlXjrrUWU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCj -rh4rs6Z1kW6jfwv6ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQB -TDv+z0kqA4GEAAKBgGrRG9fVZtJ69DnALkForP1FtL6FvJmMe5uOHHdUaT+MDUKK -pPzhEISBOEJPpozRMFJO7/bxNzhjgi+mNymL/k1GoLhmZe7wQRc5AQNbHIBqoxgY -DTA6qMyeWSPgam+r+nVoPEU7sgd3fPL958+xmxQwOBSqHfe0PVsiK1cGtIuUMAsG -ByqGSM44BAMFAAMvADAsAhQJ0tGwRwIptb7SkCZh0RLycMXmHQIUZ1ACBqeAULp4 -rscXTxYEf4Tqovc= ------END CERTIFICATE----- diff --git a/gcam_app/sepolicy/vendor/certs/camera_fishfood.x509.pem b/gcam_app/sepolicy/vendor/certs/camera_fishfood.x509.pem deleted file mode 100644 index fb11572..0000000 --- a/gcam_app/sepolicy/vendor/certs/camera_fishfood.x509.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICUjCCAbsCBEk0mH4wDQYJKoZIhvcNAQEEBQAwcDELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29n -bGUsIEluYzEUMBIGA1UECxMLR29vZ2xlLCBJbmMxEDAOBgNVBAMTB1Vua25vd24w -HhcNMDgxMjAyMDIwNzU4WhcNMzYwNDE5MDIwNzU4WjBwMQswCQYDVQQGEwJVUzEL -MAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC0dv -b2dsZSwgSW5jMRQwEgYDVQQLEwtHb29nbGUsIEluYzEQMA4GA1UEAxMHVW5rbm93 -bjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAn0gDGZD5sUcmOE4EU9GPjAu/ -jcd7JQSksSB8TGxEurwArcZhD6a2qy2oDjPy7vFrJqP2uFua+sqQn/u+s/TJT36B -IqeY4OunXO090in6c2X0FRZBWqnBYX3Vg84Zuuigu9iF/BeptL0mQIBRIarbk3fe -tAATOBQYiC7FIoL8WA0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQBAhmae1jHaQ4Td -0GHSJuBzuYzEuZ34teS+njy+l1Aeg98cb6lZwM5gXE/SrG0chM7eIEdsurGb6PIg -Ov93F61lLY/MiQcI0SFtqERXWSZJ4OnTxLtM9Y2hnbHU/EG8uVhPZOZfQQ0FKf1b -aIOMFB0Km9HbEZHLKg33kOoMsS2zpA== ------END CERTIFICATE----- diff --git a/gcam_app/sepolicy/vendor/debug_camera_app.te b/gcam_app/sepolicy/vendor/debug_camera_app.te deleted file mode 100644 index 61029b6..0000000 --- a/gcam_app/sepolicy/vendor/debug_camera_app.te +++ /dev/null @@ -1,19 +0,0 @@ -# GCANext and GCAEng. -userdebug_or_eng(` - # Allows GCA-Eng & GCA-Next access the GXP device and properties. - allow debug_camera_app gxp_device:chr_file rw_file_perms; - get_prop(debug_camera_app, vendor_gxp_prop) - - # Allows GCA-Eng & GCA-Next to find and access the EdgeTPU. - allow debug_camera_app edgetpu_app_service:service_manager find; - allow debug_camera_app edgetpu_device:chr_file { read write ioctl }; - # Cannot find avc evidence for below. - # allow debug_camera_app edgetpu_device:chr_file { getattr map }; - - # Allows GCA_Eng & GCA-Next to access the hw_jpeg /dev/video12. - # allow debug_camera_app hw_jpg_device:chr_file rw_file_perms; - - # Allows tachyon_service to communicate with GCA-Eng via binder. - binder_call(edgetpu_tachyon_server, debug_camera_app); -') - diff --git a/gcam_app/sepolicy/vendor/google_camera_app.te b/gcam_app/sepolicy/vendor/google_camera_app.te deleted file mode 100644 index 67287b6..0000000 --- a/gcam_app/sepolicy/vendor/google_camera_app.te +++ /dev/null @@ -1,15 +0,0 @@ -# GCARelease and GCADogfood. - -# Allows GCA to acccess the GXP device & properties. -allow google_camera_app gxp_device:chr_file rw_file_perms; -get_prop(google_camera_app, vendor_gxp_prop) - -# Allows GCA to find and access the EdgeTPU. -allow google_camera_app edgetpu_app_service:service_manager find; -allow google_camera_app edgetpu_device:chr_file { read write ioctl }; - -# Allows GCA to access the hw_jpeg /dev/video12. -#allow google_camera_app hw_jpg_device:chr_file rw_file_perms; - -# Allows tachyon service to communicate with google_camera_app via binder. -binder_call(edgetpu_tachyon_server, google_camera_app); diff --git a/gcam_app/sepolicy/vendor/keys.conf b/gcam_app/sepolicy/vendor/keys.conf deleted file mode 100644 index 92e5ae2..0000000 --- a/gcam_app/sepolicy/vendor/keys.conf +++ /dev/null @@ -1,8 +0,0 @@ -[@GOOGLE] -ALL : device/google/gs-common/gcam_app/sepolicy/vendor/certs/app.x509.pem - -[@CAMERAENG] -ALL : device/google/gs-common/gcam_app/sepolicy/vendor/certs/camera_eng.x509.pem - -[@CAMERAFISHFOOD] -ALL : device/google/gs-common/gcam_app/sepolicy/vendor/certs/camera_fishfood.x509.pem diff --git a/gcam_app/sepolicy/vendor/mac_permissions.xml b/gcam_app/sepolicy/vendor/mac_permissions.xml deleted file mode 100644 index 12d9b1a..0000000 --- a/gcam_app/sepolicy/vendor/mac_permissions.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/gear/dumpstate/Android.bp b/gear/dumpstate/Android.bp deleted file mode 100644 index b230f34..0000000 --- a/gear/dumpstate/Android.bp +++ /dev/null @@ -1,49 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "android.hardware.dumpstate-service", - srcs: [ - "Dumpstate.cpp", - "service.cpp", - ], - init_rc: ["android.hardware.dumpstate-service.rc"], - vintf_fragments: ["android.hardware.dumpstate-service.xml"], - cflags: [ - "-Wall", - "-Werror", - ], - shared_libs: [ - "libbase", - "libbinder_ndk", - "libcutils", - "libdumpstateutil", - "liblog", - "libutils", - "libdump", - "android.hardware.dumpstate-V1-ndk", - ], - vendor: true, - relative_install_path: "hw", -} - -cc_library { - name: "libdump", - srcs: ["pixel_dump.cpp"], - vendor_available: true, - vendor_ramdisk_available: true, - shared_libs: [ - "libbase", - "liblog", - ], - cflags: [ - "-Wall", - "-Werror", - ], - - export_include_dirs: [ - "include", - ], -} - diff --git a/gear/dumpstate/Dumpstate.cpp b/gear/dumpstate/Dumpstate.cpp deleted file mode 100644 index 31df2c7..0000000 --- a/gear/dumpstate/Dumpstate.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2016 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 "dumpstate_device" -#define ATRACE_TAG ATRACE_TAG_ALWAYS - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "Dumpstate.h" - -#include "DumpstateUtil.h" - -#define HW_REVISION "ro.boot.hardware.revision" - -using android::os::dumpstate::CommandOptions; -using android::os::dumpstate::DumpFileToFd; -using android::os::dumpstate::PropertiesHelper; -using android::os::dumpstate::RunCommandToFd; - -namespace aidl { -namespace android { -namespace hardware { -namespace dumpstate { - -typedef std::chrono::time_point timepoint_t; - -const char kVerboseLoggingProperty[] = "persist.vendor.verbose_logging_enabled"; - -timepoint_t startSection(int fd, const std::string §ionName) { - ATRACE_BEGIN(sectionName.c_str()); - ::android::base::WriteStringToFd( - "\n" - "------ Section start: " + sectionName + " ------\n" - "\n", fd); - return std::chrono::steady_clock::now(); -} - -void endSection(int fd, const std::string §ionName, timepoint_t startTime) { - ATRACE_END(); - auto endTime = std::chrono::steady_clock::now(); - auto elapsedMsec = std::chrono::duration_cast - (endTime - startTime).count(); - - ::android::base::WriteStringToFd( - "\n" - "------ Section end: " + sectionName + " ------\n" - "Elapsed msec: " + std::to_string(elapsedMsec) + "\n" - "\n", fd); -} - -// Dump data requested by an argument to the "dump" interface, or help info -// if the specified section is not supported. -void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { - bool dumpAll = (sectionName == kAllSections); - std::string dumpFiles; - struct dirent **dirent_list = NULL; - int num_entries = scandir("/vendor/bin/dump", &dirent_list, 0, (int (*)(const struct dirent **, const struct dirent **)) alphasort); - if (!dirent_list) { - ALOGE("Unable to scan dir: /vendor/bin/dump\n"); - return; - } else if (num_entries <= 0) { - ALOGE("No file is found.\n"); - return; - } - // Execute all or designated programs under vendor/bin/dump/ - for (int i = 0; i < num_entries; i++) { - if (dirent_list[i]->d_name[0] == '.') { - continue; - } - std::string bin(dirent_list[i]->d_name); - dumpFiles = dumpFiles + " " + bin; - if (dumpAll || sectionName == bin) { - auto startTime = startSection(fd, bin); - RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin}, CommandOptions::WithTimeout(15).Build()); - endSection(fd, bin, startTime); - if (!dumpAll) { - return; - } - } - } - - if (dumpAll) { - RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); - return; - } - - // An unsupported section was requested on the command line - ::android::base::WriteStringToFd("Unrecognized text section: " + sectionName + "\n", fd); - ::android::base::WriteStringToFd("Try \"" + kAllSections + "\" or one of the following:", fd); - ::android::base::WriteStringToFd(dumpFiles, fd); - ::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. dump_soc) are" - "not available from the command line.\n", fd); - while (num_entries--) { - free(dirent_list[num_entries]); - } - free(dirent_list); -} - -void Dumpstate::dumpLogSection(int fd, int fd_bin) -{ - std::string logDir = MODEM_LOG_DIRECTORY; - const std::string logCombined = logDir + "/combined_logs.tar"; - const std::string logAllDir = logDir + "/all_logs"; - - RunCommandToFd(fd, "MKDIR LOG", {"/vendor/bin/mkdir", "-p", logAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); - - dumpTextSection(fd, kAllSections); - - RunCommandToFd(fd, "TAR LOG", {"/vendor/bin/tar", "cvf", logCombined.c_str(), "-C", logAllDir.c_str(), "."}, CommandOptions::WithTimeout(20).Build()); - RunCommandToFd(fd, "CHG PERM", {"/vendor/bin/chmod", "a+w", logCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); - - std::vector buffer(65536); - ::android::base::unique_fd fdLog(TEMP_FAILURE_RETRY(open(logCombined.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK))); - - if (fdLog >= 0) { - while (1) { - ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fdLog, buffer.data(), buffer.size())); - - if (bytes_read == 0) { - break; - } else if (bytes_read < 0) { - ALOGD("read(%s): %s\n", logCombined.c_str(), strerror(errno)); - break; - } - - ssize_t result = TEMP_FAILURE_RETRY(write(fd_bin, buffer.data(), bytes_read)); - - if (result != bytes_read) { - ALOGD("Failed to write %zd bytes, actually written: %zd", bytes_read, result); - break; - } - } - } - - RunCommandToFd(fd, "RM LOG DIR", { "/vendor/bin/rm", "-r", logAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); - RunCommandToFd(fd, "RM LOG", { "/vendor/bin/rm", logCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); -} - -ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds, - IDumpstateDevice::DumpstateMode in_mode, - int64_t in_timeoutMillis) { - ATRACE_BEGIN("dumpstateBoard"); - // Unused arguments. - (void) in_timeoutMillis; - - if (in_mode < IDumpstateDevice::DumpstateMode::FULL || in_mode > IDumpstateDevice::DumpstateMode::PROTO) { - ALOGE("Invalid mode: %d\n", in_mode); - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "Invalid mode"); - } - - if (in_fds.size() < 1) { - ALOGE("no FDs\n"); - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, - "No file descriptor"); - } - - int fd = in_fds[0].get(); - if (fd < 0) { - ALOGE("invalid FD: %d\n", fd); - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, - "Invalid file descriptor"); - } - - if (in_fds.size() < 2) { - ALOGE("no FD for dumpstate_board binary\n"); - dumpTextSection(fd, ""); - } else { - int fd_bin = in_fds[1].get(); - dumpLogSection(fd, fd_bin); - } - - ATRACE_END(); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus Dumpstate::setVerboseLoggingEnabled(bool in_enable) { - ::android::base::SetProperty(kVerboseLoggingProperty, in_enable ? "true" : "false"); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus Dumpstate::getVerboseLoggingEnabled(bool* _aidl_return) { - *_aidl_return = ::android::base::GetBoolProperty(kVerboseLoggingProperty, false); - return ndk::ScopedAStatus::ok(); -} - -// Since AIDLs that support the dump() interface are automatically invoked during -// bugreport generation and we don't want to generate a second copy of the same -// data that will go into dumpstate_board.txt, this function will only do -// something if it is called with an option, e.g. -// dumpsys android.hardware.dumpstate.IDumpstateDevice/default all -// -// Also, note that sections which generate attachments and/or binary data when -// included in a bugreport are not available through the dump() interface. -binder_status_t Dumpstate::dump(int fd, const char** args, uint32_t numArgs) { - - if (numArgs != 1) { - return STATUS_OK; - } - - dumpTextSection(fd, static_cast(args[0])); - - fsync(fd); - return STATUS_OK; -} - -} // namespace dumpstate -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/gear/dumpstate/Dumpstate.h b/gear/dumpstate/Dumpstate.h deleted file mode 100644 index 787b774..0000000 --- a/gear/dumpstate/Dumpstate.h +++ /dev/null @@ -1,53 +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. - */ - -#pragma once - -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace dumpstate { - -class Dumpstate : public BnDumpstateDevice { - public: - ::ndk::ScopedAStatus dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds, - IDumpstateDevice::DumpstateMode in_mode, - int64_t in_timeoutMillis) override; - - ::ndk::ScopedAStatus getVerboseLoggingEnabled(bool* _aidl_return) override; - - ::ndk::ScopedAStatus setVerboseLoggingEnabled(bool in_enable) override; - - binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; - - private: - const std::string kAllSections = "all"; - - void dumpTextSection(int fd, std::string const& sectionName); - void dumpLogSection(int fd, int fdModem); - - //bool getVerboseLoggingEnabledImpl(); - //::ndk::ScopedAStatus dumpstateBoardImpl(const int fd, const bool full); -}; - -} // namespace dumpstate -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/gear/dumpstate/aidl.mk b/gear/dumpstate/aidl.mk deleted file mode 100644 index 0df64e9..0000000 --- a/gear/dumpstate/aidl.mk +++ /dev/null @@ -1,3 +0,0 @@ -PRODUCT_PACKAGES += android.hardware.dumpstate-service -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gear/dumpstate/sepolicy - diff --git a/gear/dumpstate/android.hardware.dumpstate-service.rc b/gear/dumpstate/android.hardware.dumpstate-service.rc deleted file mode 100644 index 3aba985..0000000 --- a/gear/dumpstate/android.hardware.dumpstate-service.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.dumpstate-default /vendor/bin/hw/android.hardware.dumpstate-service - class hal - user system - group system shell readtracefs - interface aidl android.hardware.dumpstate.IDumpstateDevice/default diff --git a/gear/dumpstate/android.hardware.dumpstate-service.xml b/gear/dumpstate/android.hardware.dumpstate-service.xml deleted file mode 100644 index 5e51b28..0000000 --- a/gear/dumpstate/android.hardware.dumpstate-service.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - android.hardware.dumpstate - - IDumpstateDevice - default - - - diff --git a/gear/dumpstate/include/dump/pixel_dump.h b/gear/dumpstate/include/dump/pixel_dump.h deleted file mode 100644 index 4d67d15..0000000 --- a/gear/dumpstate/include/dump/pixel_dump.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef DEVICE_GOOGLE_GS_COMMON_INSMOD_INCLUDE_DUMP_PIXEL_DUMP_H_ -#define DEVICE_GOOGLE_GS_COMMON_INSMOD_INCLUDE_DUMP_PIXEL_DUMP_H_ - -#include - -#define BUGREPORT_PACKING_DIR "/data/vendor/radio/logs/always-on/all_logs" -#define MODEM_LOG_DIRECTORY "/data/vendor/radio/logs/always-on" - -void dumpFileContent(const char* title, const char* file_path); -void runCommand(const char* title, const char* cmd); -std::string concatenatePath(const char* folder, const char* file); -void dumpLogs(const char* SrcDir, const char* DestDir, int limit, const char* prefix); -void copyFile(const char* SrcDir, const char* DestDir); - -#endif // DEVICE_GOOGLE_GS_COMMON_INSMOD_INCLUDE_DUMP_PIXEL_DUMP_H_ diff --git a/gear/dumpstate/pixel_dump.cpp b/gear/dumpstate/pixel_dump.cpp deleted file mode 100644 index aaaae01..0000000 --- a/gear/dumpstate/pixel_dump.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include -#include -#include -#include - -// Format title and content output. -void dumpFileContent(const char* title, const char* file_path) { - std::string content; - printf("------ %s (%s) ------\n", title, file_path); - if (android::base::ReadFileToString(file_path, &content)) { - printf("%s\n", content.c_str()); - } else { - printf("Unable to read %s\n", file_path); - } - return; -} - -// Format title and command output. -void runCommand(const char* title, const char* cmd) { - printf("------ %s (%s)------\n", title, cmd); - system(cmd); - return; -} - -std::string concatenatePath(const char* folder, const char* file){ - std::string path = folder; - if(folder[strlen(folder)-1] == '/'){ - path = path + file; - } else { - path = path + "/" + file; - } - - printf("folder:%s, result:%s\n", folder, path.c_str()); - return path; -} - -// Copy stored log from individual folder to our dumpstate folder for -// compressing. -void dumpLogs(const char* SrcDir, const char* DestDir, int limit, const char* prefix) { - - struct dirent **dirent_list = NULL; - int num_entries = scandir(SrcDir, &dirent_list, 0, (int (*)(const struct dirent **, const struct dirent **)) alphasort); - if (!dirent_list) { - printf("Unable to scan dir: %s.\n", SrcDir); - return; - } else if (num_entries <= 0) { - printf("No file is found.\n"); - return; - } - - if (access(DestDir, R_OK)) { - printf("Unable to find folder: %s\n", DestDir); - return; - } - - int copiedFiles = 0; - - for (int i = num_entries - 1; i >= 0; i--) { - - if (0 != strncmp(dirent_list[i]->d_name, prefix, strlen(prefix))) { - continue; - } - - if ((copiedFiles >= limit) && (limit != -1)) { - printf("Skipped %s\n", dirent_list[i]->d_name); - continue; - } - - copiedFiles++; - copyFile(concatenatePath(SrcDir, dirent_list[i]->d_name).c_str(), concatenatePath(DestDir, dirent_list[i]->d_name).c_str()); - } - - while (num_entries--) { - free(dirent_list[num_entries]); - } - - free(dirent_list); - return; -} - -void copyFile(const char* SrcDir, const char* DestDir) { - std::ifstream src(SrcDir, std::ios::binary); - std::ofstream dst(DestDir, std::ios::binary); - dst << src.rdbuf(); - src.close(); - dst.close(); - return; -} - diff --git a/gear/dumpstate/sepolicy/file.te b/gear/dumpstate/sepolicy/file.te deleted file mode 100644 index 1777353..0000000 --- a/gear/dumpstate/sepolicy/file.te +++ /dev/null @@ -1,6 +0,0 @@ -# dumpstate packing directory -type radio_vendor_data_file, file_type, data_file_type; -userdebug_or_eng(` - typeattribute radio_vendor_data_file mlstrustedobject; -') - diff --git a/gear/dumpstate/sepolicy/file_contexts b/gear/dumpstate/sepolicy/file_contexts deleted file mode 100644 index 086b481..0000000 --- a/gear/dumpstate/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -# generic dumpstate for pixel -/vendor/bin/hw/android\.hardware\.dumpstate-service u:object_r:hal_dumpstate_default_exec:s0 - -/data/vendor/radio(/.*)? u:object_r:radio_vendor_data_file:s0 - diff --git a/gear/dumpstate/sepolicy/hal_dumpstate_default.te b/gear/dumpstate/sepolicy/hal_dumpstate_default.te deleted file mode 100644 index e0f0b09..0000000 --- a/gear/dumpstate/sepolicy/hal_dumpstate_default.te +++ /dev/null @@ -1,12 +0,0 @@ -# required permission to use tar to pack dumpsate_board.bin -allow hal_dumpstate_default vendor_toolbox_exec:file execute_no_trans; -allow hal_dumpstate_default radio_vendor_data_file:dir create_dir_perms; -allow hal_dumpstate_default radio_vendor_data_file:file create_file_perms; -allow hal_dumpstate_default shell_data_file:file getattr; -set_prop(hal_dumpstate_default, vendor_logger_prop) - -# All dumps that are executed via hal_dumpstate_default should use their -# own domain to request their permissions to achieve compartmentalization. -# go/pixel-bugreport has examples on how to do that. -neverallow hal_dumpstate_default { vendor_file_type -vendor_toolbox_exec }:file execute_no_trans; - diff --git a/gear/dumpstate/sepolicy/property.te b/gear/dumpstate/sepolicy/property.te deleted file mode 100644 index c6f5a4f..0000000 --- a/gear/dumpstate/sepolicy/property.te +++ /dev/null @@ -1,3 +0,0 @@ -# verbose property -vendor_internal_prop(vendor_logger_prop) - diff --git a/gear/dumpstate/sepolicy/property_contexts b/gear/dumpstate/sepolicy/property_contexts deleted file mode 100644 index 5ead16f..0000000 --- a/gear/dumpstate/sepolicy/property_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# verbose property name -persist.vendor.verbose_logging_enabled u:object_r:vendor_logger_prop:s0 - diff --git a/gear/dumpstate/service.cpp b/gear/dumpstate/service.cpp deleted file mode 100644 index 848bddd..0000000 --- a/gear/dumpstate/service.cpp +++ /dev/null @@ -1,37 +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 "android.hardware.dumpstate-service" - -#include "Dumpstate.h" - -#include -#include -#include - -using aidl::android::hardware::dumpstate::Dumpstate; - -int main() { - ABinderProcess_setThreadPoolMaxThreadCount(0); - std::shared_ptr dumpstate = ndk::SharedRefBase::make(); - - const std::string instance = std::string() + Dumpstate::descriptor + "/default"; - binder_status_t status = - AServiceManager_addService(dumpstate->asBinder().get(), instance.c_str()); - CHECK_EQ(status, STATUS_OK); - - ABinderProcess_joinThreadPool(); - return EXIT_FAILURE; // Unreachable -} diff --git a/gear/dumpstate_v3/Android.bp b/gear/dumpstate_v3/Android.bp deleted file mode 100644 index d1ab29c..0000000 --- a/gear/dumpstate_v3/Android.bp +++ /dev/null @@ -1,29 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "android.hardware.dumpstate.3-service", - srcs: [ - "Dumpstate.cpp", - "service.cpp", - ], - init_rc: ["android.hardware.dumpstate.3-service.rc"], - vintf_fragments: ["android.hardware.dumpstate.3-service.xml"], - cflags: [ - "-Wall", - "-Werror", - ], - shared_libs: [ - "libbase", - "libbinder_ndk", - "libcutils", - "libdumpstateutil", - "liblog", - "libutils", - "libdump", - "android.hardware.dumpstate-V1-ndk", - ], - vendor: true, - relative_install_path: "hw", -} diff --git a/gear/dumpstate_v3/Dumpstate.cpp b/gear/dumpstate_v3/Dumpstate.cpp deleted file mode 100644 index 31df2c7..0000000 --- a/gear/dumpstate_v3/Dumpstate.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2016 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 "dumpstate_device" -#define ATRACE_TAG ATRACE_TAG_ALWAYS - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "Dumpstate.h" - -#include "DumpstateUtil.h" - -#define HW_REVISION "ro.boot.hardware.revision" - -using android::os::dumpstate::CommandOptions; -using android::os::dumpstate::DumpFileToFd; -using android::os::dumpstate::PropertiesHelper; -using android::os::dumpstate::RunCommandToFd; - -namespace aidl { -namespace android { -namespace hardware { -namespace dumpstate { - -typedef std::chrono::time_point timepoint_t; - -const char kVerboseLoggingProperty[] = "persist.vendor.verbose_logging_enabled"; - -timepoint_t startSection(int fd, const std::string §ionName) { - ATRACE_BEGIN(sectionName.c_str()); - ::android::base::WriteStringToFd( - "\n" - "------ Section start: " + sectionName + " ------\n" - "\n", fd); - return std::chrono::steady_clock::now(); -} - -void endSection(int fd, const std::string §ionName, timepoint_t startTime) { - ATRACE_END(); - auto endTime = std::chrono::steady_clock::now(); - auto elapsedMsec = std::chrono::duration_cast - (endTime - startTime).count(); - - ::android::base::WriteStringToFd( - "\n" - "------ Section end: " + sectionName + " ------\n" - "Elapsed msec: " + std::to_string(elapsedMsec) + "\n" - "\n", fd); -} - -// Dump data requested by an argument to the "dump" interface, or help info -// if the specified section is not supported. -void Dumpstate::dumpTextSection(int fd, const std::string §ionName) { - bool dumpAll = (sectionName == kAllSections); - std::string dumpFiles; - struct dirent **dirent_list = NULL; - int num_entries = scandir("/vendor/bin/dump", &dirent_list, 0, (int (*)(const struct dirent **, const struct dirent **)) alphasort); - if (!dirent_list) { - ALOGE("Unable to scan dir: /vendor/bin/dump\n"); - return; - } else if (num_entries <= 0) { - ALOGE("No file is found.\n"); - return; - } - // Execute all or designated programs under vendor/bin/dump/ - for (int i = 0; i < num_entries; i++) { - if (dirent_list[i]->d_name[0] == '.') { - continue; - } - std::string bin(dirent_list[i]->d_name); - dumpFiles = dumpFiles + " " + bin; - if (dumpAll || sectionName == bin) { - auto startTime = startSection(fd, bin); - RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin}, CommandOptions::WithTimeout(15).Build()); - endSection(fd, bin, startTime); - if (!dumpAll) { - return; - } - } - } - - if (dumpAll) { - RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); - return; - } - - // An unsupported section was requested on the command line - ::android::base::WriteStringToFd("Unrecognized text section: " + sectionName + "\n", fd); - ::android::base::WriteStringToFd("Try \"" + kAllSections + "\" or one of the following:", fd); - ::android::base::WriteStringToFd(dumpFiles, fd); - ::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. dump_soc) are" - "not available from the command line.\n", fd); - while (num_entries--) { - free(dirent_list[num_entries]); - } - free(dirent_list); -} - -void Dumpstate::dumpLogSection(int fd, int fd_bin) -{ - std::string logDir = MODEM_LOG_DIRECTORY; - const std::string logCombined = logDir + "/combined_logs.tar"; - const std::string logAllDir = logDir + "/all_logs"; - - RunCommandToFd(fd, "MKDIR LOG", {"/vendor/bin/mkdir", "-p", logAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); - - dumpTextSection(fd, kAllSections); - - RunCommandToFd(fd, "TAR LOG", {"/vendor/bin/tar", "cvf", logCombined.c_str(), "-C", logAllDir.c_str(), "."}, CommandOptions::WithTimeout(20).Build()); - RunCommandToFd(fd, "CHG PERM", {"/vendor/bin/chmod", "a+w", logCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); - - std::vector buffer(65536); - ::android::base::unique_fd fdLog(TEMP_FAILURE_RETRY(open(logCombined.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK))); - - if (fdLog >= 0) { - while (1) { - ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fdLog, buffer.data(), buffer.size())); - - if (bytes_read == 0) { - break; - } else if (bytes_read < 0) { - ALOGD("read(%s): %s\n", logCombined.c_str(), strerror(errno)); - break; - } - - ssize_t result = TEMP_FAILURE_RETRY(write(fd_bin, buffer.data(), bytes_read)); - - if (result != bytes_read) { - ALOGD("Failed to write %zd bytes, actually written: %zd", bytes_read, result); - break; - } - } - } - - RunCommandToFd(fd, "RM LOG DIR", { "/vendor/bin/rm", "-r", logAllDir.c_str()}, CommandOptions::WithTimeout(2).Build()); - RunCommandToFd(fd, "RM LOG", { "/vendor/bin/rm", logCombined.c_str()}, CommandOptions::WithTimeout(2).Build()); -} - -ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds, - IDumpstateDevice::DumpstateMode in_mode, - int64_t in_timeoutMillis) { - ATRACE_BEGIN("dumpstateBoard"); - // Unused arguments. - (void) in_timeoutMillis; - - if (in_mode < IDumpstateDevice::DumpstateMode::FULL || in_mode > IDumpstateDevice::DumpstateMode::PROTO) { - ALOGE("Invalid mode: %d\n", in_mode); - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "Invalid mode"); - } - - if (in_fds.size() < 1) { - ALOGE("no FDs\n"); - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, - "No file descriptor"); - } - - int fd = in_fds[0].get(); - if (fd < 0) { - ALOGE("invalid FD: %d\n", fd); - return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, - "Invalid file descriptor"); - } - - if (in_fds.size() < 2) { - ALOGE("no FD for dumpstate_board binary\n"); - dumpTextSection(fd, ""); - } else { - int fd_bin = in_fds[1].get(); - dumpLogSection(fd, fd_bin); - } - - ATRACE_END(); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus Dumpstate::setVerboseLoggingEnabled(bool in_enable) { - ::android::base::SetProperty(kVerboseLoggingProperty, in_enable ? "true" : "false"); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus Dumpstate::getVerboseLoggingEnabled(bool* _aidl_return) { - *_aidl_return = ::android::base::GetBoolProperty(kVerboseLoggingProperty, false); - return ndk::ScopedAStatus::ok(); -} - -// Since AIDLs that support the dump() interface are automatically invoked during -// bugreport generation and we don't want to generate a second copy of the same -// data that will go into dumpstate_board.txt, this function will only do -// something if it is called with an option, e.g. -// dumpsys android.hardware.dumpstate.IDumpstateDevice/default all -// -// Also, note that sections which generate attachments and/or binary data when -// included in a bugreport are not available through the dump() interface. -binder_status_t Dumpstate::dump(int fd, const char** args, uint32_t numArgs) { - - if (numArgs != 1) { - return STATUS_OK; - } - - dumpTextSection(fd, static_cast(args[0])); - - fsync(fd); - return STATUS_OK; -} - -} // namespace dumpstate -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/gear/dumpstate_v3/Dumpstate.h b/gear/dumpstate_v3/Dumpstate.h deleted file mode 100644 index 787b774..0000000 --- a/gear/dumpstate_v3/Dumpstate.h +++ /dev/null @@ -1,53 +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. - */ - -#pragma once - -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace dumpstate { - -class Dumpstate : public BnDumpstateDevice { - public: - ::ndk::ScopedAStatus dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds, - IDumpstateDevice::DumpstateMode in_mode, - int64_t in_timeoutMillis) override; - - ::ndk::ScopedAStatus getVerboseLoggingEnabled(bool* _aidl_return) override; - - ::ndk::ScopedAStatus setVerboseLoggingEnabled(bool in_enable) override; - - binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; - - private: - const std::string kAllSections = "all"; - - void dumpTextSection(int fd, std::string const& sectionName); - void dumpLogSection(int fd, int fdModem); - - //bool getVerboseLoggingEnabledImpl(); - //::ndk::ScopedAStatus dumpstateBoardImpl(const int fd, const bool full); -}; - -} // namespace dumpstate -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/gear/dumpstate_v3/aidl.mk b/gear/dumpstate_v3/aidl.mk deleted file mode 100644 index bcecb78..0000000 --- a/gear/dumpstate_v3/aidl.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_SOONG_NAMESPACES += device/google/gs-common/gear/dumpstate_v3 -PRODUCT_PACKAGES += android.hardware.dumpstate.3-service -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gear/dumpstate_v3/sepolicy - diff --git a/gear/dumpstate_v3/android.hardware.dumpstate.3-service.rc b/gear/dumpstate_v3/android.hardware.dumpstate.3-service.rc deleted file mode 100644 index 0a80e0c..0000000 --- a/gear/dumpstate_v3/android.hardware.dumpstate.3-service.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.dumpstate-default /vendor/bin/hw/android.hardware.dumpstate.3-service - class hal - user system - group system shell - interface aidl android.hardware.dumpstate.IDumpstateDevice/default diff --git a/gear/dumpstate_v3/android.hardware.dumpstate.3-service.xml b/gear/dumpstate_v3/android.hardware.dumpstate.3-service.xml deleted file mode 100644 index 5e51b28..0000000 --- a/gear/dumpstate_v3/android.hardware.dumpstate.3-service.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - android.hardware.dumpstate - - IDumpstateDevice - default - - - diff --git a/gear/dumpstate_v3/sepolicy/file.te b/gear/dumpstate_v3/sepolicy/file.te deleted file mode 100644 index 1777353..0000000 --- a/gear/dumpstate_v3/sepolicy/file.te +++ /dev/null @@ -1,6 +0,0 @@ -# dumpstate packing directory -type radio_vendor_data_file, file_type, data_file_type; -userdebug_or_eng(` - typeattribute radio_vendor_data_file mlstrustedobject; -') - diff --git a/gear/dumpstate_v3/sepolicy/file_contexts b/gear/dumpstate_v3/sepolicy/file_contexts deleted file mode 100644 index da10e76..0000000 --- a/gear/dumpstate_v3/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -# generic dumpstate for pixel -/vendor/bin/hw/android\.hardware\.dumpstate\.3-service u:object_r:hal_dumpstate_default_exec:s0 - -/data/vendor/radio(/.*)? u:object_r:radio_vendor_data_file:s0 - diff --git a/gear/dumpstate_v3/sepolicy/hal_dumpstate_default.te b/gear/dumpstate_v3/sepolicy/hal_dumpstate_default.te deleted file mode 100644 index 06ebb75..0000000 --- a/gear/dumpstate_v3/sepolicy/hal_dumpstate_default.te +++ /dev/null @@ -1,7 +0,0 @@ -# required permission to use tar to pack dumpsate_board.bin -allow hal_dumpstate_default vendor_toolbox_exec:file execute_no_trans; -allow hal_dumpstate_default radio_vendor_data_file:dir create_dir_perms; -allow hal_dumpstate_default radio_vendor_data_file:file create_file_perms; -allow hal_dumpstate_default shell_data_file:file getattr; -set_prop(hal_dumpstate_default, vendor_logger_prop) - diff --git a/gear/dumpstate_v3/sepolicy/property.te b/gear/dumpstate_v3/sepolicy/property.te deleted file mode 100644 index c6f5a4f..0000000 --- a/gear/dumpstate_v3/sepolicy/property.te +++ /dev/null @@ -1,3 +0,0 @@ -# verbose property -vendor_internal_prop(vendor_logger_prop) - diff --git a/gear/dumpstate_v3/sepolicy/property_contexts b/gear/dumpstate_v3/sepolicy/property_contexts deleted file mode 100644 index 5ead16f..0000000 --- a/gear/dumpstate_v3/sepolicy/property_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# verbose property name -persist.vendor.verbose_logging_enabled u:object_r:vendor_logger_prop:s0 - diff --git a/gear/dumpstate_v3/service.cpp b/gear/dumpstate_v3/service.cpp deleted file mode 100644 index 53dc8ac..0000000 --- a/gear/dumpstate_v3/service.cpp +++ /dev/null @@ -1,37 +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 "android.hardware.dumpstate.3-service" - -#include "Dumpstate.h" - -#include -#include -#include - -using aidl::android::hardware::dumpstate::Dumpstate; - -int main() { - ABinderProcess_setThreadPoolMaxThreadCount(0); - std::shared_ptr dumpstate = ndk::SharedRefBase::make(); - - const std::string instance = std::string() + Dumpstate::descriptor + "/default"; - binder_status_t status = - AServiceManager_addService(dumpstate->asBinder().get(), instance.c_str()); - CHECK_EQ(status, STATUS_OK); - - ABinderProcess_joinThreadPool(); - return EXIT_FAILURE; // Unreachable -} diff --git a/gps/brcm/cbd_gps.mk b/gps/brcm/cbd_gps.mk deleted file mode 100644 index 74d1a3b..0000000 --- a/gps/brcm/cbd_gps.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Copy the cbd control gps state init rc file -PRODUCT_PACKAGES += \ - cbd_gps.rc diff --git a/gps/brcm/conf/Android.bp b/gps/brcm/conf/Android.bp deleted file mode 100644 index 97e0af9..0000000 --- a/gps/brcm/conf/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -prebuilt_etc { - name: "cbd_gps.rc", - src: "cbd_gps.rc", - relative_install_path: "init", - vendor: true, -} \ No newline at end of file diff --git a/gps/brcm/conf/cbd_gps.rc b/gps/brcm/conf/cbd_gps.rc deleted file mode 100644 index b315fe3..0000000 --- a/gps/brcm/conf/cbd_gps.rc +++ /dev/null @@ -1,5 +0,0 @@ -# disable gps service if cbd state is invalid -on property:vendor.ril.cbd.svc=0 - stop gpsd - stop lhd - stop scd diff --git a/gps/brcm/device.mk b/gps/brcm/device.mk deleted file mode 100644 index 4168e4e..0000000 --- a/gps/brcm/device.mk +++ /dev/null @@ -1,13 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/brcm/sepolicy - -ifeq (,$(call soong_config_get,gpssdk,sdkv1)) - $(call soong_config_set,gpssdk,sdkv1,false) -endif -ifeq (,$(call soong_config_get,gpssdk,gpsmcuversion)) - $(call soong_config_set,gpssdk,gpsmcuversion,gpsv2_$(TARGET_BUILD_VARIANT)) -endif - -PRODUCT_PACKAGES += \ - bcm47765_gps_package \ - sitril-gps \ - android.hardware.location.gps.prebuilt.xml diff --git a/gps/brcm/sepolicy/file.te b/gps/brcm/sepolicy/file.te deleted file mode 100644 index 5d9dd83..0000000 --- a/gps/brcm/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type sysfs_gps, sysfs_type, fs_type; -type sysfs_gps_assert, sysfs_type, fs_type; diff --git a/gps/brcm/sepolicy/file_contexts b/gps/brcm/sepolicy/file_contexts deleted file mode 100644 index 8ae128e..0000000 --- a/gps/brcm/sepolicy/file_contexts +++ /dev/null @@ -1,12 +0,0 @@ -# gnss/gps data/log files -/data/vendor/gps(/.*)? u:object_r:vendor_gps_file:s0 - -# devices -/dev/bbd_control u:object_r:vendor_gnss_device:s0 -/dev/ttyBCM u:object_r:vendor_gnss_device:s0 - -# vendor binaries -/vendor/bin/hw/scd u:object_r:scd_exec:s0 -/vendor/bin/hw/lhd u:object_r:lhd_exec:s0 -/vendor/bin/hw/gpsd u:object_r:gpsd_exec:s0 -/vendor/bin/hw/android\.hardware\.gnss@[0-9]\.[0-9]-service-brcm u:object_r:hal_gnss_default_exec:s0 diff --git a/gps/brcm/sepolicy/genfs_contexts b/gps/brcm/sepolicy/genfs_contexts deleted file mode 100644 index a551e96..0000000 --- a/gps/brcm/sepolicy/genfs_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# GPS -genfscon sysfs /devices/virtual/pps/pps0/assert_elapsed u:object_r:sysfs_gps_assert:s0 -genfscon sysfs /devices/platform/bbd_pps/pps_assert u:object_r:sysfs_gps_assert:s0 - diff --git a/gps/brcm/sepolicy/gpsd.te b/gps/brcm/sepolicy/gpsd.te deleted file mode 100644 index 7b566f9..0000000 --- a/gps/brcm/sepolicy/gpsd.te +++ /dev/null @@ -1,23 +0,0 @@ -init_daemon_domain(gpsd) - -# Allow gpsd to obtain wakelock -wakelock_use(gpsd) - -# Allow gpsd access data vendor gps files -allow gpsd vendor_gps_file:dir create_dir_perms; -allow gpsd vendor_gps_file:file create_file_perms; -allow gpsd vendor_gps_file:fifo_file create_file_perms; - -# Allow gpsd to access rild -binder_call(gpsd, rild); -allow gpsd hal_exynos_rild_hwservice:hwservice_manager find; - -# Allow gpsd to access sensor service -binder_call(gpsd, system_server); -allow gpsd fwk_sensor_hwservice:hwservice_manager find; - -# android.frameworks.sensorservice through libsensorndkbridge -allow gpsd fwk_sensor_service:service_manager find; - -# Allow gpsd to access pps gpio -allow gpsd sysfs_gps_assert:file r_file_perms; diff --git a/gps/brcm/sepolicy/hal_gnss_default.te b/gps/brcm/sepolicy/hal_gnss_default.te deleted file mode 100644 index e300423..0000000 --- a/gps/brcm/sepolicy/hal_gnss_default.te +++ /dev/null @@ -1,4 +0,0 @@ -# Allow hal_gnss_default access data vendor gps files -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; diff --git a/gps/brcm/sepolicy/lhd.te b/gps/brcm/sepolicy/lhd.te deleted file mode 100644 index e980897..0000000 --- a/gps/brcm/sepolicy/lhd.te +++ /dev/null @@ -1,23 +0,0 @@ -type lhd, domain; -type lhd_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(lhd) - -# Allow lhd access PixelLogger unix socket in debug build only -userdebug_or_eng(` - typeattribute lhd mlstrustedsubject; - allow lhd logger_app:unix_stream_socket connectto; -') - -# Allow lhd access data vendor gps files -allow lhd vendor_gps_file:dir create_dir_perms; -allow lhd vendor_gps_file:file create_file_perms; -allow lhd vendor_gps_file:fifo_file create_file_perms; - -# Allow lhd to obtain wakelock -wakelock_use(lhd) - -# Allow lhd access /dev/bbd_control file -allow lhd vendor_gnss_device:chr_file rw_file_perms; - -# Allow lhd access nstandby gpio -allow lhd sysfs_gps:file rw_file_perms; diff --git a/gps/brcm/sepolicy/scd.te b/gps/brcm/sepolicy/scd.te deleted file mode 100644 index 28aaee0..0000000 --- a/gps/brcm/sepolicy/scd.te +++ /dev/null @@ -1,17 +0,0 @@ -type scd, domain; -type scd_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(scd) - -# Allow scd access PixelLogger unix socket in debug build only -userdebug_or_eng(` - typeattribute scd mlstrustedsubject; - allow scd logger_app:unix_stream_socket connectto; -') - -# Allow a base set of permissions required for network access. -net_domain(scd); - -# Allow scd access data vendor gps files -allow scd vendor_gps_file:dir create_dir_perms; -allow scd vendor_gps_file:file create_file_perms; -allow scd vendor_gps_file:fifo_file create_file_perms; diff --git a/gps/dump/log.mk b/gps/dump/log.mk deleted file mode 100644 index c8f47c8..0000000 --- a/gps/dump/log.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gps/dump/sepolicy/ diff --git a/gps/dump/sepolicy/dump_gps.te b/gps/dump/sepolicy/dump_gps.te deleted file mode 100644 index b60a251..0000000 --- a/gps/dump/sepolicy/dump_gps.te +++ /dev/null @@ -1,10 +0,0 @@ -pixel_bugreport(dump_gps) - -userdebug_or_eng(` - allow dump_gps radio_vendor_data_file:dir create_dir_perms; - allow dump_gps radio_vendor_data_file:file create_file_perms; - allow dump_gps vendor_gps_file:dir r_dir_perms; - allow dump_gps vendor_gps_file:file r_file_perms; - - get_prop(dump_gps, vendor_gps_prop) -') diff --git a/gps/dump/sepolicy/file_contexts b/gps/dump/sepolicy/file_contexts deleted file mode 100644 index a35e59c..0000000 --- a/gps/dump/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_gps u:object_r:dump_gps_exec:s0 - diff --git a/gps/lsi/sepolicy/device.te b/gps/lsi/sepolicy/device.te deleted file mode 100644 index 15d049f..0000000 --- a/gps/lsi/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_gnss_device, dev_type; diff --git a/gps/lsi/sepolicy/file_contexts b/gps/lsi/sepolicy/file_contexts deleted file mode 100644 index e6af3b1..0000000 --- a/gps/lsi/sepolicy/file_contexts +++ /dev/null @@ -1,10 +0,0 @@ -# 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 -/data/vendor/gps(/.*)? u:object_r:vendor_gps_file:s0 diff --git a/gps/lsi/sepolicy/genfs_contexts b/gps/lsi/sepolicy/genfs_contexts deleted file mode 100644 index d19427c..0000000 --- a/gps/lsi/sepolicy/genfs_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# gps coredump node -genfscon sysfs /devices/platform/gnssif/coredump u:object_r:sysfs_gps:s0 diff --git a/gps/lsi/sepolicy/gnss_check.te b/gps/lsi/sepolicy/gnss_check.te deleted file mode 100644 index 31d0944..0000000 --- a/gps/lsi/sepolicy/gnss_check.te +++ /dev/null @@ -1,9 +0,0 @@ -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); diff --git a/gps/lsi/sepolicy/gnssd.te b/gps/lsi/sepolicy/gnssd.te deleted file mode 100644 index 29dfa2e..0000000 --- a/gps/lsi/sepolicy/gnssd.te +++ /dev/null @@ -1,38 +0,0 @@ -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) -binder_call(gnssd, servicemanager) -allow gnssd hal_exynos_rild_hwservice:hwservice_manager find; -allow gnssd hal_vendor_radio_external_service:service_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) - -# Read modme state -allow gnssd sysfs_modem_state:file r_file_perms; diff --git a/gps/lsi/sepolicy/hal_gnss_default.te b/gps/lsi/sepolicy/hal_gnss_default.te deleted file mode 100644 index 7d363f0..0000000 --- a/gps/lsi/sepolicy/hal_gnss_default.te +++ /dev/null @@ -1,13 +0,0 @@ -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) diff --git a/gps/lsi/sepolicy/rild.te b/gps/lsi/sepolicy/rild.te deleted file mode 100644 index c620a19..0000000 --- a/gps/lsi/sepolicy/rild.te +++ /dev/null @@ -1 +0,0 @@ -binder_call(rild, gnssd) diff --git a/gps/lsi/sepolicy/sctd.te b/gps/lsi/sepolicy/sctd.te deleted file mode 100644 index 8966ef8..0000000 --- a/gps/lsi/sepolicy/sctd.te +++ /dev/null @@ -1,3 +0,0 @@ -type sctd, domain; -type sctd_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(sctd); diff --git a/gps/lsi/sepolicy/spad.te b/gps/lsi/sepolicy/spad.te deleted file mode 100644 index eaf8b1c..0000000 --- a/gps/lsi/sepolicy/spad.te +++ /dev/null @@ -1,3 +0,0 @@ -type spad, domain; -type spad_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(spad); diff --git a/gps/lsi/sepolicy/swcnd.te b/gps/lsi/sepolicy/swcnd.te deleted file mode 100644 index c366cad..0000000 --- a/gps/lsi/sepolicy/swcnd.te +++ /dev/null @@ -1,3 +0,0 @@ -type swcnd, domain; -type swcnd_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(swcnd); diff --git a/gps/lsi/sepolicy/vendor_init.te b/gps/lsi/sepolicy/vendor_init.te deleted file mode 100644 index c8d637d..0000000 --- a/gps/lsi/sepolicy/vendor_init.te +++ /dev/null @@ -1,2 +0,0 @@ -# gps vendor property -set_prop(vendor_init, vendor_gps_prop) diff --git a/gps/pixel/sepolicy/file_contexts b/gps/pixel/sepolicy/file_contexts deleted file mode 100644 index 8bd8f92..0000000 --- a/gps/pixel/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/hw/android\.hardware\.gnss-service\.pixel u:object_r:hal_gnss_pixel_exec:s0 - diff --git a/gps/pixel/sepolicy/hal_gnss_pixel.te b/gps/pixel/sepolicy/hal_gnss_pixel.te deleted file mode 100644 index f2025ea..0000000 --- a/gps/pixel/sepolicy/hal_gnss_pixel.te +++ /dev/null @@ -1,32 +0,0 @@ -#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; - -# Allow access to CHRE multiclient HAL. -get_prop(hal_gnss_pixel, vendor_chre_hal_prop) - -# Allow read vendor gps prop. -get_prop(hal_gnss_pixel, vendor_gps_prop) - -# Allow binder to CHRE. -binder_call(hal_gnss_pixel, hal_contexthub_default) -allow hal_gnss_pixel hal_contexthub_service:service_manager find; - -# Allow binder to fwk stats. -allow hal_gnss_pixel fwk_stats_service:service_manager find; - -# Allow connect to gnss service -allow hal_gnss_pixel vendor_gps_file:dir create_dir_perms; -allow hal_gnss_pixel vendor_gps_file:fifo_file create_file_perms; - -# Allow access ssrdump information -allow hal_gnss_pixel sscoredump_vendor_data_crashinfo_file:file r_file_perms; -allow hal_gnss_pixel sscoredump_vendor_data_crashinfo_file:dir r_dir_perms; - -# Allow pixel gnss access vendor_gps_file -allow hal_gnss_pixel vendor_gps_file:file create_file_perms; diff --git a/gps/pixel/sepolicy/service_contexts b/gps/pixel/sepolicy/service_contexts deleted file mode 100644 index cc9871f..0000000 --- a/gps/pixel/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -android.hardware.gnss.IGnss/vendor u:object_r:hal_gnss_service:s0 \ No newline at end of file diff --git a/gpu/MK_OWNERS b/gpu/MK_OWNERS deleted file mode 100644 index 1d0be18..0000000 --- a/gpu/MK_OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -jessehall@google.com -spyffe@google.com -jorwag@google.com -jeremykemp@google.com diff --git a/gpu/OWNERS b/gpu/OWNERS deleted file mode 100644 index 259dd93..0000000 --- a/gpu/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -per-file gpu.mk=set noparent -per-file gpu.mk=file:MK_OWNERS diff --git a/gpu/gpu.mk b/gpu/gpu.mk deleted file mode 100644 index 4b11e13..0000000 --- a/gpu/gpu.mk +++ /dev/null @@ -1,16 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gpu/sepolicy - -PRODUCT_PACKAGES += gpu_probe - -USE_MAPPER5 := true - -PRODUCT_PACKAGES += pixel_gralloc_allocator -PRODUCT_PACKAGES += pixel_gralloc_mapper - -ifeq ($(USE_MAPPER5), true) -$(call soong_config_set,pixel_gralloc,mapper_version,mapper5) -$(call soong_config_set,aion_buffer,mapper_version,mapper5) -else -$(call soong_config_set,pixel_gralloc,mapper_version,mapper4) -$(call soong_config_set,aion_buffer,mapper_version,mapper4) -endif diff --git a/gpu/sepolicy/file_contexts b/gpu/sepolicy/file_contexts deleted file mode 100644 index 764cb67..0000000 --- a/gpu/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/gpu_probe u:object_r:gpu_probe_exec:s0 - diff --git a/gpu/sepolicy/gpu_probe.te b/gpu/sepolicy/gpu_probe.te deleted file mode 100644 index d8ffb78..0000000 --- a/gpu/sepolicy/gpu_probe.te +++ /dev/null @@ -1,8 +0,0 @@ -# gpu_probe -type gpu_probe_exec, exec_type, vendor_file_type, file_type; -type gpu_probe, domain; - -init_daemon_domain(gpu_probe) -allow gpu_probe gpu_device:chr_file rw_file_perms; - -perfetto_producer(gpu_probe) diff --git a/gpu/sepolicy/service_contexts b/gpu/sepolicy/service_contexts deleted file mode 100644 index 88ee08c..0000000 --- a/gpu/sepolicy/service_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# Note that native/passthrough HALs use the "{type}/{instance}" pattern from -# SEPolicy perspective and are looked up via the corresponding filename -# "{type}.{instance}.so". -mapper/pixel u:object_r:hal_graphics_mapper_service:s0 diff --git a/gril/aidl/2.0/compatibility_matrix.xml b/gril/aidl/2.0/compatibility_matrix.xml deleted file mode 100644 index 8a4a776..0000000 --- a/gril/aidl/2.0/compatibility_matrix.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.radio_ext - 2 - - IRadioExt - default - - - diff --git a/gril/aidl/2.0/gril_aidl.mk b/gril/aidl/2.0/gril_aidl.mk deleted file mode 100644 index d4fa9e9..0000000 --- a/gril/aidl/2.0/gril_aidl.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_PACKAGES += vendor.google.radioext@1.0-service -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/gril/aidl/2.0/compatibility_matrix.xml -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/aidl/2.0/sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/common/sepolicy diff --git a/gril/aidl/2.0/sepolicy/file_contexts b/gril/aidl/2.0/sepolicy/file_contexts deleted file mode 100644 index 9973b80..0000000 --- a/gril/aidl/2.0/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/vendor\.google\.radioext@1\.0-service u:object_r:hal_aidl_radio_ext_exec:s0 diff --git a/gril/aidl/2.0/sepolicy/grilservice_app.te b/gril/aidl/2.0/sepolicy/grilservice_app.te deleted file mode 100644 index 812c8a2..0000000 --- a/gril/aidl/2.0/sepolicy/grilservice_app.te +++ /dev/null @@ -1,4 +0,0 @@ -# allow grilservice_app to find hal_radio_ext_service -allow grilservice_app hal_radio_ext_service:service_manager find; -binder_call(grilservice_app, hal_aidl_radio_ext) -binder_call(grilservice_app, twoshay) diff --git a/gril/aidl/2.0/sepolicy/hal_aidl_radio_ext.te b/gril/aidl/2.0/sepolicy/hal_aidl_radio_ext.te deleted file mode 100644 index bac255e..0000000 --- a/gril/aidl/2.0/sepolicy/hal_aidl_radio_ext.te +++ /dev/null @@ -1,34 +0,0 @@ -# hal_aidl_radio_ext domain -type hal_aidl_radio_ext, domain; -type hal_aidl_radio_ext_exec, vendor_file_type, exec_type, file_type; - -init_daemon_domain(hal_aidl_radio_ext) - -get_prop(hal_aidl_radio_ext, hwservicemanager_prop) -get_prop(hal_aidl_radio_ext, telephony_modemtype_prop) -set_prop(hal_aidl_radio_ext, vendor_gril_prop) - -binder_call(hal_aidl_radio_ext, servicemanager) -binder_call(hal_aidl_radio_ext, grilservice_app) -binder_call(hal_aidl_radio_ext, hal_bluetooth_btlinux) - -add_service(hal_aidl_radio_ext, hal_radio_ext_service) - -# RW /dev/oem_ipc0 -allow hal_aidl_radio_ext radio_device:chr_file rw_file_perms; - -# RW MIPI Freq files -allow hal_aidl_radio_ext radio_vendor_data_file:dir create_dir_perms; -allow hal_aidl_radio_ext radio_vendor_data_file:file create_file_perms; - -# Bluetooth -allow hal_aidl_radio_ext hal_bluetooth_coexistence_hwservice:hwservice_manager find; -allow hal_aidl_radio_ext hal_bluetooth_coexistence_service:service_manager find; - -# Allow access to the backlight driver to set ssc_mode -allow hal_aidl_radio_ext sysfs_leds:dir search; -allow hal_aidl_radio_ext sysfs_leds:file rw_file_perms; - -# legacy/zuma/vendor -allow hal_aidl_radio_ext sysfs_display:dir search; -allow hal_aidl_radio_ext sysfs_display:file rw_file_perms; diff --git a/gril/aidl/2.0/sepolicy/hal_camera_default.te b/gril/aidl/2.0/sepolicy/hal_camera_default.te deleted file mode 100644 index 61f8001..0000000 --- a/gril/aidl/2.0/sepolicy/hal_camera_default.te +++ /dev/null @@ -1,2 +0,0 @@ -# allow hal_camera_default to binder call hal_aidl_radio_ext -binder_call(hal_camera_default, hal_aidl_radio_ext); diff --git a/gril/aidl/2.0/sepolicy/twoshay.te b/gril/aidl/2.0/sepolicy/twoshay.te deleted file mode 100644 index f7d3fe1..0000000 --- a/gril/aidl/2.0/sepolicy/twoshay.te +++ /dev/null @@ -1,2 +0,0 @@ -# allow twoshay to binder call hal_aidl_radio_ext -binder_call(twoshay, hal_aidl_radio_ext) diff --git a/gril/aidl/2.1/compatibility_matrix.xml b/gril/aidl/2.1/compatibility_matrix.xml deleted file mode 100644 index c1ce8f9..0000000 --- a/gril/aidl/2.1/compatibility_matrix.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.radio_ext - 3 - - IRadioExt - default - - - diff --git a/gril/aidl/2.1/gril_aidl.mk b/gril/aidl/2.1/gril_aidl.mk deleted file mode 100644 index d5bc3fc..0000000 --- a/gril/aidl/2.1/gril_aidl.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_PACKAGES += vendor.google.radioext@1.0-service -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/gril/aidl/2.1/compatibility_matrix.xml -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/aidl/2.1/sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/common/sepolicy diff --git a/gril/aidl/2.1/sepolicy/file_contexts b/gril/aidl/2.1/sepolicy/file_contexts deleted file mode 100644 index 9973b80..0000000 --- a/gril/aidl/2.1/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/vendor\.google\.radioext@1\.0-service u:object_r:hal_aidl_radio_ext_exec:s0 diff --git a/gril/aidl/2.1/sepolicy/grilservice_app.te b/gril/aidl/2.1/sepolicy/grilservice_app.te deleted file mode 100644 index 812c8a2..0000000 --- a/gril/aidl/2.1/sepolicy/grilservice_app.te +++ /dev/null @@ -1,4 +0,0 @@ -# allow grilservice_app to find hal_radio_ext_service -allow grilservice_app hal_radio_ext_service:service_manager find; -binder_call(grilservice_app, hal_aidl_radio_ext) -binder_call(grilservice_app, twoshay) diff --git a/gril/aidl/2.1/sepolicy/hal_aidl_radio_ext.te b/gril/aidl/2.1/sepolicy/hal_aidl_radio_ext.te deleted file mode 100644 index eaff153..0000000 --- a/gril/aidl/2.1/sepolicy/hal_aidl_radio_ext.te +++ /dev/null @@ -1,36 +0,0 @@ -# hal_aidl_radio_ext domain -type hal_aidl_radio_ext, domain; -type hal_aidl_radio_ext_exec, vendor_file_type, exec_type, file_type; - -init_daemon_domain(hal_aidl_radio_ext) - -get_prop(hal_aidl_radio_ext, hwservicemanager_prop) -get_prop(hal_aidl_radio_ext, telephony_modemtype_prop) -set_prop(hal_aidl_radio_ext, vendor_gril_prop) - -binder_call(hal_aidl_radio_ext, servicemanager) -binder_call(hal_aidl_radio_ext, grilservice_app) -binder_call(hal_aidl_radio_ext, hal_bluetooth_btlinux) - -add_service(hal_aidl_radio_ext, hal_radio_ext_service) - -# RW /dev/oem_ipc0 -allow hal_aidl_radio_ext radio_device:chr_file rw_file_perms; - -# RW MIPI Freq files -allow hal_aidl_radio_ext radio_vendor_data_file:dir create_dir_perms; -allow hal_aidl_radio_ext radio_vendor_data_file:file create_file_perms; - -# Bluetooth -allow hal_aidl_radio_ext hal_bluetooth_coexistence_hwservice:hwservice_manager find; -allow hal_aidl_radio_ext hal_bluetooth_coexistence_service:service_manager find; - -# Allow access to the backlight driver to set ssc_mode -allow hal_aidl_radio_ext sysfs_leds:dir search; -allow hal_aidl_radio_ext sysfs_leds:file rw_file_perms; - -# legacy/zuma/vendor -allow hal_aidl_radio_ext sysfs_display:file rw_file_perms; - -# Allow access to read display port info -allow hal_aidl_radio_ext sysfs:file r_file_perms; diff --git a/gril/aidl/2.1/sepolicy/hal_camera_default.te b/gril/aidl/2.1/sepolicy/hal_camera_default.te deleted file mode 100644 index 61f8001..0000000 --- a/gril/aidl/2.1/sepolicy/hal_camera_default.te +++ /dev/null @@ -1,2 +0,0 @@ -# allow hal_camera_default to binder call hal_aidl_radio_ext -binder_call(hal_camera_default, hal_aidl_radio_ext); diff --git a/gril/aidl/2.1/sepolicy/twoshay.te b/gril/aidl/2.1/sepolicy/twoshay.te deleted file mode 100644 index f7d3fe1..0000000 --- a/gril/aidl/2.1/sepolicy/twoshay.te +++ /dev/null @@ -1,2 +0,0 @@ -# allow twoshay to binder call hal_aidl_radio_ext -binder_call(twoshay, hal_aidl_radio_ext) diff --git a/gril/common/sepolicy/service.te b/gril/common/sepolicy/service.te deleted file mode 100644 index ee6fb77..0000000 --- a/gril/common/sepolicy/service.te +++ /dev/null @@ -1,3 +0,0 @@ -# Radio Ext AIDL service -# Shared definition so a single type is referenced -type hal_radio_ext_service, hal_service_type, protected_service, service_manager_type; diff --git a/gril/common/sepolicy/service_contexts b/gril/common/sepolicy/service_contexts deleted file mode 100644 index 7e50c2e..0000000 --- a/gril/common/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.google.radio_ext.IRadioExt/default u:object_r:hal_radio_ext_service:s0 diff --git a/gril/hidl/1.7/compatibility_matrix.xml b/gril/hidl/1.7/compatibility_matrix.xml deleted file mode 100644 index 6129633..0000000 --- a/gril/hidl/1.7/compatibility_matrix.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.radioext - 1.7 - - IRadioExt - default - - - diff --git a/gril/hidl/1.7/gril_hidl.mk b/gril/hidl/1.7/gril_hidl.mk deleted file mode 100644 index 0008a5d..0000000 --- a/gril/hidl/1.7/gril_hidl.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_PACKAGES += vendor.google.radioext@1.0-service -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/gril/hidl/1.7/compatibility_matrix.xml -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/hidl/1.7/sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/common/sepolicy diff --git a/gril/hidl/1.7/sepolicy/file_contexts b/gril/hidl/1.7/sepolicy/file_contexts deleted file mode 100644 index dea8592..0000000 --- a/gril/hidl/1.7/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/vendor\.google\.radioext@1\.0-service u:object_r:hal_radioext_default_exec:s0 diff --git a/gril/hidl/1.7/sepolicy/grilservice_app.te b/gril/hidl/1.7/sepolicy/grilservice_app.te deleted file mode 100644 index fd20fb4..0000000 --- a/gril/hidl/1.7/sepolicy/grilservice_app.te +++ /dev/null @@ -1,6 +0,0 @@ -# allow grilservice_app to find hal_radio_ext_service -allow grilservice_app hal_radio_ext_service:service_manager find; -# allow grilservice_app to binder call hal_radioext_default -binder_call(grilservice_app, hal_radioext_default) -# allow grilservice_app to binder call twoshay -binder_call(grilservice_app, twoshay) diff --git a/gril/hidl/1.7/sepolicy/hal_camera_default.te b/gril/hidl/1.7/sepolicy/hal_camera_default.te deleted file mode 100644 index 36bdd7e..0000000 --- a/gril/hidl/1.7/sepolicy/hal_camera_default.te +++ /dev/null @@ -1,2 +0,0 @@ -# allow hal_camera_default to binder call hal_radioext_default -binder_call(hal_camera_default, hal_radioext_default); diff --git a/gril/hidl/1.7/sepolicy/hal_radioext_default.te b/gril/hidl/1.7/sepolicy/hal_radioext_default.te deleted file mode 100644 index 6931fb7..0000000 --- a/gril/hidl/1.7/sepolicy/hal_radioext_default.te +++ /dev/null @@ -1,28 +0,0 @@ -# hal_radioext_default domain -type hal_radioext_default, domain; -type hal_radioext_default_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(hal_radioext_default) - -hwbinder_use(hal_radioext_default) -get_prop(hal_radioext_default, hwservicemanager_prop) -get_prop(hal_radioext_default, telephony_modemtype_prop) -set_prop(hal_radioext_default, vendor_gril_prop) -add_hwservice(hal_radioext_default, hal_radioext_hwservice) - -binder_call(hal_radioext_default, servicemanager) -binder_call(hal_radioext_default, grilservice_app) -binder_call(hal_radioext_default, hal_bluetooth_btlinux) - -# RW /dev/oem_ipc0 -allow hal_radioext_default radio_device:chr_file rw_file_perms; - -# RW MIPI Freq files -allow hal_radioext_default radio_vendor_data_file:dir create_dir_perms; -allow hal_radioext_default radio_vendor_data_file:file create_file_perms; - -# Bluetooth -allow hal_radioext_default hal_bluetooth_coexistence_hwservice:hwservice_manager find; -allow hal_radioext_default hal_bluetooth_coexistence_service:service_manager find; - -# legacy/zuma/vendor -allow hal_radioext_default sysfs_display:file rw_file_perms; diff --git a/gril/hidl/1.7/sepolicy/hwservice_contexts b/gril/hidl/1.7/sepolicy/hwservice_contexts deleted file mode 100644 index 5589c31..0000000 --- a/gril/hidl/1.7/sepolicy/hwservice_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# GRIL HAL -vendor.google.radioext::IRadioExt u:object_r:hal_radioext_hwservice:s0 diff --git a/gril/hidl/1.7/sepolicy/twoshay.te b/gril/hidl/1.7/sepolicy/twoshay.te deleted file mode 100644 index 75c3b27..0000000 --- a/gril/hidl/1.7/sepolicy/twoshay.te +++ /dev/null @@ -1,2 +0,0 @@ -# allow twoshay to binder call hal_radioext_default -binder_call(twoshay, hal_radioext_default) diff --git a/gs_watchdogd/Android.bp b/gs_watchdogd/Android.bp deleted file mode 100644 index 708f2d9..0000000 --- a/gs_watchdogd/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "gs_watchdogd", - recovery_available: true, - system_ext_specific: true, - init_rc: ["init.gs_watchdogd.rc"], - srcs: ["gs_watchdogd.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: ["libbase"], - sanitize: { - misc_undefined: ["signed-integer-overflow"], - }, -} diff --git a/gs_watchdogd/gs_watchdogd.cpp b/gs_watchdogd/gs_watchdogd.cpp deleted file mode 100644 index 333e023..0000000 --- a/gs_watchdogd/gs_watchdogd.cpp +++ /dev/null @@ -1,101 +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. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define NSEC_PER_SEC (1000LL * 1000LL * 1000LL) - -#define DEV_GLOB "/sys/devices/platform/*.watchdog_cl*/watchdog/watchdog*" - -using android::base::Basename; -using android::base::StringPrintf; - -int main(int __unused argc, char** argv) { - auto min_timeout_nsecs = std::numeric_limits::max(); - - android::base::InitLogging(argv, &android::base::KernelLogger); - - glob_t globbuf; - int ret = glob(DEV_GLOB, GLOB_MARK, nullptr, &globbuf); - if (ret) { - PLOG(ERROR) << "Failed to lookup glob " << DEV_GLOB << ": " << ret; - return 1; - } - - std::vector wdt_dev_fds; - - for (size_t i = 0; i < globbuf.gl_pathc; i++) { - int timeout_secs; - std::string dev_path = StringPrintf("/dev/%s", Basename(globbuf.gl_pathv[i]).c_str()); - - int fd = TEMP_FAILURE_RETRY(open(dev_path.c_str(), O_RDWR | O_CLOEXEC)); - if (fd == -1) { - PLOG(ERROR) << "Failed to open " << dev_path; - return 1; - } - - ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout_secs); - if (ret) { - PLOG(ERROR) << "Failed to get timeout on " << dev_path; - continue; - } else { - min_timeout_nsecs = std::min(min_timeout_nsecs, NSEC_PER_SEC * timeout_secs); - } - - wdt_dev_fds.emplace_back(fd); - } - - globfree(&globbuf); - - if (wdt_dev_fds.empty()) { - LOG(ERROR) << "no valid wdt dev found"; - return 1; - } - - timespec ts; - auto result = div(min_timeout_nsecs / 2, NSEC_PER_SEC); - ts.tv_sec = result.quot; - ts.tv_nsec = result.rem; - - while (true) { - timespec rem = ts; - - for (const auto& fd : wdt_dev_fds) { - TEMP_FAILURE_RETRY(write(fd, "", 1)); - } - - if (TEMP_FAILURE_RETRY(nanosleep(&rem, &rem))) { - PLOG(ERROR) << "nanosleep failed"; - return 1; - } - } -} diff --git a/gs_watchdogd/init.gs_watchdogd.rc b/gs_watchdogd/init.gs_watchdogd.rc deleted file mode 100644 index ba3354f..0000000 --- a/gs_watchdogd/init.gs_watchdogd.rc +++ /dev/null @@ -1,10 +0,0 @@ -# Pet watchdog timer every half of its timeout period. -service gs_watchdogd /system_ext/bin/gs_watchdogd - user root - class core - oneshot - seclabel u:r:gs_watchdogd:s0 - shutdown critical - -on property:vendor.all.devices.ready=1 - start gs_watchdogd diff --git a/gs_watchdogd/sepolicy/file_contexts b/gs_watchdogd/sepolicy/file_contexts deleted file mode 100644 index 22dd02b..0000000 --- a/gs_watchdogd/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -# Platform watchdogd -/system_ext/bin/gs_watchdogd u:object_r:gs_watchdogd_exec:s0 - -# Devices -/dev/watchdog[0-9] u:object_r:watchdog_device:s0 diff --git a/gs_watchdogd/sepolicy/gs_watchdogd.te b/gs_watchdogd/sepolicy/gs_watchdogd.te deleted file mode 100644 index 538f870..0000000 --- a/gs_watchdogd/sepolicy/gs_watchdogd.te +++ /dev/null @@ -1,9 +0,0 @@ -# gs_watchdogd seclabel is specified in init..rc -type gs_watchdogd, domain, coredomain; -type gs_watchdogd_exec, system_file_type, exec_type, file_type; - -init_daemon_domain(gs_watchdogd) - -allow gs_watchdogd watchdog_device:chr_file rw_file_perms; -allow gs_watchdogd kmsg_device:chr_file rw_file_perms; -allow gs_watchdogd sysfs:dir r_dir_perms; diff --git a/gs_watchdogd/watchdog.mk b/gs_watchdogd/watchdog.mk deleted file mode 100644 index 69cbbbd..0000000 --- a/gs_watchdogd/watchdog.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Platform watchdogd -PRODUCT_PACKAGES += gs_watchdogd -PRODUCT_SOONG_NAMESPACES += \ - device/google/gs-common/gs_watchdogd -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \ - device/google/gs-common/gs_watchdogd/sepolicy diff --git a/gsa/Android.bp b/gsa/Android.bp deleted file mode 100644 index 0bbad45..0000000 --- a/gsa/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_gsa", - srcs: ["dump_gsa.cpp"], - init_rc: ["init.gsa.rc"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/gsa/dump_gsa.cpp b/gsa/dump_gsa.cpp deleted file mode 100644 index 6308036..0000000 --- a/gsa/dump_gsa.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 -#include - -#define DIM(arr) (sizeof(arr) / sizeof(arr[0])) - -const char* paths[][2] = {{"GSA MAIN LOG", "/dev/gsa-log1"}, - {"GSA INTERMEDIATE LOG", "/dev/gsa-bl1-log2"}}; - -int main() { - for (size_t i = 0; i < DIM(paths); i++) { - if (!access(paths[i][1], R_OK)) { - dumpFileContent(paths[i][0], paths[i][1]); - } - } - return 0; -} diff --git a/gsa/gsa.mk b/gsa/gsa.mk deleted file mode 100644 index 1938c66..0000000 --- a/gsa/gsa.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gsa/sepolicy/gsa - -PRODUCT_PACKAGES += dump_gsa diff --git a/gsa/init.gsa.rc b/gsa/init.gsa.rc deleted file mode 100644 index 357144e..0000000 --- a/gsa/init.gsa.rc +++ /dev/null @@ -1,6 +0,0 @@ -on init - # Change GSA log group for dumpstate - chmod 660 /dev/gsa-log1 - chmod 660 /dev/gsa-bl1-log2 - chown root system /dev/gsa-log1 - chown root system /dev/gsa-bl1-log2 diff --git a/gsa/sepolicy/gsa/dump_gsa.te b/gsa/sepolicy/gsa/dump_gsa.te deleted file mode 100644 index dcc3ef6..0000000 --- a/gsa/sepolicy/gsa/dump_gsa.te +++ /dev/null @@ -1,6 +0,0 @@ -# GSA -pixel_bugreport(dump_gsa) - -userdebug_or_eng(` - allow dump_gsa gsa_log_device:chr_file r_file_perms; -') diff --git a/gsa/sepolicy/gsa/file.te b/gsa/sepolicy/gsa/file.te deleted file mode 100644 index 46a1732..0000000 --- a/gsa/sepolicy/gsa/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# GSA -type gsa_log_device, dev_type; diff --git a/gsa/sepolicy/gsa/file_contexts b/gsa/sepolicy/gsa/file_contexts deleted file mode 100644 index ad3a72d..0000000 --- a/gsa/sepolicy/gsa/file_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# GSA -/dev/gsa-log1 u:object_r:gsa_log_device:s0 -/dev/gsa-bl1-log2 u:object_r:gsa_log_device:s0 -/vendor/bin/dump/dump_gsa u:object_r:dump_gsa_exec:s0 diff --git a/gxp/gxp.mk b/gxp/gxp.mk deleted file mode 100644 index dec616e..0000000 --- a/gxp/gxp.mk +++ /dev/null @@ -1,10 +0,0 @@ -# GXP logging service -PRODUCT_PACKAGES += \ - android.hardware.gxp.logging@service-gxp-logging -# GXP metrics logger library -PRODUCT_PACKAGES += \ - gxp_metrics_logger -# GXP C-API library -PRODUCT_PACKAGES += libgxp - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gxp/sepolicy diff --git a/gxp/sepolicy/appdomain.te b/gxp/sepolicy/appdomain.te deleted file mode 100644 index ada9421..0000000 --- a/gxp/sepolicy/appdomain.te +++ /dev/null @@ -1,2 +0,0 @@ -# Allow apps to read gxp properties -get_prop(appdomain, vendor_gxp_prop) diff --git a/gxp/sepolicy/device.te b/gxp/sepolicy/device.te deleted file mode 100644 index 382bc9d..0000000 --- a/gxp/sepolicy/device.te +++ /dev/null @@ -1,2 +0,0 @@ -# GXP device -type gxp_device, dev_type, mlstrustedobject; diff --git a/gxp/sepolicy/dump_gxp.te b/gxp/sepolicy/dump_gxp.te deleted file mode 100644 index 322a01f..0000000 --- a/gxp/sepolicy/dump_gxp.te +++ /dev/null @@ -1,12 +0,0 @@ -# Dump GXP logs to bugreport. -pixel_bugreport(dump_gxp) - -userdebug_or_eng(` - allow dump_gxp radio_vendor_data_file:dir create_dir_perms; - allow dump_gxp radio_vendor_data_file:file create_file_perms; - allow dump_gxp sscoredump_vendor_data_coredump_file:dir r_dir_perms; - allow dump_gxp sscoredump_vendor_data_coredump_file:file r_file_perms; - allow dump_gxp sscoredump_vendor_data_crashinfo_file:dir r_dir_perms; - allow dump_gxp sscoredump_vendor_data_crashinfo_file:file r_file_perms; -') - diff --git a/gxp/sepolicy/edgetpu_app_service.te b/gxp/sepolicy/edgetpu_app_service.te deleted file mode 100644 index 780823f..0000000 --- a/gxp/sepolicy/edgetpu_app_service.te +++ /dev/null @@ -1,6 +0,0 @@ -# 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; diff --git a/gxp/sepolicy/edgetpu_tachyon_service.te b/gxp/sepolicy/edgetpu_tachyon_service.te deleted file mode 100644 index 31b7e7b..0000000 --- a/gxp/sepolicy/edgetpu_tachyon_service.te +++ /dev/null @@ -1,7 +0,0 @@ -# Allow Tachyon service to access the GXP device and read GXP properties. -allow edgetpu_tachyon_server gxp_device:chr_file rw_file_perms; -get_prop(edgetpu_tachyon_server, vendor_gxp_prop) - -# Allow tachyon service to log to stats service for reporting metrics. -allow edgetpu_tachyon_server fwk_stats_service:service_manager find; -binder_call(edgetpu_tachyon_server, system_server); diff --git a/gxp/sepolicy/file.te b/gxp/sepolicy/file.te deleted file mode 100644 index 278cdd9..0000000 --- a/gxp/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# Gxp sysfs file -type sysfs_gxp, sysfs_type, fs_type; diff --git a/gxp/sepolicy/file_contexts b/gxp/sepolicy/file_contexts deleted file mode 100644 index 08bef12..0000000 --- a/gxp/sepolicy/file_contexts +++ /dev/null @@ -1,12 +0,0 @@ -# GXP Vendor library -/vendor/lib(64)?/libgxp\.so u:object_r:same_process_hal_file:s0 - -# GXP logging service -/vendor/bin/hw/android\.hardware\.gxp\.logging@service-gxp-logging u:object_r:gxp_logging_exec:s0 - -# GXP Metrics Collection Library -/vendor/lib(64)?/gxp_metrics_logger\.so u:object_r:same_process_hal_file:s0 - -# Allow collection of debug dump. -/vendor/bin/dump/dump_gxp u:object_r:dump_gxp_exec:s0 - diff --git a/gxp/sepolicy/gxp_logging.te b/gxp/sepolicy/gxp_logging.te deleted file mode 100644 index fd1af7f..0000000 --- a/gxp/sepolicy/gxp_logging.te +++ /dev/null @@ -1,21 +0,0 @@ -type gxp_logging, domain; -type gxp_logging_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(gxp_logging) - -# The logging service accesses /dev/gxp -allow gxp_logging gxp_device:chr_file rw_file_perms; - -# Allow logging service to access /sys/class/gxp -allow gxp_logging sysfs_gxp:dir search; -allow gxp_logging sysfs_gxp:file rw_file_perms; - -# Allow logging service to log to stats service for reporting metrics. -allow gxp_logging fwk_stats_service:service_manager find; -binder_call(gxp_logging, system_server); -binder_use(gxp_logging) - -# Allow logging service to read gxp properties. -get_prop(gxp_logging, vendor_gxp_prop) - -# Allow gxp tracing service to send packets to Perfetto -userdebug_or_eng(`perfetto_producer(gxp_logging)') diff --git a/gxp/sepolicy/hal_camera_default.te b/gxp/sepolicy/hal_camera_default.te deleted file mode 100644 index 5570a2e..0000000 --- a/gxp/sepolicy/hal_camera_default.te +++ /dev/null @@ -1,3 +0,0 @@ -# Allow the camera hal to access the GXP device and Properties. -allow hal_camera_default gxp_device:chr_file rw_file_perms; -get_prop(hal_camera_default, vendor_gxp_prop) diff --git a/gxp/sepolicy/priv_app.te b/gxp/sepolicy/priv_app.te deleted file mode 100644 index 8afc24d..0000000 --- a/gxp/sepolicy/priv_app.te +++ /dev/null @@ -1,3 +0,0 @@ -# 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 }; diff --git a/gxp/sepolicy/property.te b/gxp/sepolicy/property.te deleted file mode 100644 index b9741f0..0000000 --- a/gxp/sepolicy/property.te +++ /dev/null @@ -1,3 +0,0 @@ -# Gxp Android properties -system_vendor_config_prop(vendor_gxp_prop) - diff --git a/gxp/sepolicy/property_contexts b/gxp/sepolicy/property_contexts deleted file mode 100644 index 6093c7c..0000000 --- a/gxp/sepolicy/property_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# GXP Android Property. -vendor.gxp. u:object_r:vendor_gxp_prop:s0 - diff --git a/gxp/sepolicy/untrusted_app_all.te b/gxp/sepolicy/untrusted_app_all.te deleted file mode 100644 index 456dfee..0000000 --- a/gxp/sepolicy/untrusted_app_all.te +++ /dev/null @@ -1,3 +0,0 @@ -# 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 }; diff --git a/gxp/sepolicy/vendor_init.te b/gxp/sepolicy/vendor_init.te deleted file mode 100644 index ec6ceab..0000000 --- a/gxp/sepolicy/vendor_init.te +++ /dev/null @@ -1,3 +0,0 @@ -# Gxp Android Properties. -set_prop(vendor_init, vendor_gxp_prop) - diff --git a/input/gia/aidl/compatibility_matrix.xml b/input/gia/aidl/compatibility_matrix.xml deleted file mode 100644 index 1a348ea..0000000 --- a/input/gia/aidl/compatibility_matrix.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - com.google.input.gia.core - - IGiaService - default - - 1 - - \ No newline at end of file diff --git a/input/gia/aidl/manifest.xml b/input/gia/aidl/manifest.xml deleted file mode 100644 index 98303c8..0000000 --- a/input/gia/aidl/manifest.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - com.google.input.gia.core - - IGiaService - default - - 1 - - \ No newline at end of file diff --git a/input/gia/gia.mk b/input/gia/gia.mk deleted file mode 100644 index f7f6910..0000000 --- a/input/gia/gia.mk +++ /dev/null @@ -1,10 +0,0 @@ -# When not AOSP target -ifeq (,$(filter aosp_%, $(TARGET_PRODUCT))) - BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/input/gia/sepolicy - - PRODUCT_PACKAGES += gia - PRODUCT_PACKAGES += com.google.input.gia.giaservicemanager - - DEVICE_MANIFEST_FILE += device/google/gs-common/input/gia/aidl/manifest.xml - DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/input/gia/aidl/compatibility_matrix.xml -endif diff --git a/input/gia/sepolicy/attributes b/input/gia/sepolicy/attributes deleted file mode 100644 index 1d61ad3..0000000 --- a/input/gia/sepolicy/attributes +++ /dev/null @@ -1,2 +0,0 @@ -# This macro produces: define hal_gia, hal_gia_client, hal_gia_server -hal_attribute(gia) diff --git a/input/gia/sepolicy/file_contexts b/input/gia/sepolicy/file_contexts deleted file mode 100644 index 99d6857..0000000 --- a/input/gia/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# chmod +x in SEPolicy language -/vendor/bin/gia u:object_r:gia_exec:s0 diff --git a/input/gia/sepolicy/gia.te b/input/gia/sepolicy/gia.te deleted file mode 100644 index 4a310ea..0000000 --- a/input/gia/sepolicy/gia.te +++ /dev/null @@ -1,22 +0,0 @@ -# SEPolicies for GIA (Google Input interface Abstraction layer) -type gia, domain; -type gia_exec, exec_type, vendor_file_type, file_type; - -# Macro transferring gia_exec to the gia domain -init_daemon_domain(gia) - -# let this domain use the hal service -hal_client_domain(gia, hal_gia) -# allow binder communication with service_manager -binder_use(gia) - -# let this domain serve the hal service -hal_server_domain(gia, hal_gia) - -# allow gia for accessing touch related system file-nodes -allow gia sysfs_touch_gti:dir r_dir_perms; -allow gia sysfs_touch_gti:file rw_file_perms; - -# allow gia for collecting device stats -allow gia fwk_stats_service:service_manager find; -binder_call(gia, stats_service_server); diff --git a/input/gia/sepolicy/hal_gia.te b/input/gia/sepolicy/hal_gia.te deleted file mode 100644 index b75c9fb..0000000 --- a/input/gia/sepolicy/hal_gia.te +++ /dev/null @@ -1,8 +0,0 @@ -# allow binder connection from client to server -binder_call(hal_gia_client, hal_gia_server) - -# allow client to find the service & allow server to register the service -hal_attribute_service(hal_gia, hal_gia_service) - -# allow binder communication from server to service_manager -binder_use(hal_gia_server) diff --git a/input/gia/sepolicy/service.te b/input/gia/sepolicy/service.te deleted file mode 100644 index aed1135..0000000 --- a/input/gia/sepolicy/service.te +++ /dev/null @@ -1,2 +0,0 @@ -# Declares GIA related services -type hal_gia_service, hal_service_type, protected_service, service_manager_type; diff --git a/input/gia/sepolicy/service_contexts b/input/gia/sepolicy/service_contexts deleted file mode 100644 index b1773ec..0000000 --- a/input/gia/sepolicy/service_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Attaches GIA services to the cooresponding SEPolicy group -com.google.input.gia.core.IGiaService/default u:object_r:hal_gia_service:s0 diff --git a/insmod/Android.bp b/insmod/Android.bp deleted file mode 100644 index eed35ec..0000000 --- a/insmod/Android.bp +++ /dev/null @@ -1,18 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "insmod.sh", - src: "insmod.sh", - init_rc: ["init.module.rc"], - vendor: true, -} - -prebuilt_etc { - name: "init.common.cfg", - src: "init.common.cfg", - vendor: true, -} - - diff --git a/insmod/init.common.cfg b/insmod/init.common.cfg deleted file mode 100644 index 340eb4b..0000000 --- a/insmod/init.common.cfg +++ /dev/null @@ -1,12 +0,0 @@ -#################################################### -# init.insmod.common.cfg # -# This file contains common kernel modules to load # -# at init time by init.insmod.sh script # -#################################################### - -# Load common kernel modules -# Modules here will be loaded *before* device specific modules -modprobe|system -b * -modprobe|vendor -b * -# All common modules loaded -setprop|vendor.common.modules.ready diff --git a/insmod/init.module.rc b/insmod/init.module.rc deleted file mode 100644 index a106d11..0000000 --- a/insmod/init.module.rc +++ /dev/null @@ -1,11 +0,0 @@ -on init - # Loading common kernel modules in background - start insmod_sh - -service insmod_sh /vendor/bin/insmod.sh /vendor/etc/init.common.cfg - class main - user root - group root system - disabled - oneshot - file /dev/kmsg w diff --git a/insmod/insmod.mk b/insmod/insmod.mk deleted file mode 100644 index aa2261a..0000000 --- a/insmod/insmod.mk +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/insmod/sepolicy -PRODUCT_PACKAGES += \ - insmod.sh \ - init.common.cfg diff --git a/insmod/insmod.sh b/insmod/insmod.sh deleted file mode 100755 index 0f85273..0000000 --- a/insmod/insmod.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/vendor/bin/sh - -################################################################### -### init.insmod.cfg format: ### -### ----------------------------------------------------------- ### -### [insmod|setprop|enable|moprobe|rmmod|wait] [path|prop name] ### -### ... ### -################################################################### - -modules_dir= -system_modules_dir= -vendor_modules_dir= - -# This directory ONLY contains the 16k modules loaded in 16k mode -# during the Second Boot Stage. This directory is not present in the -# _16k targets. -mode_16k_modules_dir=/vendor/lib/modules/16k-mode -pagesize=$(getconf PAGE_SIZE) - -for dir in system vendor; do - for f in /${dir}/lib/modules/*/modules.dep /${dir}/lib/modules/modules.dep; do - if [[ -f "$f" ]]; then - if [[ "${dir}" == "system" ]]; then - system_modules_dir="$(dirname "$f")" - else - vendor_modules_dir="$(dirname "$f")" - modules_dir=${vendor_modules_dir} - fi - break - fi - done -done - -if [[ -z "${system_modules_dir}" ]]; then - echo "Unable to locate system kernel modules directory" 2>&1 -fi - -if [[ -z "${vendor_modules_dir}" ]]; then - echo "Unable to locate vendor kernel modules directory" 2>&1 - exit 1 -fi - -# imitates wait_for_file() in init -wait_for_file() -{ - filename="${1}" - timeout="${2:-5}" - - expiry=$(($(date "+%s")+timeout)) - while [[ ! -e "${filename}" ]] && [[ "$(date "+%s")" -le "${expiry}" ]] - do - sleep 0.01 - done -} - -if [ $# -eq 1 ]; then - cfg_file=$1 -else - # Set property even if there is no insmod config - # to unblock early-boot trigger - setprop vendor.common.modules.ready 1 - setprop vendor.device.modules.ready 1 - setprop vendor.all.modules.ready 1 - setprop vendor.all.devices.ready 1 - exit 1 -fi - -if [ -f $cfg_file ]; then - while IFS="|" read -r action arg - do - case $action in - "insmod") insmod $arg ;; - "setprop") setprop $arg 1 ;; - "enable") echo 1 > $arg ;; - "condinsmod") - prop=$(echo $arg | cut -d '|' -f 1) - module1=$(echo $arg | cut -d '|' -f 2) - module2=$(echo $arg | cut -d '|' -f 3) - value=$(getprop $prop) - if [[ ${value} == "true" ]]; then - insmod ${vendor_modules_dir}/${module1} - else - insmod ${vendor_modules_dir}/${module2} - fi - ;; - "modprobe") - case ${arg} in - "system -b *" | "system -b") - modules_dir=${system_modules_dir} - arg="-b --all=${system_modules_dir}/modules.load" ;; - "system *" | "system") - modules_dir=${system_modules_dir} - arg="--all=${system_modules_dir}/modules.load" ;; - "-b *" | "-b" | "vendor -b *" | "vendor -b") - modules_dir=${vendor_modules_dir} - arg="-b --all=${vendor_modules_dir}/modules.load" ;; - "*" | "" | "vendor *" | "vendor") - modules_dir=${vendor_modules_dir} - arg="--all=${vendor_modules_dir}/modules.load" ;; - esac - if [[ "${pagesize}" == "16384" && -d "${mode_16k_modules_dir}" ]]; then - insmod ${mode_16k_modules_dir}/$arg - elif [[ -d "${modules_dir}" ]]; then - modprobe -a -d "${modules_dir}" $arg - fi - ;; - "rmmod") rmmod $arg ;; - "wait") wait_for_file $arg ;; - esac - done < $cfg_file -fi diff --git a/insmod/sepolicy/file_contexts b/insmod/sepolicy/file_contexts deleted file mode 100644 index e048641..0000000 --- a/insmod/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -# Vendor_kernel_modules -/vendor_dlkm/lib/modules/.*\.ko u:object_r:vendor_kernel_modules:s0 - -/vendor/bin/insmod\.sh u:object_r:insmod-sh_exec:s0 - diff --git a/insmod/sepolicy/insmod-sh.te b/insmod/sepolicy/insmod-sh.te deleted file mode 100644 index 3a1d91a..0000000 --- a/insmod/sepolicy/insmod-sh.te +++ /dev/null @@ -1,17 +0,0 @@ -type insmod-sh, domain; -type insmod-sh_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(insmod-sh) - -allow insmod-sh self:capability sys_module; -allow insmod-sh system_dlkm_file:dir r_dir_perms; -allow insmod-sh system_dlkm_file:file r_file_perms; -allow insmod-sh system_dlkm_file:system module_load; -allow insmod-sh vendor_kernel_modules:system module_load; -allow insmod-sh vendor_toolbox_exec:file execute_no_trans; - -set_prop(insmod-sh, vendor_device_prop) - -dontaudit insmod-sh proc_cmdline:file r_file_perms; - -# Allow modprobe to log to kmsg. -allow insmod-sh kmsg_device:chr_file w_file_perms; diff --git a/insmod/sepolicy/property.te b/insmod/sepolicy/property.te deleted file mode 100644 index 50f7b34..0000000 --- a/insmod/sepolicy/property.te +++ /dev/null @@ -1 +0,0 @@ -vendor_internal_prop(vendor_device_prop) diff --git a/insmod/sepolicy/property_contexts b/insmod/sepolicy/property_contexts deleted file mode 100644 index 1e871b6..0000000 --- a/insmod/sepolicy/property_contexts +++ /dev/null @@ -1,5 +0,0 @@ -# Kernel modules related -vendor.common.modules.ready u:object_r:vendor_device_prop:s0 -vendor.device.modules.ready u:object_r:vendor_device_prop:s0 -vendor.all.modules.ready u:object_r:vendor_device_prop:s0 -vendor.all.devices.ready u:object_r:vendor_device_prop:s0 diff --git a/interrupts/Android.bp b/interrupts/Android.bp deleted file mode 100644 index a4f62bc..0000000 --- a/interrupts/Android.bp +++ /dev/null @@ -1,21 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_interrupts_traces", - srcs: ["traces/dump_interrupts_traces.cpp"], - init_rc: ["init.interrupts.rc"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/interrupts/init.interrupts.rc b/interrupts/init.interrupts.rc deleted file mode 100644 index d2d0173..0000000 --- a/interrupts/init.interrupts.rc +++ /dev/null @@ -1,22 +0,0 @@ -on init - # With permissions 666, trace was not captured in the bugreport. - # Apply relaxed permissions. - chmod 777 /sys/kernel/tracing/instances/irq_gia_google - chmod 777 /sys/kernel/tracing/instances/irq_gia_google/trace - chown system system /sys/kernel/tracing/instances/irq_gia_google - chown system system /sys/kernel/tracing/instances/irq_gia_google/trace - - # There are some very high frequency IRQ events happening all the time. Tracing - # them is not absolute necessity, but a flood of them is noise for more interesting - # events that we want to capture. All these high frequency IRQs have virq < 11. - write /sys/kernel/tracing/instances/irq_gia_google/events/irq/filter "irq > 11" - - # Keep the buffer size small. This size is practically enough for debug purpose. - # Having low size helps because this entire buffer gets dumped in bugreport. - # Having a large size can impact bugreport size and time it takes to pack/unpack. - write /sys/kernel/tracing/instances/irq_gia_google/buffer_size_kb 16 - - # Reduce some GIA events from interrupt handler - write /sys/kernel/tracing/instances/irq_gia_google/events/irq_gia/gia_get_power/enable 0 - write /sys/kernel/tracing/instances/irq_gia_google/events/irq_gia/gia_put_power/enable 0 - write /sys/kernel/tracing/instances/irq_gia_google/events/irq_gia/gia_irq_eoi/enable 0 diff --git a/interrupts/interrupts.mk b/interrupts/interrupts.mk deleted file mode 100644 index bf14f97..0000000 --- a/interrupts/interrupts.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/interrupts/traces/sepolicy - -PRODUCT_PACKAGES += dump_interrupts_traces diff --git a/interrupts/traces/dump_interrupts_traces.cpp b/interrupts/traces/dump_interrupts_traces.cpp deleted file mode 100644 index da747a3..0000000 --- a/interrupts/traces/dump_interrupts_traces.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 -#include - -int main() { - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "interrupts"); - if (mkdir(outputDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - - copyFile("/sys/kernel/tracing/instances/irq_gia_google/trace", - concatenatePath(outputDir.c_str(), "interrupts_trace").c_str()); - - return 0; -} diff --git a/interrupts/traces/sepolicy/dump_interrupts_traces.te b/interrupts/traces/sepolicy/dump_interrupts_traces.te deleted file mode 100644 index bc3952a..0000000 --- a/interrupts/traces/sepolicy/dump_interrupts_traces.te +++ /dev/null @@ -1,7 +0,0 @@ -# -pixel_bugreport(dump_interrupts_traces) - -allow dump_interrupts_traces radio_vendor_data_file:dir { search add_name create write }; -allow dump_interrupts_traces radio_vendor_data_file:file { getattr create write open }; -allow dump_interrupts_traces debugfs_tracing_instances:dir search; -allow dump_interrupts_traces tracefs_instances_interrupts:file { getattr read open }; diff --git a/interrupts/traces/sepolicy/file.te b/interrupts/traces/sepolicy/file.te deleted file mode 100644 index 4decea9..0000000 --- a/interrupts/traces/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# -type tracefs_instances_interrupts, sysfs_type, fs_type; diff --git a/interrupts/traces/sepolicy/file_contexts b/interrupts/traces/sepolicy/file_contexts deleted file mode 100644 index 5a010e9..0000000 --- a/interrupts/traces/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_interrupts_traces u:object_r:dump_interrupts_traces_exec:s0 diff --git a/interrupts/traces/sepolicy/genfs_contexts b/interrupts/traces/sepolicy/genfs_contexts deleted file mode 100644 index 70223b7..0000000 --- a/interrupts/traces/sepolicy/genfs_contexts +++ /dev/null @@ -1 +0,0 @@ -genfscon tracefs /instances/irq_gia_google/trace u:object_r:tracefs_instances_interrupts:s0 diff --git a/led/led.mk b/led/led.mk deleted file mode 100644 index 2b7cb6c..0000000 --- a/led/led.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/led/sepolicy diff --git a/led/sepolicy/dump_led.te b/led/sepolicy/dump_led.te deleted file mode 100644 index b1ba1ef..0000000 --- a/led/sepolicy/dump_led.te +++ /dev/null @@ -1,9 +0,0 @@ -pixel_bugreport(dump_led) - -allow dump_led mnt_vendor_file:dir search; -allow dump_led persist_file:dir search; -allow dump_led persist_leds_file:dir search; -allow dump_led persist_leds_file:file r_file_perms; -allow dump_led sysfs_leds:dir search; -allow dump_led sysfs_leds:file r_file_perms; - diff --git a/led/sepolicy/file.te b/led/sepolicy/file.te deleted file mode 100644 index 7fda883..0000000 --- a/led/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type persist_leds_file, file_type, vendor_persist_type; - diff --git a/led/sepolicy/file_contexts b/led/sepolicy/file_contexts deleted file mode 100644 index 1b006cf..0000000 --- a/led/sepolicy/file_contexts +++ /dev/null @@ -1,4 +0,0 @@ -/vendor/bin/dump/dump_led u:object_r:dump_led_exec:s0 - -/mnt/vendor/persist/led(/.*)? u:object_r:persist_leds_file:s0 - diff --git a/mailbox/Android.bp b/mailbox/Android.bp deleted file mode 100644 index 6969685..0000000 --- a/mailbox/Android.bp +++ /dev/null @@ -1,21 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_mailbox", - srcs: ["dump/dump_mailbox.cpp"], - init_rc: ["init.mailbox.rc"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/mailbox/dump/dump_mailbox.cpp b/mailbox/dump/dump_mailbox.cpp deleted file mode 100644 index 8f63b30..0000000 --- a/mailbox/dump/dump_mailbox.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 -#include - -int main() { - std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "mailbox"); - if (mkdir(outputDir.c_str(), 0777) == -1) { - printf("Unable to create folder: %s\n", outputDir.c_str()); - return 0; - } - - copyFile("/sys/kernel/tracing/instances/goog_cpm_mailbox/trace", - concatenatePath(outputDir.c_str(), "goog_cpm_mailbox_trace").c_str()); - copyFile("/sys/kernel/tracing/instances/goog_nq_mailbox/trace", - concatenatePath(outputDir.c_str(), "goog_nq_mailbox_trace").c_str()); - - return 0; -} diff --git a/mailbox/dump/sepolicy/dump_mailbox.te b/mailbox/dump/sepolicy/dump_mailbox.te deleted file mode 100644 index 64f184c..0000000 --- a/mailbox/dump/sepolicy/dump_mailbox.te +++ /dev/null @@ -1,7 +0,0 @@ -# -pixel_bugreport(dump_mailbox) -allow dump_mailbox radio_vendor_data_file:dir create_dir_perms; -allow dump_mailbox radio_vendor_data_file:file create_file_perms; -allow dump_mailbox debugfs_tracing_instances:file r_file_perms; -allow dump_mailbox debugfs_tracing_instances:dir search; -allow dump_mailbox debugfs_tracing_instances_mailbox:file r_file_perms; diff --git a/mailbox/dump/sepolicy/file.te b/mailbox/dump/sepolicy/file.te deleted file mode 100644 index 5bb7bc4..0000000 --- a/mailbox/dump/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# -type debugfs_tracing_instances_mailbox, sysfs_type, fs_type; diff --git a/mailbox/dump/sepolicy/file_contexts b/mailbox/dump/sepolicy/file_contexts deleted file mode 100644 index b9bea15..0000000 --- a/mailbox/dump/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_mailbox u:object_r:dump_mailbox_exec:s0 diff --git a/mailbox/dump/sepolicy/genfs_contexts b/mailbox/dump/sepolicy/genfs_contexts deleted file mode 100644 index 0bac5e8..0000000 --- a/mailbox/dump/sepolicy/genfs_contexts +++ /dev/null @@ -1,2 +0,0 @@ -genfscon tracefs /instances/goog_cpm_mailbox/trace u:object_r:debugfs_tracing_instances_mailbox:s0 -genfscon tracefs /instances/goog_nq_mailbox/trace u:object_r:debugfs_tracing_instances_mailbox:s0 diff --git a/mailbox/init.mailbox.rc b/mailbox/init.mailbox.rc deleted file mode 100644 index 7659290..0000000 --- a/mailbox/init.mailbox.rc +++ /dev/null @@ -1,8 +0,0 @@ -on property:sys.boot_completed=1 - chown system system /sys/kernel/tracing/instances/goog_cpm_mailbox - chown system system /sys/kernel/tracing/instances/goog_cpm_mailbox/trace - write /sys/kernel/tracing/instances/goog_cpm_mailbox/buffer_size_kb 512 - - chown system system /sys/kernel/tracing/instances/goog_nq_mailbox - chown system system /sys/kernel/tracing/instances/goog_nq_mailbox/trace - write /sys/kernel/tracing/instances/goog_nq_mailbox/buffer_size_kb 512 diff --git a/mailbox/mailbox.mk b/mailbox/mailbox.mk deleted file mode 100644 index aeefb9a..0000000 --- a/mailbox/mailbox.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/mailbox/dump/sepolicy - -PRODUCT_PACKAGES += dump_mailbox diff --git a/mediacodec/bigwave/mediacodec_bigwave.mk b/mediacodec/bigwave/mediacodec_bigwave.mk deleted file mode 100644 index 2ba72c2..0000000 --- a/mediacodec/bigwave/mediacodec_bigwave.mk +++ /dev/null @@ -1,12 +0,0 @@ -PRODUCT_PACKAGES += \ - google.hardware.media.c2@2.0-service \ - libgc2_bw_store \ - libgc2_bw_base \ - libgc2_bw_av1_dec \ - libgc2_bw_av1_enc \ - libbw_av1dec \ - libbw_av1enc \ - libgc2_bw_cwl \ - libgc2_bw_log \ - libgc2_bw_utils - diff --git a/mediacodec/common/mediacodec_common.mk b/mediacodec/common/mediacodec_common.mk deleted file mode 100644 index 7f57785..0000000 --- a/mediacodec/common/mediacodec_common.mk +++ /dev/null @@ -1,4 +0,0 @@ -# mediacodec_common for all build configs and sepolicy shared among different Codec HAL -# example 1: shared among multiple HALs on the same device -# example 2: shared among different Hals on different devices -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/mediacodec/common/sepolicy diff --git a/mediacodec/common/sepolicy/file.te b/mediacodec/common/sepolicy/file.te deleted file mode 100644 index 921cc69..0000000 --- a/mediacodec/common/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_media_data_file, file_type, data_file_type; diff --git a/mediacodec/common/sepolicy/file_contexts b/mediacodec/common/sepolicy/file_contexts deleted file mode 100644 index e92274f..0000000 --- a/mediacodec/common/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/data/vendor/media(/.*)? u:object_r:vendor_media_data_file:s0 diff --git a/mediacodec/common/sepolicy/service.te b/mediacodec/common/sepolicy/service.te deleted file mode 100644 index 3f0130b..0000000 --- a/mediacodec/common/sepolicy/service.te +++ /dev/null @@ -1 +0,0 @@ -type eco_service, service_manager_type; diff --git a/mediacodec/common/sepolicy/service_contexts b/mediacodec/common/sepolicy/service_contexts deleted file mode 100644 index 87800a3..0000000 --- a/mediacodec/common/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -media.ecoservice u:object_r:eco_service:s0 diff --git a/mediacodec/samsung/mediacodec_samsung.mk b/mediacodec/samsung/mediacodec_samsung.mk deleted file mode 100644 index 8e00278..0000000 --- a/mediacodec/samsung/mediacodec_samsung.mk +++ /dev/null @@ -1,19 +0,0 @@ -PRODUCT_PACKAGES += \ - samsung.hardware.media.c2@1.2-service \ - codec2.vendor.base.policy \ - codec2.vendor.ext.policy \ - libExynosC2ComponentStore \ - libExynosC2H264Dec \ - libExynosC2H264Enc \ - libExynosC2HevcDec \ - libExynosC2HevcEnc \ - libExynosC2Mpeg4Dec \ - libExynosC2Mpeg4Enc \ - libExynosC2H263Dec \ - libExynosC2H263Enc \ - libExynosC2Vp8Dec \ - libExynosC2Vp8Enc \ - libExynosC2Vp9Dec \ - libExynosC2Vp9Enc - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/mediacodec/samsung/sepolicy diff --git a/mediacodec/samsung/sepolicy/file.te b/mediacodec/samsung/sepolicy/file.te deleted file mode 100644 index 2b95172..0000000 --- a/mediacodec/samsung/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type sysfs_mfc, sysfs_type, fs_type; -type sysfs_force_empty, sysfs_type, fs_type; diff --git a/mediacodec/samsung/sepolicy/file_contexts b/mediacodec/samsung/sepolicy/file_contexts deleted file mode 100644 index 6f4f29b..0000000 --- a/mediacodec/samsung/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# MFC -/vendor/bin/hw/samsung\.hardware\.media\.c2@1\.2-service u:object_r:mediacodec_samsung_exec:s0 diff --git a/mediacodec/samsung/sepolicy/genfs_contexts b/mediacodec/samsung/sepolicy/genfs_contexts deleted file mode 100644 index 0e48616..0000000 --- a/mediacodec/samsung/sepolicy/genfs_contexts +++ /dev/null @@ -1,2 +0,0 @@ -genfscon sysfs /devices/platform/mfc/video4linux/video u:object_r:sysfs_mfc:s0 -genfscon sysfs /kernel/vendor_mm/cma/vframe/force_empty u:object_r:sysfs_force_empty:s0 diff --git a/mediacodec/samsung/sepolicy/mediacodec_samsung.te b/mediacodec/samsung/sepolicy/mediacodec_samsung.te deleted file mode 100644 index 8d5c52c..0000000 --- a/mediacodec/samsung/sepolicy/mediacodec_samsung.te +++ /dev/null @@ -1,41 +0,0 @@ -type mediacodec_samsung, domain; -type mediacodec_samsung_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(mediacodec_samsung) - -hal_server_domain(mediacodec_samsung, hal_codec2) -add_service(mediacodec_samsung, eco_service) - -binder_use(mediacodec_samsung) -vndbinder_use(mediacodec_samsung) - -allow mediacodec_samsung video_device:chr_file rw_file_perms; -allow mediacodec_samsung dmabuf_system_heap_device:chr_file r_file_perms; -allow mediacodec_samsung gpu_device:chr_file rw_file_perms; - -allow mediacodec_samsung sysfs_mfc:file r_file_perms; -allow mediacodec_samsung sysfs_mfc:dir r_dir_perms; - -allow mediacodec_samsung sysfs_force_empty:dir r_file_perms; -allow mediacodec_samsung sysfs_force_empty:file rw_file_perms; - -# can use graphics allocator -hal_client_domain(mediacodec_samsung, hal_graphics_allocator) - -binder_call(mediacodec_samsung, hal_camera_default) - -crash_dump_fallback(mediacodec_samsung) - -# mediacodec_samsung should never execute any executable without a domain transition -neverallow mediacodec_samsung { file_type fs_type }:file execute_no_trans; - -# Media processing code is inherently risky and thus should have limited -# permissions and be isolated from the rest of the system and network. -# Lengthier explanation here: -# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html -neverallow mediacodec_samsung domain:{ udp_socket rawip_socket } *; -neverallow mediacodec_samsung { domain userdebug_or_eng(`-su') }:tcp_socket *; - -userdebug_or_eng(` - allow mediacodec_samsung vendor_media_data_file:dir rw_dir_perms; - allow mediacodec_samsung vendor_media_data_file:file create_file_perms; -') diff --git a/mediacodec/vpu/mediacodec_google.mk b/mediacodec/vpu/mediacodec_google.mk deleted file mode 100644 index 3984501..0000000 --- a/mediacodec/vpu/mediacodec_google.mk +++ /dev/null @@ -1,23 +0,0 @@ -PRODUCT_SOONG_NAMESPACES += hardware/google/video/cnm - -PRODUCT_PACKAGES += \ - google.hardware.media.c2@3.0-service \ - libgc2_store \ - libgc2_base \ - libgc2_vdi_vpu \ - libgc2_log \ - libgc2_utils \ - libgc2_dec \ - libgc2_av1_dec \ - libgc2_vp9_dec \ - libgc2_hevc_dec \ - libgc2_avc_dec \ - libgc2_enc \ - libgc2_av1_enc \ - libgc2_hevc_enc \ - libgc2_avc_enc \ - vpu_firmware - -$(call soong_config_set,cnm,soc,$(TARGET_BOARD_PLATFORM)) - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/mediacodec/vpu/sepolicy diff --git a/mediacodec/vpu/sepolicy/file_contexts b/mediacodec/vpu/sepolicy/file_contexts deleted file mode 100644 index 138e20e..0000000 --- a/mediacodec/vpu/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/hw/google\.hardware\.media\.c2@3\.0-service u:object_r:mediacodec_google_exec:s0 -/dev/vpu u:object_r:video_device:s0 diff --git a/mediacodec/vpu/sepolicy/mediacodec_google.te b/mediacodec/vpu/sepolicy/mediacodec_google.te deleted file mode 100644 index cf9dfc5..0000000 --- a/mediacodec/vpu/sepolicy/mediacodec_google.te +++ /dev/null @@ -1,34 +0,0 @@ -# Google Mediacodec -type mediacodec_google, domain; -type mediacodec_google_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(mediacodec_google) - -hal_server_domain(mediacodec_google, hal_codec2) - -hal_client_domain(mediacodec_google, hal_graphics_allocator) - -add_service(mediacodec_google, eco_service) -binder_call(mediacodec_google, hal_camera_default) - -allow mediacodec_google dmabuf_system_heap_device:chr_file r_file_perms; -allow mediacodec_google video_device:chr_file { read write open ioctl map }; -allow mediacodec_google gpu_device:chr_file rw_file_perms; - -# mediacodec_google should never execute any executable without a domain transition -neverallow mediacodec_google { file_type fs_type }:file execute_no_trans; - -# Media processing code is inherently risky and thus should have limited -# permissions and be isolated from the rest of the system and network. -# Lengthier explanation here: -# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html -neverallow mediacodec_google domain:{ udp_socket rawip_socket } *; -neverallow mediacodec_google { domain userdebug_or_eng(`-su') }:tcp_socket *; - -# Allow HAL to send trace packets to Perfetto -userdebug_or_eng(`perfetto_producer(mediacodec_google)') - -userdebug_or_eng(` - allow mediacodec_google vendor_media_data_file:dir rw_dir_perms; - allow mediacodec_google vendor_media_data_file:file create_file_perms; -') diff --git a/misc_writer/misc_writer.mk b/misc_writer/misc_writer.mk deleted file mode 100644 index 7cb6c9a..0000000 --- a/misc_writer/misc_writer.mk +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/misc_writer - -PRODUCT_PACKAGES += \ - misc_writer diff --git a/misc_writer/vendor_misc_writer.te b/misc_writer/vendor_misc_writer.te deleted file mode 100644 index dd47f02..0000000 --- a/misc_writer/vendor_misc_writer.te +++ /dev/null @@ -1 +0,0 @@ -get_prop(vendor_misc_writer, sota_prop) diff --git a/modem/OWNERS b/modem/OWNERS deleted file mode 100644 index 4b70b88..0000000 --- a/modem/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -# Give ownership of code files to Apps and Services team. -# SEPolicy files are intentionally ignored since they should be reviewed by the SEPolicy team. -per-file *.bp,*.cpp,*.h,*.sh=kierancyphus@google.com,everrosales@google.com,nicoleytlee@google.com,alanblc@google.com diff --git a/modem/android_property_manager/Android.bp b/modem/android_property_manager/Android.bp deleted file mode 100644 index af89aec..0000000 --- a/modem/android_property_manager/Android.bp +++ /dev/null @@ -1,9 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_library { - name: "modem_android_property_manager", - export_include_dirs: [ "include" ], - vendor_available: true, -} diff --git a/modem/android_property_manager/fake/Android.bp b/modem/android_property_manager/fake/Android.bp deleted file mode 100644 index 247b97c..0000000 --- a/modem/android_property_manager/fake/Android.bp +++ /dev/null @@ -1,23 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -// When `modem_android_property_manager_fake` is included statically, its -// dependencies are not transitively included, so the target will also have to -// include this default to restate them. -cc_defaults { - name: "modem_android_property_manager_fake_defaults", - static_libs: [ - "modem_android_property_manager", - "libbase", - "modem_log_constants", - ], -} - -cc_library_static { - name: "modem_android_property_manager_fake", - export_include_dirs: [ "include" ], - srcs: [ "fake_android_property_manager.cpp" ], - defaults: [ "modem_android_property_manager_fake_defaults" ], - vendor_available: true, -} diff --git a/modem/android_property_manager/fake/fake_android_property_manager.cpp b/modem/android_property_manager/fake/fake_android_property_manager.cpp deleted file mode 100644 index d25d6da..0000000 --- a/modem/android_property_manager/fake/fake_android_property_manager.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "fake_android_property_manager.h" - -#include -#include - -#include -#include -#include - -#include "modem_log_constants.h" - -namespace pixel_modem { - -bool FakeAndroidPropertyManager::GetBoolProperty(const std::string& key, - bool default_value) { - auto value_result = GetProperty(key); - return value_result.ok() ? (*value_result) == kTruthString : default_value; -} - -std::string FakeAndroidPropertyManager::GetProperty( - const std::string& key, const std::string& default_value) { - auto value_result = GetProperty(key); - return value_result.ok() ? *value_result : default_value; -} - -int FakeAndroidPropertyManager::GetIntProperty(const std::string& key, - int default_value) { - int value = default_value; - - auto property_result = GetProperty(key); - if (property_result.ok()) { - android::base::ParseInt((*property_result).data(), &value); - } - return value; -} - -/** - * This function needs to copy the behaviour of `modem_logging_control` to - * ensure that the right properties are being set in order. - * - * More specifically, this function will also set the - * `kModemLoggingStatusProperty` whenever `kModemLoggingEnabledProperty` is - * set to simulate modem logging stopping / starting. - */ -bool FakeAndroidPropertyManager::SetProperty(const std::string& key, - const std::string& value) { - if (key == logging::kModemLoggingEnabledProperty) { - property_map_[logging::kModemLoggingStatusProperty.data()] = value; - - // need to track if modem logging has restarted or not - if (value == kFalseString) { - modem_logging_has_been_off_ = true; - } - if (modem_logging_has_been_off_ && (value == kTruthString)) { - modem_logging_has_restarted_ = true; - } - } - property_map_[key] = value; - return true; -} - -/** - * @brief Gets android system property if present. - * - * @param[in] key Name of property. - * - * @return Status of get operation and value if successful. - * @retval EINVAL Key not present in map. - */ -android::base::Result FakeAndroidPropertyManager::GetProperty( - const std::string& key) { - const auto it = property_map_.find(key); - if (it == property_map_.end()) { - return android::base::Error() - << "Property: " << key << " not found." << EINVAL; - } - return it->second; -} - -} // namespace pixel_modem diff --git a/modem/android_property_manager/fake/include/fake_android_property_manager.h b/modem/android_property_manager/fake/include/fake_android_property_manager.h deleted file mode 100644 index eeea5a0..0000000 --- a/modem/android_property_manager/fake/include/fake_android_property_manager.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include -#include - -#include "android-base/result.h" -#include "android_property_manager.h" - -namespace pixel_modem { - -/** - * @brief Fake Implementation of AndroidPropertyManager that mocks some of the - * property changing behaviour from pixellogger's `modem_logging_control`. - */ -class FakeAndroidPropertyManager : public AndroidPropertyManager { - public: - bool GetBoolProperty(const std::string& key, bool default_value) override; - - std::string GetProperty(const std::string& key, - const std::string& default_value) override; - - int GetIntProperty(const std::string& key, int default_value) override; - - /** - * This function needs to copy the behaviour of `modem_logging_control` to - * ensure that the right properties are being set in order. - * - * More specifically, this function will also set the - * `kModemLoggingStatusProperty` whenever `kModemLoggingEnabledProperty` is - * set to simulate modem logging stopping / starting. - */ - bool SetProperty(const std::string& key, const std::string& value) override; - - inline bool ModemLoggingHasRestarted() { - return modem_logging_has_restarted_; - } - - private: - /** - * @brief Gets android system property if present. - * - * @param[in] key Name of property. - * - * @return Status of get operation and value if successful. - * @retval EINVAL Key not present in map. - */ - android::base::Result GetProperty(const std::string& key); - - std::map property_map_; - bool modem_logging_has_been_off_ = false; - bool modem_logging_has_restarted_ = false; -}; - -} // namespace pixel_modem diff --git a/modem/android_property_manager/impl/Android.bp b/modem/android_property_manager/impl/Android.bp deleted file mode 100644 index 2023e8f..0000000 --- a/modem/android_property_manager/impl/Android.bp +++ /dev/null @@ -1,18 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -modem_android_property_manager_impl_public_deps = [ - "modem_android_property_manager", -] - -cc_library_shared { - name: "modem_android_property_manager_impl", - export_include_dirs: [ "include" ], - srcs: [ "android_property_manager_impl.cpp" ], - shared_libs: modem_android_property_manager_impl_public_deps + [ - "libbase", - ], - export_shared_lib_headers: modem_android_property_manager_impl_public_deps, - vendor_available: true, -} diff --git a/modem/android_property_manager/impl/android_property_manager_impl.cpp b/modem/android_property_manager/impl/android_property_manager_impl.cpp deleted file mode 100644 index b6b900a..0000000 --- a/modem/android_property_manager/impl/android_property_manager_impl.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "android_property_manager_impl.h" - -#include - -#include - -namespace pixel_modem { - -bool AndroidPropertyManagerImpl::GetBoolProperty(const std::string& key, - bool default_value) { - return android::base::GetBoolProperty(key, default_value); -} - -std::string AndroidPropertyManagerImpl::GetProperty( - const std::string& key, const std::string& default_value) { - return android::base::GetProperty(key, default_value); -} - -int AndroidPropertyManagerImpl::GetIntProperty(const std::string& key, - int default_value) { - return android::base::GetIntProperty(key, default_value); -} - -bool AndroidPropertyManagerImpl::SetProperty(const std::string& key, - const std::string& value) { - return android::base::SetProperty(key, value); -} - -} // namespace pixel_modem diff --git a/modem/android_property_manager/impl/include/android_property_manager_impl.h b/modem/android_property_manager/impl/include/android_property_manager_impl.h deleted file mode 100644 index 91cee25..0000000 --- a/modem/android_property_manager/impl/include/android_property_manager_impl.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include - -#include "android_property_manager.h" - -namespace pixel_modem { - -/** - * @brief Implementation of AndroidPropertyManager that directly forwards to - * android base methods. - */ -class AndroidPropertyManagerImpl : public AndroidPropertyManager { - public: - bool GetBoolProperty(const std::string& key, bool default_value) override; - - std::string GetProperty(const std::string& key, - const std::string& default_value) override; - - int GetIntProperty(const std::string& key, int default_value) override; - - bool SetProperty(const std::string& key, const std::string& value) override; -}; - -} // namespace pixel_modem diff --git a/modem/android_property_manager/include/android_property_manager.h b/modem/android_property_manager/include/android_property_manager.h deleted file mode 100644 index e41a28d..0000000 --- a/modem/android_property_manager/include/android_property_manager.h +++ /dev/null @@ -1,27 +0,0 @@ - -#pragma once - -#include -#include - -namespace pixel_modem { - -// Used to set boolean parameters to true / false -inline constexpr std::string_view kTruthString = "true"; -inline constexpr std::string_view kFalseString = "false"; - -/** - * @brief Interface for interacting with Android System Properties. - */ -class AndroidPropertyManager { - public: - virtual ~AndroidPropertyManager() = default; - virtual bool GetBoolProperty(const std::string& key, bool default_value) = 0; - virtual std::string GetProperty(const std::string& key, - const std::string& default_value) = 0; - virtual int GetIntProperty(const std::string& key, int default_value) = 0; - virtual bool SetProperty(const std::string& key, - const std::string& value) = 0; -}; - -} // namespace pixel_modem diff --git a/modem/clock_manager/Android.bp b/modem/clock_manager/Android.bp deleted file mode 100644 index 98aff6f..0000000 --- a/modem/clock_manager/Android.bp +++ /dev/null @@ -1,9 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_library { - name: "modem_clock_manager", - export_include_dirs: [ "include" ], - vendor_available: true, -} diff --git a/modem/clock_manager/fake/Android.bp b/modem/clock_manager/fake/Android.bp deleted file mode 100644 index eb16445..0000000 --- a/modem/clock_manager/fake/Android.bp +++ /dev/null @@ -1,15 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_defaults { - name: "fake_modem_clock_manager_defaults", - shared_libs: [ "modem_clock_manager" ], -} - -cc_library_static { - name: "fake_modem_clock_manager", - export_include_dirs: [ "include" ], - defaults: [ "fake_modem_clock_manager_defaults" ], - vendor_available: true, -} diff --git a/modem/clock_manager/fake/include/fake_clock_manager.h b/modem/clock_manager/fake/include/fake_clock_manager.h deleted file mode 100644 index 8956777..0000000 --- a/modem/clock_manager/fake/include/fake_clock_manager.h +++ /dev/null @@ -1,21 +0,0 @@ -#include "clock_manager.h" - -namespace pixel_modem { - -/** - * @brief Fake implementation of clock manager that doesn't actually sleep. - * - * A lot of vendor code don't have return values and instead force the client - * codes to sleep for a specified period of time before checking some system - * properties. However, since unit tests don't rely on the real vendor - * implementations, these sleeps should be ignored and so a fake clock should be - * used. - * - * Since this definition is unlikely to change, it will be defined in the header - * and not an implementation file. - */ -struct FakeClockManager : public ClockManager { - void Sleep(size_t /*seconds*/) const override{}; -}; - -} // namespace pixel_modem diff --git a/modem/clock_manager/impl/Android.bp b/modem/clock_manager/impl/Android.bp deleted file mode 100644 index 13f4cc6..0000000 --- a/modem/clock_manager/impl/Android.bp +++ /dev/null @@ -1,16 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -modem_clock_manager_impl_public_deps = [ - "modem_clock_manager", -] - -cc_library { - name: "modem_clock_manager_impl", - export_include_dirs: [ "include" ], - srcs: [ "clock_manager_impl.cpp" ], - shared_libs: modem_clock_manager_impl_public_deps, - export_shared_lib_headers: modem_clock_manager_impl_public_deps, - vendor_available: true, -} diff --git a/modem/clock_manager/impl/clock_manager_impl.cpp b/modem/clock_manager/impl/clock_manager_impl.cpp deleted file mode 100644 index dc61a63..0000000 --- a/modem/clock_manager/impl/clock_manager_impl.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "clock_manager_impl.h" - -#include - -namespace pixel_modem { - -void ClockManagerImpl::Sleep(size_t seconds) const { sleep(seconds); } - -} // namespace pixel_modem diff --git a/modem/clock_manager/impl/include/clock_manager_impl.h b/modem/clock_manager/impl/include/clock_manager_impl.h deleted file mode 100644 index d626b98..0000000 --- a/modem/clock_manager/impl/include/clock_manager_impl.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -#include "clock_manager.h" - -namespace pixel_modem { - -struct ClockManagerImpl : public ClockManager { - void Sleep(size_t seconds) const override; -}; - -} // namespace pixel_modem diff --git a/modem/clock_manager/include/clock_manager.h b/modem/clock_manager/include/clock_manager.h deleted file mode 100644 index 1db88c5..0000000 --- a/modem/clock_manager/include/clock_manager.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include - -namespace pixel_modem { - -/** - * @brief Interface for time based operations. - * - * This interface was intentionally not called `Clock`, like the Java side - * counterpart since it's likely that clients would call the local variable - * `clock(_)`, which would clash with the C defined `clock` method. - */ -struct ClockManager { - virtual ~ClockManager() = default; - - /** - * @brief Sleep the thread for a given number of seconds. - * - * @param seconds Minimum number of seconds to sleep for. Note, this is - * different than the Java android clock which accepts seconds. This was done - * because C++ developers are likely more familiar with the `sleep` command, - * which accepts seconds. - */ - virtual void Sleep(size_t seconds) const = 0; -}; - -} // namespace pixel_modem diff --git a/modem/dump_modemlog/Android.bp b/modem/dump_modemlog/Android.bp index f509320..778731c 100644 --- a/modem/dump_modemlog/Android.bp +++ b/modem/dump_modemlog/Android.bp @@ -8,72 +8,3 @@ rust_binary { vendor: true, relative_install_path: "dump", } - -// Modem Log Dumper - -modem_log_dumper_public_deps = [ - "modem_android_property_manager", -] - -// When `modem_log_dumper` is included statically, its dependencies are not -// transitively included, so the target will also have to include this default -// to restate them. -cc_defaults { - name: "modem_log_dumper_defaults", - shared_libs: modem_log_dumper_public_deps + [ - "libbase", - // liblog is not directly used by us, but it's a transitive dependency of libbase - "liblog", - "modem_log_constants", - ], -} - -cc_library { - name: "modem_log_dumper", - srcs: ["modem_log_dumper.cpp"], - defaults: ["modem_log_dumper_defaults"], - export_shared_lib_headers: modem_log_dumper_public_deps, - export_include_dirs: ["include"], - vendor_available: true, -} - -// dump_modemlog - -cc_binary { - name: "dump_modemlog", - srcs: ["dump_modemlog.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - "modem_android_property_manager_impl", - "modem_log_dumper", - ], - vendor: true, - relative_install_path: "dump", -} - -cc_test { - name: "dump_modemlog_test", - srcs: ["modem_log_dumper_test.cpp"], - defaults: [ - "modem_log_dumper_defaults", - "modem_android_property_manager_fake_defaults", - ], - static_libs: [ - "modem_android_property_manager", - "modem_android_property_manager_fake", - "modem_log_constants", - "modem_log_dumper", - "libgmock", - ], - vendor: true, - // Shared libs in vendor folder are guarded by SEPolicy, so tests need root - // access to run them. - require_root: true, -} diff --git a/modem/dump_modemlog/dump_modemlog.cpp b/modem/dump_modemlog/dump_modemlog.cpp deleted file mode 100644 index bed936c..0000000 --- a/modem/dump_modemlog/dump_modemlog.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - -#include "android_property_manager_impl.h" -#include "dumper.h" -#include "modem_log_dumper.h" - -namespace pixel_modem::logging { - -/** - * @brief Implementation of Dumper that directly forwards to their corresponding - * dumpstate methods. - */ -class DumperImpl : public Dumper { - public: - void DumpLogs(const LogDumpInfo& log_dump_info) override { - dumpLogs(log_dump_info.src_dir.data(), log_dump_info.dest_dir.data(), - log_dump_info.limit, log_dump_info.prefix.data()); - } - void CopyFile(const FileCopyInfo& file_copy_info) override { - copyFile(file_copy_info.src_dir.data(), file_copy_info.dest_dir.data()); - } -}; - -} // namespace pixel_modem::logging - -int main() { - pixel_modem::logging::DumperImpl dumper_impl; - pixel_modem::AndroidPropertyManagerImpl android_property_manager_impl; - pixel_modem::logging::ModemLogDumper modem_log_dumper( - dumper_impl, android_property_manager_impl); - - modem_log_dumper.DumpModemLogs(); - return 0; -} diff --git a/modem/dump_modemlog/dump_modemlog.mk b/modem/dump_modemlog/dump_modemlog.mk deleted file mode 100644 index c96e729..0000000 --- a/modem/dump_modemlog/dump_modemlog.mk +++ /dev/null @@ -1,5 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/modem/dump_modemlog/sepolicy - -PRODUCT_PACKAGES += dump_modem -PRODUCT_PACKAGES += dump_modemlog - diff --git a/modem/dump_modemlog/include/bugreport_constants.h b/modem/dump_modemlog/include/bugreport_constants.h deleted file mode 100644 index 25c800f..0000000 --- a/modem/dump_modemlog/include/bugreport_constants.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include - -#include "dumper.h" - -namespace pixel_modem::logging { - -inline constexpr std::string_view kBugreportPackingDirectory = - "/data/vendor/radio/logs/always-on/all_logs"; - -inline constexpr LogDumpInfo kLogDumpInfo[] = { - {.src_dir = "/data/vendor/radio/extended_logs", - .dest_dir = kBugreportPackingDirectory, - .limit = 20, - .prefix = "extended_log_"}, - {.src_dir = "/data/vendor/radio/sim/", - .dest_dir = kBugreportPackingDirectory, - .limit = 1, - .prefix = "sim_poweron_log_"}, - {.src_dir = "data/vendor/radio/logs/history", - .dest_dir = kBugreportPackingDirectory, - .limit = 2, - .prefix = "Logging"}}; - -constexpr FileCopyInfo kFileCopyInfo[] = { - {.src_dir = "/mnt/vendor/efs/nv_normal.bin", - .dest_dir = "/data/vendor/radio/logs/always-on/all_logs/nv_normal.bin"}, - {.src_dir = "/mnt/vendor/efs/nv_protected.bin", - .dest_dir = - "/data/vendor/radio/logs/always-on/all_logs/nv_protected.bin"}}; - -} // namespace pixel_modem::logging diff --git a/modem/dump_modemlog/include/dumper.h b/modem/dump_modemlog/include/dumper.h deleted file mode 100644 index a9b96c6..0000000 --- a/modem/dump_modemlog/include/dumper.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -#include -#include - -namespace pixel_modem::logging { - -/** - * @brief Data object for information about dumpings logs. - * - * @param src_dir is a const char* containing the path to the directory to be - copied. - * @param dest_dir is a const char* containing the path to the directory that - the contents of the source directory should be copied to. - * @param limit is an int of the maximum number of files to copy. - * @param prefix is a const char* containing a prefix that all files to be - copied should have. -*/ -struct LogDumpInfo { - const std::string_view src_dir; - const std::string_view dest_dir; - int limit; - const std::string_view prefix; - - friend bool operator==(const LogDumpInfo& lhs, const LogDumpInfo& rhs) { - return (lhs.limit == rhs.limit) && (lhs.src_dir == rhs.src_dir) && - (lhs.dest_dir == rhs.dest_dir) && (lhs.prefix == rhs.prefix); - } - - // Do I have to use .data() here? - friend std::ostream& operator<<(std::ostream& os, const LogDumpInfo& obj) { - os << "src_dir: " << obj.src_dir << ", dest_dir: " << obj.dest_dir - << ", limit: " << obj.limit << ", prefix: " << obj.prefix; - return os; - } -}; - -/** - * @brief Data object for information about dumpings logs. - * - * @param src_dir is a const char* containing the path to a file to be copied. - * @param dest_dir is a const char* containing the destination path for the file - * to be copied to. - */ -struct FileCopyInfo { - const std::string_view src_dir; - const std::string_view dest_dir; - - friend bool operator==(const FileCopyInfo& lhs, const FileCopyInfo& rhs) { - return (lhs.src_dir == rhs.src_dir) && (lhs.dest_dir == rhs.dest_dir); - } - - // Do I have to add .data() here? - friend std::ostream& operator<<(std::ostream& os, const FileCopyInfo& obj) { - os << "src_dir: " << obj.src_dir << ", dest_dir: " << obj.dest_dir; - return os; - } -}; - -/** - * @brief Interface for dumping modem logs and files. - */ -class Dumper { - public: - virtual ~Dumper() = default; - virtual void DumpLogs(const LogDumpInfo& log_dump_info); - virtual void CopyFile(const FileCopyInfo& file_copy_info); -}; - -} // namespace pixel_modem::logging diff --git a/modem/dump_modemlog/include/modem_log_dumper.h b/modem/dump_modemlog/include/modem_log_dumper.h deleted file mode 100644 index 1533217..0000000 --- a/modem/dump_modemlog/include/modem_log_dumper.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once - -#include "android_property_manager.h" -#include "dumper.h" - -namespace pixel_modem::logging { - -/** - * @brief Responsible for dumping all relevant modem logs. - */ -class ModemLogDumper { - public: - ModemLogDumper(Dumper& dumper, - AndroidPropertyManager& android_property_manager) - : dumper_(dumper), android_property_manager_(android_property_manager){}; - - /** - * @brief Dumps modem related logs and persistent files to bugreport. - * - * If PILOT and On Demand Logging are both not enabled, this method will - * attempt to stop modem logging, copy over the logs, and then restart so that - * the original logging enabled / disabled state is preserved. Additionally, - * all directories specified in `kLogDumpInfo` and all files in - * `kFileCopyInfo` will be included. - */ - void DumpModemLogs(); - - private: - /** - * @brief Checks modem logging status property to assert if logging is - * running or not. - */ - bool isModemLoggingRunning(); - - /** - * @brief Checks if On Demand Logging or PILOT Logging is enabled. - * - * If either of them are enabled, then the `log_path` property will no longer - * point to the always on logging directory. - */ - bool allowedToStopModemLogging(); - - /** - * @brief Stops modem logging. - * - * This sets the modem logging property which in turn triggers - * modem_logging_control's modem_logging_stop service. Modem logging isn't - * guaranteed to have stopped after this call, so it's necessary to poll the - * status property to ensure it's stopped before proceeding. - */ - void stopModemLogging(); - - /** - * @brief Polls modem logging status property to ensure modem logging has - * stopped. - * - * Even after the property is confirmed to be false, it will continue to - * sleep for a second to ensure that the modem_logging_stop service has exited - * properly. - */ - void waitForStopModemLogging(); - - /** - * @brief Starts modem logging. - * - * This sets the modem logging property which in turn triggers - * modem_logging_control's modem_logging_start service. Modem logging isn't - * guaranteed to have started after this call, so it's necessary to poll the - * status property to ensure it's started before proceeding to guarantee - * success. - */ - void startModemLogging(); - - private: - Dumper& dumper_; - AndroidPropertyManager& android_property_manager_; -}; - -} // namespace pixel_modem::logging diff --git a/modem/dump_modemlog/modem_log_dumper.cpp b/modem/dump_modemlog/modem_log_dumper.cpp deleted file mode 100644 index 127478e..0000000 --- a/modem/dump_modemlog/modem_log_dumper.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "modem_log_dumper.h" - -#include - -#include "bugreport_constants.h" -#include "dumper.h" -#include "modem_log_constants.h" - -namespace pixel_modem::logging { - -void ModemLogDumper::DumpModemLogs() { - bool shouldRestartModemLogging = - allowedToStopModemLogging() && isModemLoggingRunning(); - int maxFileNum = android_property_manager_.GetIntProperty( - kModemLoggingNumberBugreportProperty.data(), - kDefaultBugreportNumberFiles); - - // Should always trigger `stopModemLogging`. This is because currently copying - // modem logs and stopping modem logging are entangled. - // TODO: b/289435256 - Always copy logs and return this to checking if logging - // is actively running. - if (allowedToStopModemLogging()) { - // If modem logging is running at time of bugreport, it needs to be stopped - // to ensure that the most recent logs are included in the bugreport. If - // this command fails, only older log files will be included, as seen in - // b/289435256. - stopModemLogging(); - waitForStopModemLogging(); - } else { - ALOGD("modem logging is not running\n"); - } - - dumper_.DumpLogs({kModemAlwaysOnLogDirectory, kBugreportPackingDirectory, - maxFileNum, kModemLogPrefix}); - - if (shouldRestartModemLogging) { - startModemLogging(); - } - - for (const LogDumpInfo& log_dump_info : kLogDumpInfo) { - dumper_.DumpLogs(log_dump_info); - } - - for (const FileCopyInfo& file_copy_info : kFileCopyInfo) { - dumper_.CopyFile(file_copy_info); - } -}; - -bool ModemLogDumper::isModemLoggingRunning() { - return android_property_manager_.GetBoolProperty( - kModemLoggingStatusProperty.data(), false); -} - -bool ModemLogDumper::allowedToStopModemLogging() { - return android_property_manager_.GetProperty(kModemLoggingPathProperty.data(), - /*default_value=*/"") == - kModemAlwaysOnLogDirectory; -} - -void ModemLogDumper::stopModemLogging() { - android_property_manager_.SetProperty(kModemLoggingEnabledProperty.data(), - "false"); - ALOGD("Stopping modem logging...\n"); -} - -void ModemLogDumper::waitForStopModemLogging() { - // TODO(b/289582966) improve stop logging mechanism to not use sleep - for (int i = 0; i < 15; i++) { - if (!isModemLoggingRunning()) { - ALOGD("modem logging stopped\n"); - sleep(1); - break; - } - sleep(1); - } -} - -void ModemLogDumper::startModemLogging() { - ALOGD("Restarting modem logging...\n"); - android_property_manager_.SetProperty(kModemLoggingEnabledProperty.data(), - "true"); -} - -} // namespace pixel_modem::logging diff --git a/modem/dump_modemlog/modem_log_dumper_test.cpp b/modem/dump_modemlog/modem_log_dumper_test.cpp deleted file mode 100644 index 81bec8b..0000000 --- a/modem/dump_modemlog/modem_log_dumper_test.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "modem_log_dumper.h" - -#include - -#include "android_property_manager.h" -#include "bugreport_constants.h" -#include "dumper.h" -#include "fake_android_property_manager.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "modem_log_constants.h" - -namespace pixel_modem::logging { -namespace { - -using ::testing::Eq; - -inline constexpr static std::string_view kFakePilotLoggingPath = - "//pilot/logging/path"; -inline constexpr static std::string_view kFakeOnDemandLoggingPath = - "//on/demand/logging/path"; -inline constexpr static LogDumpInfo kAlwaysOnLogDumpInfo = { - kModemAlwaysOnLogDirectory, kBugreportPackingDirectory, - kDefaultBugreportNumberFiles, kModemLogPrefix}; - -void StartModemLogging( - FakeAndroidPropertyManager& fake_android_property_manager) { - fake_android_property_manager.SetProperty(kModemLoggingEnabledProperty.data(), - kTruthString.data()); -} - -class MockDumper : public Dumper { - public: - ~MockDumper() = default; - MOCK_METHOD(void, DumpLogs, (const LogDumpInfo&), (override)); - MOCK_METHOD(void, CopyFile, (const FileCopyInfo&), (override)); -}; - -class ModemLogDumperTest : public ::testing::Test { - protected: - ModemLogDumperTest() - : modem_log_dumper(mock_dumper, fake_android_property_manager) {} - - void SetUp() override { - // set default logging mode to always on logging - fake_android_property_manager.SetProperty( - kModemLoggingPathProperty.data(), kModemAlwaysOnLogDirectory.data()); - } - - MockDumper mock_dumper; - FakeAndroidPropertyManager fake_android_property_manager; - ModemLogDumper modem_log_dumper; -}; - -TEST_F(ModemLogDumperTest, DumpLogsDumpsAllDirectoriesAndCopiesAllFiles) { - EXPECT_CALL(mock_dumper, DumpLogs(Eq(kAlwaysOnLogDumpInfo))); - - for (const LogDumpInfo& log_dump_info : kLogDumpInfo) { - EXPECT_CALL(mock_dumper, DumpLogs(Eq(log_dump_info))); - } - - for (const FileCopyInfo& fileCopyInfo : kFileCopyInfo) { - EXPECT_CALL(mock_dumper, CopyFile(Eq(fileCopyInfo))); - } - - modem_log_dumper.DumpModemLogs(); -} - -TEST_F(ModemLogDumperTest, DumpLogsRestartModemLoggingWhenEnabled) { - StartModemLogging(fake_android_property_manager); - - modem_log_dumper.DumpModemLogs(); - - EXPECT_TRUE(fake_android_property_manager.ModemLoggingHasRestarted()); -} - -TEST_F(ModemLogDumperTest, DumpLogsDoesNotRestartModemLoggingWhenDisabled) { - modem_log_dumper.DumpModemLogs(); - - EXPECT_FALSE(fake_android_property_manager.ModemLoggingHasRestarted()); -} - -TEST_F(ModemLogDumperTest, DumpLogsDoesNotRestartModemLoggingWhenPilotEnabled) { - // Enable PILOT - fake_android_property_manager.SetProperty(kModemLoggingPathProperty.data(), - kFakePilotLoggingPath.data()); - StartModemLogging(fake_android_property_manager); - - modem_log_dumper.DumpModemLogs(); - - EXPECT_FALSE(fake_android_property_manager.ModemLoggingHasRestarted()); -} - -TEST_F(ModemLogDumperTest, - DumpLogsDoesNotRestartModemLoggingWhenOnDemandLoggingEnabled) { - // Enable On Demand Logging - fake_android_property_manager.SetProperty(kModemLoggingPathProperty.data(), - kFakeOnDemandLoggingPath.data()); - StartModemLogging(fake_android_property_manager); - - modem_log_dumper.DumpModemLogs(); - - EXPECT_FALSE(fake_android_property_manager.ModemLoggingHasRestarted()); -} - -} // namespace -} // namespace pixel_modem::logging diff --git a/modem/dump_modemlog/sepolicy/dump_modem.te b/modem/dump_modemlog/sepolicy/dump_modem.te deleted file mode 100644 index a1a9e08..0000000 --- a/modem/dump_modemlog/sepolicy/dump_modem.te +++ /dev/null @@ -1,14 +0,0 @@ -pixel_bugreport(dump_modem) - -allow dump_modem modem_stat_data_file:dir search; -allow dump_modem modem_stat_data_file:file r_file_perms; -allow dump_modem sscoredump_vendor_data_crashinfo_file:dir r_dir_perms; -allow dump_modem sscoredump_vendor_data_crashinfo_file:file r_file_perms; -allow dump_modem vendor_log_file:dir search; -allow dump_modem vendor_rfsd_log_file:dir r_dir_perms; -allow dump_modem vendor_rfsd_log_file:file r_file_perms; -allow dump_modem vendor_toolbox_exec:file execute_no_trans; -allow dump_modem sysfs_dump_modem:file r_file_perms; -allow dump_modem logbuffer_device:chr_file r_file_perms; -allow dump_modem radio_vendor_data_file:dir r_dir_perms; -allow dump_modem radio_vendor_data_file:file r_file_perms; diff --git a/modem/dump_modemlog/sepolicy/dump_modemlog.te b/modem/dump_modemlog/sepolicy/dump_modemlog.te deleted file mode 100644 index b7082c9..0000000 --- a/modem/dump_modemlog/sepolicy/dump_modemlog.te +++ /dev/null @@ -1,10 +0,0 @@ -pixel_bugreport(dump_modemlog) - -allow dump_modemlog mnt_vendor_file:dir search; -allow dump_modemlog modem_efs_file:dir search; -allow dump_modemlog modem_efs_file:file r_file_perms; -allow dump_modemlog vendor_slog_file:dir r_dir_perms; -allow dump_modemlog vendor_slog_file:file r_file_perms; -allow dump_modemlog radio_vendor_data_file:dir create_dir_perms; -allow dump_modemlog radio_vendor_data_file:file create_file_perms; -set_prop(dump_modemlog, vendor_modem_prop) diff --git a/modem/dump_modemlog/sepolicy/file.te b/modem/dump_modemlog/sepolicy/file.te deleted file mode 100644 index 383480d..0000000 --- a/modem/dump_modemlog/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type sysfs_dump_modem, sysfs_type, fs_type; diff --git a/modem/dump_modemlog/sepolicy/file_contexts b/modem/dump_modemlog/sepolicy/file_contexts deleted file mode 100644 index 6d5c082..0000000 --- a/modem/dump_modemlog/sepolicy/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/bin/dump/dump_modem u:object_r:dump_modem_exec:s0 -/vendor/bin/dump/dump_modemlog u:object_r:dump_modemlog_exec:s0 - diff --git a/modem/dump_modemlog/sepolicy/genfs_contexts b/modem/dump_modemlog/sepolicy/genfs_contexts deleted file mode 100644 index 98a8fc5..0000000 --- a/modem/dump_modemlog/sepolicy/genfs_contexts +++ /dev/null @@ -1,2 +0,0 @@ -genfscon sysfs /devices/platform/cpif/wakeup_events u:object_r:sysfs_dump_modem:s0 -genfscon sysfs /devices/platform/cpif/modem/pcie_event_stats u:object_r:sysfs_dump_modem:s0 diff --git a/modem/modem.mk b/modem/modem.mk deleted file mode 100644 index d921e74..0000000 --- a/modem/modem.mk +++ /dev/null @@ -1 +0,0 @@ -include device/google/gs-common/modem/dump_modemlog/dump_modemlog.mk diff --git a/modem/modem_log_constants/Android.bp b/modem/modem_log_constants/Android.bp deleted file mode 100644 index f4e3177..0000000 --- a/modem/modem_log_constants/Android.bp +++ /dev/null @@ -1,9 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_library { - name: "modem_log_constants", - export_include_dirs: [ "include" ], - vendor_available: true, -} diff --git a/modem/modem_log_constants/include/modem_log_constants.h b/modem/modem_log_constants/include/modem_log_constants.h deleted file mode 100644 index 68004cf..0000000 --- a/modem/modem_log_constants/include/modem_log_constants.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include - -namespace pixel_modem::logging { - -// Modem related Android System Properties - -// Controls triggering `modem_logging_start` and `modem_logging_stop`. -inline constexpr std::string_view kModemLoggingEnabledProperty = - "vendor.sys.modem.logging.enable"; -// Signals the current modem logging state. This will be set to -// `vendor.sys.modem.logging.enable` when `modem_log_start` or `modem_log_stop` -// terminates. -inline constexpr std::string_view kModemLoggingStatusProperty = - "vendor.sys.modem.logging.status"; -// Int which specifies how many files to include in the bugreport. -inline constexpr std::string_view kModemLoggingNumberBugreportProperty = - "persist.vendor.sys.modem.logging.br_num"; -// Signals the current location that is being logged to. This can be used to -// determine the logging type. -inline constexpr std::string_view kModemLoggingPathProperty = - "vendor.sys.modem.logging.log_path"; -inline constexpr std::string_view kModemLoggingLogCountProperty = - "vendor.sys.modem.logging.log_count"; -inline constexpr std::string_view kModemLoggingLogPath = - "vendor.sys.modem.logging.log_path"; - -// Bugreport constants -inline constexpr int kDefaultBugreportNumberFiles = 100; -inline constexpr std::string_view kModemAlwaysOnLogDirectory = - "/data/vendor/radio/logs/always-on"; -inline constexpr std::string_view kModemLogPrefix = "sbuff_"; - -} // namespace pixel_modem::logging diff --git a/modem/modem_svc_sit/compatibility_matrix.xml b/modem/modem_svc_sit/compatibility_matrix.xml deleted file mode 100644 index 14d987a..0000000 --- a/modem/modem_svc_sit/compatibility_matrix.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - com.google.pixel.shared_modem_platform - 3 - - ISharedModemPlatform - default - - - diff --git a/modem/modem_svc_sit/sepolicy/attributes b/modem/modem_svc_sit/sepolicy/attributes deleted file mode 100644 index 2cc802d..0000000 --- a/modem/modem_svc_sit/sepolicy/attributes +++ /dev/null @@ -1 +0,0 @@ -hal_attribute(shared_modem_platform) diff --git a/modem/modem_svc_sit/sepolicy/file_contexts b/modem/modem_svc_sit/sepolicy/file_contexts deleted file mode 100644 index d6f4a74..0000000 --- a/modem/modem_svc_sit/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# modem_svc_sit -/vendor/bin/shared_modem_platform u:object_r:modem_svc_sit_exec:s0 \ No newline at end of file diff --git a/modem/modem_svc_sit/sepolicy/hal_shared_modem_platform.te b/modem/modem_svc_sit/sepolicy/hal_shared_modem_platform.te deleted file mode 100644 index 8771563..0000000 --- a/modem/modem_svc_sit/sepolicy/hal_shared_modem_platform.te +++ /dev/null @@ -1,8 +0,0 @@ -# Allow binder connection from client to server -binder_call(hal_shared_modem_platform_client, hal_shared_modem_platform_server) - -# Allow client to find the service, server to register the service -hal_attribute_service(hal_shared_modem_platform, hal_shared_modem_platform_service) - -# Allow binder communication from server to service_manager -binder_use(hal_shared_modem_platform_server) diff --git a/modem/modem_svc_sit/sepolicy/modem_svc_sit.te b/modem/modem_svc_sit/sepolicy/modem_svc_sit.te deleted file mode 100644 index 71bb442..0000000 --- a/modem/modem_svc_sit/sepolicy/modem_svc_sit.te +++ /dev/null @@ -1,3 +0,0 @@ -# Modem SVC will register the default instance of the AIDL ISharedModemPlatform hal. -hal_server_domain(modem_svc_sit, hal_shared_modem_platform) -binder_call(hal_shared_modem_platform_server, hal_shared_modem_platform_client) diff --git a/modem/modem_svc_sit/sepolicy/service.te b/modem/modem_svc_sit/sepolicy/service.te deleted file mode 100644 index 0fd48ee..0000000 --- a/modem/modem_svc_sit/sepolicy/service.te +++ /dev/null @@ -1,2 +0,0 @@ -# define hal_shared_modem_platform_service -type hal_shared_modem_platform_service, hal_service_type, service_manager_type; diff --git a/modem/modem_svc_sit/sepolicy/service_contexts b/modem/modem_svc_sit/sepolicy/service_contexts deleted file mode 100644 index 58232f7..0000000 --- a/modem/modem_svc_sit/sepolicy/service_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Bind Shared Modem Platform AIDL service name to the SELinux type. -com.google.pixel.shared_modem_platform.ISharedModemPlatform/default u:object_r:hal_shared_modem_platform_service:s0 diff --git a/modem/modem_svc_sit/shared_modem_platform.mk b/modem/modem_svc_sit/shared_modem_platform.mk deleted file mode 100644 index 6e9b05d..0000000 --- a/modem/modem_svc_sit/shared_modem_platform.mk +++ /dev/null @@ -1,14 +0,0 @@ -# This file is not included in `modem.mk` since this is included at the -# beginning of each `device.mk` file, and so will be called before -# `SHARED_MODEM_PLATFORM_VENDOR` is defined later in the file. -# This file supoorts Whitechapel(gs101), Whitechapel Pro(gs201), Zuma, Zuma Pro. -# This file doesn't support devices which AP is after Zuma Pro. -# For device after Zuma Pro please use gs-common/modem/shared_modem_platform/shared_modem_platform.mk -SOONG_CONFIG_NAMESPACES += shared_modem_platform -SOONG_CONFIG_shared_modem_platform += \ - vendor -SOONG_CONFIG_shared_modem_platform_vendor := $(SHARED_MODEM_PLATFORM_VENDOR) - -PRODUCT_PACKAGES += shared_modem_platform -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/modem/modem_svc_sit/compatibility_matrix.xml -BOARD_SEPOLICY_DIRS += device/google/gs-common/modem/modem_svc_sit/sepolicy diff --git a/modem/pixel_modem_service/pixel_modem_service.mk b/modem/pixel_modem_service/pixel_modem_service.mk deleted file mode 100644 index 266b966..0000000 --- a/modem/pixel_modem_service/pixel_modem_service.mk +++ /dev/null @@ -1,10 +0,0 @@ -# This file is not included in `modem.mk` since this is included at the -# beginning of each `device.mk` file, and so will be called before -# `PIXEL_MODEM_SERVICE_FLAVOUR` is defined later in the file. - -SOONG_CONFIG_NAMESPACES += pixel_modem_service -SOONG_CONFIG_pixel_modem_service += \ - flavour -SOONG_CONFIG_pixel_modem_service_flavour := $(PIXEL_MODEM_SERVICE_FLAVOUR) - -PRODUCT_PACKAGES += PixelModemService diff --git a/modem/radio_ext/compatibility_matrix.xml b/modem/radio_ext/compatibility_matrix.xml deleted file mode 100644 index 1e4def5..0000000 --- a/modem/radio_ext/compatibility_matrix.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - vendor.google.radio_ext - 1 - - IRadioExt - default - - - diff --git a/modem/radio_ext/radio_ext.mk b/modem/radio_ext/radio_ext.mk deleted file mode 100644 index cd8c6a3..0000000 --- a/modem/radio_ext/radio_ext.mk +++ /dev/null @@ -1,5 +0,0 @@ -PRODUCT_PACKAGES += vendor.google.radio_ext-service -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/modem/radio_ext/compatibility_matrix.xml - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/modem/radio_ext/sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gril/common/sepolicy diff --git a/modem/radio_ext/sepolicy/file_contexts b/modem/radio_ext/sepolicy/file_contexts deleted file mode 100644 index cd4172c..0000000 --- a/modem/radio_ext/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/hw/vendor\.google\.radio_ext-service u:object_r:hal_radio_ext_exec:s0 diff --git a/modem/radio_ext/sepolicy/grilservice_app.te b/modem/radio_ext/sepolicy/grilservice_app.te deleted file mode 100644 index 9bd8c8e..0000000 --- a/modem/radio_ext/sepolicy/grilservice_app.te +++ /dev/null @@ -1,2 +0,0 @@ -allow grilservice_app hal_radio_ext_service:service_manager find; -binder_call(grilservice_app, hal_radio_ext) diff --git a/modem/radio_ext/sepolicy/hal_radio_ext.te b/modem/radio_ext/sepolicy/hal_radio_ext.te deleted file mode 100644 index 203ae3b..0000000 --- a/modem/radio_ext/sepolicy/hal_radio_ext.te +++ /dev/null @@ -1,11 +0,0 @@ -type hal_radio_ext, domain; -type hal_radio_ext_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(hal_radio_ext) - -binder_call(hal_radio_ext, servicemanager) -add_service(hal_radio_ext, hal_radio_ext_service) - -# Allow access to the backlight driver to set ssc_mode -allow hal_radio_ext sysfs_leds:dir search; -allow hal_radio_ext sysfs_leds:file rw_file_perms; diff --git a/modem/radio_ext/sepolicy/service_contexts b/modem/radio_ext/sepolicy/service_contexts deleted file mode 100644 index 7e50c2e..0000000 --- a/modem/radio_ext/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.google.radio_ext.IRadioExt/default u:object_r:hal_radio_ext_service:s0 diff --git a/modem/shared_modem_platform/compatibility_matrix.xml b/modem/shared_modem_platform/compatibility_matrix.xml deleted file mode 100644 index 14d987a..0000000 --- a/modem/shared_modem_platform/compatibility_matrix.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - com.google.pixel.shared_modem_platform - 3 - - ISharedModemPlatform - default - - - diff --git a/modem/shared_modem_platform/sepolicy/attributes b/modem/shared_modem_platform/sepolicy/attributes deleted file mode 100644 index 2cc802d..0000000 --- a/modem/shared_modem_platform/sepolicy/attributes +++ /dev/null @@ -1 +0,0 @@ -hal_attribute(shared_modem_platform) diff --git a/modem/shared_modem_platform/sepolicy/file.te b/modem/shared_modem_platform/sepolicy/file.te deleted file mode 100644 index 0f9ce9a..0000000 --- a/modem/shared_modem_platform/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# Define the type which declare in genfs_contexts -type sysfs_kernel_metrics, sysfs_type, fs_type; diff --git a/modem/shared_modem_platform/sepolicy/file_contexts b/modem/shared_modem_platform/sepolicy/file_contexts deleted file mode 100644 index 8760799..0000000 --- a/modem/shared_modem_platform/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# shared_modem_platform -/vendor/bin/shared_modem_platform u:object_r:shared_modem_platform_exec:s0 \ No newline at end of file diff --git a/modem/shared_modem_platform/sepolicy/genfs_contexts b/modem/shared_modem_platform/sepolicy/genfs_contexts deleted file mode 100644 index 3075e43..0000000 --- a/modem/shared_modem_platform/sepolicy/genfs_contexts +++ /dev/null @@ -1,6 +0,0 @@ -genfscon sysfs /kernel/pixel_metrics/modem/modem_boot_duration u:object_r:sysfs_kernel_metrics:s0 -genfscon sysfs /kernel/pixel_metrics/modem/modem_wakeup_ap u:object_r:sysfs_kernel_metrics:s0 -genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_state u:object_r:sysfs_kernel_metrics:s0 -genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_duration u:object_r:sysfs_kernel_metrics:s0 -genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_stats u:object_r:sysfs_kernel_metrics:s0 -genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_updown u:object_r:sysfs_kernel_metrics:s0 diff --git a/modem/shared_modem_platform/sepolicy/hal_shared_modem_platform.te b/modem/shared_modem_platform/sepolicy/hal_shared_modem_platform.te deleted file mode 100644 index 8771563..0000000 --- a/modem/shared_modem_platform/sepolicy/hal_shared_modem_platform.te +++ /dev/null @@ -1,8 +0,0 @@ -# Allow binder connection from client to server -binder_call(hal_shared_modem_platform_client, hal_shared_modem_platform_server) - -# Allow client to find the service, server to register the service -hal_attribute_service(hal_shared_modem_platform, hal_shared_modem_platform_service) - -# Allow binder communication from server to service_manager -binder_use(hal_shared_modem_platform_server) diff --git a/modem/shared_modem_platform/sepolicy/service.te b/modem/shared_modem_platform/sepolicy/service.te deleted file mode 100644 index 390fde6..0000000 --- a/modem/shared_modem_platform/sepolicy/service.te +++ /dev/null @@ -1 +0,0 @@ -type hal_shared_modem_platform_service, hal_service_type, service_manager_type; diff --git a/modem/shared_modem_platform/sepolicy/service_contexts b/modem/shared_modem_platform/sepolicy/service_contexts deleted file mode 100644 index 58232f7..0000000 --- a/modem/shared_modem_platform/sepolicy/service_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Bind Shared Modem Platform AIDL service name to the SELinux type. -com.google.pixel.shared_modem_platform.ISharedModemPlatform/default u:object_r:hal_shared_modem_platform_service:s0 diff --git a/modem/shared_modem_platform/sepolicy/shared_modem_platform.te b/modem/shared_modem_platform/sepolicy/shared_modem_platform.te deleted file mode 100644 index d3cabac..0000000 --- a/modem/shared_modem_platform/sepolicy/shared_modem_platform.te +++ /dev/null @@ -1,5 +0,0 @@ -# Shared modem platform will register the default instance of the AIDL ISharedModemPlatform hal. -hal_server_domain(shared_modem_platform, hal_shared_modem_platform) - -allow shared_modem_platform sysfs_kernel_metrics:file r_file_perms; - diff --git a/modem/shared_modem_platform/shared_modem_platform.mk b/modem/shared_modem_platform/shared_modem_platform.mk deleted file mode 100644 index 3c2a109..0000000 --- a/modem/shared_modem_platform/shared_modem_platform.mk +++ /dev/null @@ -1,13 +0,0 @@ -# This file is not included in `modem.mk` since this is included at the -# beginning of each `device.mk` file, and so will be called before -# `SHARED_MODEM_PLATFORM_VENDOR` is defined later in the file. -# This file supports support devices which AP is after zumapro(not include). -# For device before zumapro(include) please use gs-common/modem/modem_svc_sit/shared_modem_platform.mk -SOONG_CONFIG_NAMESPACES += shared_modem_platform -SOONG_CONFIG_shared_modem_platform += \ - vendor -SOONG_CONFIG_shared_modem_platform_vendor := $(SHARED_MODEM_PLATFORM_VENDOR) - -PRODUCT_PACKAGES += shared_modem_platform -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/modem/shared_modem_platform/compatibility_matrix.xml -BOARD_SEPOLICY_DIRS += device/google/gs-common/modem/shared_modem_platform/sepolicy diff --git a/mte/OWNERS b/mte/OWNERS deleted file mode 100644 index 57da09d..0000000 --- a/mte/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -eugenis@google.com -pcc@google.com -fmayer@google.com -nnk@google.com diff --git a/mte/fullmte-pixel.mk b/mte/fullmte-pixel.mk deleted file mode 100644 index ac2aba8..0000000 --- a/mte/fullmte-pixel.mk +++ /dev/null @@ -1,5 +0,0 @@ -include build/make/target/product/fullmte.mk - -PRODUCT_MODULE_BUILD_FROM_SOURCE := true - -BOARD_KERNEL_CMDLINE += bootloader.pixel.MTE_FORCE_ON diff --git a/nfc/nfc.mk b/nfc/nfc.mk deleted file mode 100644 index e7611af..0000000 --- a/nfc/nfc.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/nfc/sepolicy diff --git a/nfc/sepolicy/file.te b/nfc/sepolicy/file.te deleted file mode 100644 index 5b9cba7..0000000 --- a/nfc/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_nfc_vendor_data_file, file_type, data_file_type; diff --git a/nfc/sepolicy/file_contexts b/nfc/sepolicy/file_contexts deleted file mode 100644 index 121b5c9..0000000 --- a/nfc/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/data/vendor/nfc(/.*)? u:object_r:vendor_nfc_vendor_data_file:s0 diff --git a/nfc/sepolicy/hal_nfc_default.te b/nfc/sepolicy/hal_nfc_default.te deleted file mode 100644 index 9486137..0000000 --- a/nfc/sepolicy/hal_nfc_default.te +++ /dev/null @@ -1,2 +0,0 @@ -allow hal_nfc_default vendor_nfc_vendor_data_file:dir create_dir_perms; -allow hal_nfc_default vendor_nfc_vendor_data_file:file create_file_perms; diff --git a/nfc/sepolicy/nfc.te b/nfc/sepolicy/nfc.te deleted file mode 100644 index ee361b5..0000000 --- a/nfc/sepolicy/nfc.te +++ /dev/null @@ -1 +0,0 @@ -allow nfc vendor_nfc_vendor_data_file:dir search; diff --git a/nfc/sepolicy_st21nfc/file_contexts b/nfc/sepolicy_st21nfc/file_contexts deleted file mode 100644 index a06842a..0000000 --- a/nfc/sepolicy_st21nfc/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/dev/st21nfc u:object_r:nfc_device:s0 -/vendor/bin/hw/android\.hardware\.nfc-service\.st u:object_r:hal_nfc_default_exec:s0 diff --git a/nfc/sepolicy_st21nfc/hal_nfc_default.te b/nfc/sepolicy_st21nfc/hal_nfc_default.te deleted file mode 100644 index 051b64d..0000000 --- a/nfc/sepolicy_st21nfc/hal_nfc_default.te +++ /dev/null @@ -1,4 +0,0 @@ -# HAL NFC property -set_prop(hal_nfc_default, vendor_secure_element_prop) -set_prop(hal_nfc_default, vendor_nfc_prop) -set_prop(hal_nfc_default, vendor_nfc_antenna_prop) diff --git a/nfc/sepolicy_st21nfc/property.te b/nfc/sepolicy_st21nfc/property.te deleted file mode 100644 index 02e5d54..0000000 --- a/nfc/sepolicy_st21nfc/property.te +++ /dev/null @@ -1,4 +0,0 @@ -# NFC -vendor_internal_prop(vendor_nfc_prop) -vendor_restricted_prop(vendor_nfc_antenna_prop) - diff --git a/nfc/sepolicy_st21nfc/property_contexts b/nfc/sepolicy_st21nfc/property_contexts deleted file mode 100644 index 0b22a27..0000000 --- a/nfc/sepolicy_st21nfc/property_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# NFC -persist.vendor.nfc. u:object_r:vendor_nfc_prop:s0 -persist.vendor.nfc.antenna. u:object_r:vendor_nfc_antenna_prop:s0 - diff --git a/nfc/sepolicy_st21nfc/untrusted_app.te b/nfc/sepolicy_st21nfc/untrusted_app.te deleted file mode 100644 index d9b30bc..0000000 --- a/nfc/sepolicy_st21nfc/untrusted_app.te +++ /dev/null @@ -1,5 +0,0 @@ -# NFC -userdebug_or_eng( - get_prop(untrusted_app, vendor_nfc_antenna_prop) -) - diff --git a/nfc/sepolicy_st21nfc/vendor_init.te b/nfc/sepolicy_st21nfc/vendor_init.te deleted file mode 100644 index 7de90e2..0000000 --- a/nfc/sepolicy_st21nfc/vendor_init.te +++ /dev/null @@ -1,2 +0,0 @@ -# NFC vendor property -set_prop(vendor_init, vendor_nfc_prop) diff --git a/nfc/sepolicy_st54spi/file.te b/nfc/sepolicy_st54spi/file.te deleted file mode 100644 index 5f9a80d..0000000 --- a/nfc/sepolicy_st54spi/file.te +++ /dev/null @@ -1,3 +0,0 @@ -# SecureElement SPI device -type st54spi_device, dev_type; - diff --git a/nfc/sepolicy_st54spi/file_contexts b/nfc/sepolicy_st54spi/file_contexts deleted file mode 100644 index f2762f3..0000000 --- a/nfc/sepolicy_st54spi/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ -/dev/st54spi u:object_r:st54spi_device:s0 -/vendor/bin/hw/android\.hardware\.secure_element-service\.thales u:object_r:hal_secure_element_st54spi_aidl_exec:s0 - diff --git a/nfc/sepolicy_st54spi/hal_secure_element_st54spi_aidl.te b/nfc/sepolicy_st54spi/hal_secure_element_st54spi_aidl.te deleted file mode 100644 index f2051e0..0000000 --- a/nfc/sepolicy_st54spi/hal_secure_element_st54spi_aidl.te +++ /dev/null @@ -1,9 +0,0 @@ -# sepolicy for ST54L secure element -type hal_secure_element_st54spi_aidl, domain; -type hal_secure_element_st54spi_aidl_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(hal_secure_element_st54spi_aidl) -hal_server_domain(hal_secure_element_st54spi_aidl, hal_secure_element) -allow hal_secure_element_st54spi_aidl st54spi_device:chr_file rw_file_perms; -allow hal_secure_element_st54spi_aidl nfc_device:chr_file rw_file_perms; -set_prop(hal_secure_element_st54spi_aidl, vendor_secure_element_prop) - diff --git a/nfc/sepolicy_st54spi/property.te b/nfc/sepolicy_st54spi/property.te deleted file mode 100644 index 1ac5526..0000000 --- a/nfc/sepolicy_st54spi/property.te +++ /dev/null @@ -1,3 +0,0 @@ -# SecureElement vendor property -vendor_internal_prop(vendor_secure_element_prop) - diff --git a/nfc/sepolicy_st54spi/property_contexts b/nfc/sepolicy_st54spi/property_contexts deleted file mode 100644 index 2067a86..0000000 --- a/nfc/sepolicy_st54spi/property_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# SecureElement vendor property -persist.vendor.se. u:object_r:vendor_secure_element_prop:s0 diff --git a/nfc/sepolicy_st54spi/vendor_init.te b/nfc/sepolicy_st54spi/vendor_init.te deleted file mode 100644 index 91e5cdb..0000000 --- a/nfc/sepolicy_st54spi/vendor_init.te +++ /dev/null @@ -1,2 +0,0 @@ -# SecureElement vendor property -set_prop(vendor_init, vendor_secure_element_prop) diff --git a/nfc/st21nfc.mk b/nfc/st21nfc.mk deleted file mode 100644 index c30ecce..0000000 --- a/nfc/st21nfc.mk +++ /dev/null @@ -1,2 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/nfc/sepolicy_st21nfc -PRODUCT_PACKAGES += android.hardware.nfc-service.st diff --git a/nfc/st54spi.mk b/nfc/st54spi.mk deleted file mode 100644 index 046de87..0000000 --- a/nfc/st54spi.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/nfc/sepolicy_st54spi -PRODUCT_PACKAGES += android.hardware.secure_element-service.thales - diff --git a/pcie/Android.bp b/pcie/Android.bp deleted file mode 100644 index ae6a94e..0000000 --- a/pcie/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_pcie.sh", - src: "dump_pcie.sh", - vendor: true, - sub_dir: "dump", -} diff --git a/pcie/dump_pcie.sh b/pcie/dump_pcie.sh deleted file mode 100644 index 4546207..0000000 --- a/pcie/dump_pcie.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/vendor/bin/sh -echo "--- pcie0 dump ---" -cat /dev/logbuffer_pcie0 -echo "--- pcie1 dump ---" -cat /dev/logbuffer_pcie1 - -echo "--- pcie link statistics ---" -for f in /sys/devices/platform/*.pcie/link_stats/* -do - echo "$f: `cat $f`" -done diff --git a/pcie/pcie.mk b/pcie/pcie.mk deleted file mode 100644 index f9ab327..0000000 --- a/pcie/pcie.mk +++ /dev/null @@ -1,2 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pcie/sepolicy -PRODUCT_PACKAGES += dump_pcie.sh diff --git a/pcie/sepolicy/device.te b/pcie/sepolicy/device.te deleted file mode 100644 index 934cdb4..0000000 --- a/pcie/sepolicy/device.te +++ /dev/null @@ -1,2 +0,0 @@ -type pcie_log_device, dev_type; -type sysfs_pcie, sysfs_type, fs_type; diff --git a/pcie/sepolicy/dump_pcie.te b/pcie/sepolicy/dump_pcie.te deleted file mode 100644 index 30b2241..0000000 --- a/pcie/sepolicy/dump_pcie.te +++ /dev/null @@ -1,7 +0,0 @@ -pixel_bugreport(dump_pcie) - -allow dump_pcie pcie_log_device:chr_file r_file_perms; -allow dump_pcie vendor_toolbox_exec:file execute_no_trans; - -allow dump_pcie sysfs:dir r_dir_perms; -allow dump_pcie sysfs_pcie:file r_file_perms; diff --git a/pcie/sepolicy/file_contexts b/pcie/sepolicy/file_contexts deleted file mode 100644 index e06f754..0000000 --- a/pcie/sepolicy/file_contexts +++ /dev/null @@ -1,4 +0,0 @@ -/vendor/bin/dump/dump_pcie\.sh u:object_r:dump_pcie_exec:s0 - -/dev/logbuffer_pcie0 u:object_r:pcie_log_device:s0 -/dev/logbuffer_pcie1 u:object_r:pcie_log_device:s0 diff --git a/performance/Android.bp b/performance/Android.bp deleted file mode 100644 index 6dae537..0000000 --- a/performance/Android.bp +++ /dev/null @@ -1,22 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_perf", - srcs: ["dump_perf.cpp"], - init_rc: [ - "init.pixel-mm-gs.rc", - "init.pixel-perf.rc", - ], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/performance/OWNERS b/performance/OWNERS deleted file mode 100644 index 7ee3645..0000000 --- a/performance/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -wvw@google.com -paillon@google.com -jenhaochen@google.com -liumartin@google.com diff --git a/performance/dump_perf.cpp b/performance/dump_perf.cpp deleted file mode 100644 index d2989ad..0000000 --- a/performance/dump_perf.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 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. - */ - -#include - -int main() { - dumpFileContent("VENDOR PROC DUMP", "/proc/vendor_sched/dump_task"); - dumpFileContent("BTS scenario", "/sys/kernel/debug/bts/scenario"); - dumpFileContent("BTS vc", "/sys/kernel/debug/bts/vc"); - dumpFileContent("BTS status", "/sys/kernel/debug/bts/status"); - return 0; -} diff --git a/performance/experiments/Android.bp b/performance/experiments/Android.bp deleted file mode 100644 index a2f7ebe..0000000 --- a/performance/experiments/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "pixel-experiments-recovery.sh", - src: "pixel-experiments-recovery.sh", - vendor: true, - init_rc: ["pixel-experiments-recovery.rc"], -} diff --git a/performance/experiments/experiments.mk b/performance/experiments/experiments.mk deleted file mode 100644 index b52d0e6..0000000 --- a/performance/experiments/experiments.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/performance/experiments/sepolicy - -PRODUCT_PACKAGES += pixel-experiments-recovery.sh diff --git a/performance/experiments/pixel-experiments-recovery.rc b/performance/experiments/pixel-experiments-recovery.rc deleted file mode 100644 index a8247c3..0000000 --- a/performance/experiments/pixel-experiments-recovery.rc +++ /dev/null @@ -1,17 +0,0 @@ -# pixel-experiments-recovery.sh waits Perf__experiments_delay_seconds and sets -# vendor.perf.allow_experiments=1, triggering experiments. -service pixel-experiments-recovery /vendor/bin/pixel-experiments-recovery.sh \ - ${vendor.pixel.system.phenotype.Perf__experiments_delay_seconds} - class main - user root - group root system - oneshot - disabled - -# vendor.pixel.system.phenotype.Perf__xxx properties are set sometime after the -# device is unlocked for the first time. The check for sys.boot_completed is not -# strictly needed, but will prevent surprises if for some reason the property -# is set early. -on property:sys.boot_completed=1 && \ - property:vendor.pixel.system.phenotype.Perf__experiments_delay_seconds=* - restart pixel-experiments-recovery diff --git a/performance/experiments/pixel-experiments-recovery.sh b/performance/experiments/pixel-experiments-recovery.sh deleted file mode 100755 index 188222e..0000000 --- a/performance/experiments/pixel-experiments-recovery.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/vendor/bin/sh - -# This script delays experiments by the specified amount of seconds. The delay is not needed for -# the normal operation, but becomes essential for the rare case (which "should not happen") where -# an experiment causes really bad issues (e.g. crashes the kernel). In such case the delay gives -# GMSCore an opportunity to fetch fresh experiments snapshot (with the bad experiment disabled). -# -# See go/pixel-perf-experiment-whatif for more info. - -delay_seconds="$1" - -if [ -n "$delay_seconds" ]; then - sleep "$delay_seconds" - /vendor/bin/setprop vendor.perf.allow_experiments 1 -fi diff --git a/performance/experiments/sepolicy/file_contexts b/performance/experiments/sepolicy/file_contexts deleted file mode 100644 index 7364807..0000000 --- a/performance/experiments/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/pixel-experiments-recovery\.sh u:object_r:pixel-experiments-recovery-sh_exec:s0 diff --git a/performance/experiments/sepolicy/pixel-experiments-recovery.sh.te b/performance/experiments/sepolicy/pixel-experiments-recovery.sh.te deleted file mode 100644 index 2da555b..0000000 --- a/performance/experiments/sepolicy/pixel-experiments-recovery.sh.te +++ /dev/null @@ -1,10 +0,0 @@ -# Rules for pixel-experiments-recovery.sh - -type pixel-experiments-recovery-sh, domain; -type pixel-experiments-recovery-sh_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(pixel-experiments-recovery-sh) - -# Allow "setprop vendor.perf.allow_experiments". -allow pixel-experiments-recovery-sh vendor_toolbox_exec:file { execute_no_trans }; -set_prop(pixel-experiments-recovery-sh, vendor_perf_allow_experiments_prop) diff --git a/performance/experiments/sepolicy/property.te b/performance/experiments/sepolicy/property.te deleted file mode 100644 index e43312c..0000000 --- a/performance/experiments/sepolicy/property.te +++ /dev/null @@ -1,3 +0,0 @@ -# Properties shared between experiments. - -vendor_internal_prop(vendor_perf_allow_experiments_prop) diff --git a/performance/experiments/sepolicy/property_contexts b/performance/experiments/sepolicy/property_contexts deleted file mode 100644 index 50de9c1..0000000 --- a/performance/experiments/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.perf.allow_experiments u:object_r:vendor_perf_allow_experiments_prop:s0 diff --git a/performance/init.pixel-mm-gs.rc b/performance/init.pixel-mm-gs.rc deleted file mode 100644 index 9bc12e9..0000000 --- a/performance/init.pixel-mm-gs.rc +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (C) 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. - -on init - # adjust PCP high level - write /proc/sys/vm/percpu_pagelist_high_fraction 430 - - # disable proactive compaction - write /proc/sys/vm/compaction_proactiveness 0 diff --git a/performance/init.pixel-perf.rc b/performance/init.pixel-perf.rc deleted file mode 100644 index 06012ca..0000000 --- a/performance/init.pixel-perf.rc +++ /dev/null @@ -1,330 +0,0 @@ -# Copyright (C) 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. - -on init - chown system system /proc/vendor_sched/groups/bg/set_task_group - chown system system /proc/vendor_sched/groups/cam/set_task_group - chown system system /proc/vendor_sched/groups/fg/set_task_group - chown system system /proc/vendor_sched/groups/nnapi/set_task_group - chown system system /proc/vendor_sched/groups/sys/set_task_group - chown system system /proc/vendor_sched/groups/sys_bg/set_task_group - chown system system /proc/vendor_sched/groups/ta/set_task_group - chown system system /proc/vendor_sched/groups/rt/set_task_group - chown system system /proc/vendor_sched/groups/sf/set_task_group - chown system system /proc/vendor_sched/groups/dex2oat/set_task_group - chown system system /proc/vendor_sched/groups/cam_power/set_task_group - chown system system /proc/vendor_sched/groups/ota/set_task_group - chown system system /proc/vendor_sched/groups/fg_wi/set_task_group - chown system system /proc/vendor_sched/groups/bg/set_proc_group - chown system system /proc/vendor_sched/groups/cam/set_proc_group - chown system system /proc/vendor_sched/groups/fg/set_proc_group - chown system system /proc/vendor_sched/groups/nnapi/set_proc_group - chown system system /proc/vendor_sched/groups/sys/set_proc_group - chown system system /proc/vendor_sched/groups/sys_bg/set_proc_group - chown system system /proc/vendor_sched/groups/ta/set_proc_group - chown system system /proc/vendor_sched/groups/rt/set_proc_group - chown system system /proc/vendor_sched/groups/sf/set_proc_group - chown system system /proc/vendor_sched/groups/dex2oat/set_proc_group - chown system system /proc/vendor_sched/groups/cam_power/set_proc_group - chown system system /proc/vendor_sched/groups/ota/set_proc_group - chown system system /proc/vendor_sched/groups/fg_wi/set_proc_group - chown system system /proc/vendor_sched/prefer_idle_set - chown system system /proc/vendor_sched/prefer_idle_clear - chown system system /proc/vendor_sched/pmu_poll_enable - chown system system /proc/vendor_sched/pmu_poll_time - chown system system /proc/vendor_sched/uclamp_fork_reset_clear - chown system system /proc/vendor_sched/uclamp_fork_reset_set - - chmod 0220 /proc/vendor_sched/groups/bg/set_task_group - chmod 0220 /proc/vendor_sched/groups/cam/set_task_group - chmod 0220 /proc/vendor_sched/groups/fg/set_task_group - chmod 0220 /proc/vendor_sched/groups/nnapi/set_task_group - chmod 0220 /proc/vendor_sched/groups/sys/set_task_group - chmod 0220 /proc/vendor_sched/groups/sys_bg/set_task_group - chmod 0220 /proc/vendor_sched/groups/ta/set_task_group - chmod 0220 /proc/vendor_sched/groups/rt/set_task_group - chmod 0220 /proc/vendor_sched/groups/sf/set_task_group - chmod 0220 /proc/vendor_sched/groups/dex2oat/set_task_group - chmod 0220 /proc/vendor_sched/groups/cam_power/set_task_group - chmod 0220 /proc/vendor_sched/groups/ota/set_task_group - chmod 0220 /proc/vendor_sched/groups/fg_wi/set_task_group - chmod 0220 /proc/vendor_sched/groups/bg/set_proc_group - chmod 0220 /proc/vendor_sched/groups/cam/set_proc_group - chmod 0220 /proc/vendor_sched/groups/fg/set_proc_group - chmod 0220 /proc/vendor_sched/groups/nnapi/set_proc_group - chmod 0220 /proc/vendor_sched/groups/sys/set_proc_group - chmod 0220 /proc/vendor_sched/groups/sys_bg/set_proc_group - chmod 0220 /proc/vendor_sched/groups/ta/set_proc_group - chmod 0220 /proc/vendor_sched/groups/rt/set_proc_group - chmod 0220 /proc/vendor_sched/groups/sf/set_proc_group - chmod 0220 /proc/vendor_sched/groups/dex2oat/set_proc_group - chmod 0220 /proc/vendor_sched/groups/cam_power/set_proc_group - chmod 0220 /proc/vendor_sched/groups/ota/set_proc_group - chmod 0220 /proc/vendor_sched/groups/fg_wi/set_proc_group - chmod 0220 /proc/vendor_sched/prefer_idle_set - chmod 0220 /proc/vendor_sched/prefer_idle_clear - chmod 0660 /proc/vendor_sched/pmu_poll_enable - chmod 0220 /proc/vendor_sched/pmu_poll_time - chmod 0220 /proc/vendor_sched/uclamp_fork_reset_clear - chmod 0220 /proc/vendor_sched/uclamp_fork_reset_set - - # Change permission of sched qos nodes - chown system system /proc/vendor_sched/sched_qos/adpf_set - chown system system /proc/vendor_sched/sched_qos/adpf_clear - chown system system /proc/vendor_sched/sched_qos/auto_uclamp_max_set - chown system system /proc/vendor_sched/sched_qos/auto_uclamp_max_clear - chown system system /proc/vendor_sched/sched_qos/boost_prio_set - chown system system /proc/vendor_sched/sched_qos/boost_prio_clear - chown system system /proc/vendor_sched/sched_qos/preempt_wakeup_set - chown system system /proc/vendor_sched/sched_qos/preempt_wakeup_clear - chown system system /proc/vendor_sched/sched_qos/prefer_fit_set - chown system system /proc/vendor_sched/sched_qos/prefer_fit_clear - chown system system /proc/vendor_sched/sched_qos/prefer_high_cap_set - chown system system /proc/vendor_sched/sched_qos/prefer_high_cap_clear - chown system system /proc/vendor_sched/sched_qos/prefer_idle_set - chown system system /proc/vendor_sched/sched_qos/prefer_idle_clear - chown system system /proc/vendor_sched/sched_qos/rampup_multiplier_set - chown system system /proc/vendor_sched/sched_qos/rampup_multiplier_clear - chown system system /proc/vendor_sched/sched_qos/sched_qos_none - chown system system /proc/vendor_sched/sched_qos/sched_qos_power_efficiency - chown system system /proc/vendor_sched/sched_qos/sched_qos_sensitive_extreme - chown system system /proc/vendor_sched/sched_qos/sched_qos_sensitive_high - chown system system /proc/vendor_sched/sched_qos/sched_qos_sensitive_standard - - chmod 0220 /proc/vendor_sched/sched_qos/adpf_set - chmod 0220 /proc/vendor_sched/sched_qos/adpf_clear - chmod 0220 /proc/vendor_sched/sched_qos/auto_uclamp_max_set - chmod 0220 /proc/vendor_sched/sched_qos/auto_uclamp_max_clear - chmod 0220 /proc/vendor_sched/sched_qos/boost_prio_set - chmod 0220 /proc/vendor_sched/sched_qos/boost_prio_clear - chmod 0220 /proc/vendor_sched/sched_qos/preempt_wakeup_set - chmod 0220 /proc/vendor_sched/sched_qos/preempt_wakeup_clear - chmod 0220 /proc/vendor_sched/sched_qos/prefer_fit_set - chmod 0220 /proc/vendor_sched/sched_qos/prefer_fit_clear - chmod 0220 /proc/vendor_sched/sched_qos/prefer_high_cap_set - chmod 0220 /proc/vendor_sched/sched_qos/prefer_high_cap_clear - chmod 0220 /proc/vendor_sched/sched_qos/prefer_idle_set - chmod 0220 /proc/vendor_sched/sched_qos/prefer_idle_clear - chmod 0220 /proc/vendor_sched/sched_qos/rampup_multiplier_set - chmod 0220 /proc/vendor_sched/sched_qos/rampup_multiplier_clear - chmod 0220 /proc/vendor_sched/sched_qos/sched_qos_none - chmod 0220 /proc/vendor_sched/sched_qos/sched_qos_power_efficiency - chmod 0220 /proc/vendor_sched/sched_qos/sched_qos_sensitive_extreme - chmod 0220 /proc/vendor_sched/sched_qos/sched_qos_sensitive_high - chmod 0220 /proc/vendor_sched/sched_qos/sched_qos_sensitive_standard - - # Enable sched_qos for some groups - write /proc/vendor_sched/groups/ta/qos_adpf_enable 1 - write /proc/vendor_sched/groups/ta/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/ta/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/ta/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/ta/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/ta/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/ta/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/ta/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/fg/qos_adpf_enable 1 - write /proc/vendor_sched/groups/fg/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/fg/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/fg/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/fg/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/fg/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/fg/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/fg/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_adpf_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/fg_wi/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/cam/qos_adpf_enable 1 - write /proc/vendor_sched/groups/cam/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/cam/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/cam/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/cam/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/cam/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/cam/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/cam/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_adpf_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/cam_power/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/rt/qos_adpf_enable 1 - write /proc/vendor_sched/groups/rt/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/rt/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/rt/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/rt/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/rt/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/rt/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/rt/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/sf/qos_adpf_enable 1 - write /proc/vendor_sched/groups/sf/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/sf/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/sf/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/sf/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/sf/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/sf/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/sf/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/sys/qos_adpf_enable 1 - write /proc/vendor_sched/groups/sys/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/sys/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/sys/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/sys/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/sys/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/sys/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/sys/qos_rampup_multiplier_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_adpf_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_auto_uclamp_max_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_boost_prio_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_preempt_wakeup_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_prefer_fit_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_prefer_high_cap_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_prefer_idle_enable 1 - write /proc/vendor_sched/groups/nnapi/qos_rampup_multiplier_enable 1 - - # cpufreq governor setting - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor sched_pixel - write /sys/devices/system/cpu/cpu8/cpufreq/scaling_governor sched_pixel - - write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu1/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu2/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu3/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu5/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu7/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu8/cpufreq/sched_pixel/up_rate_limit_us 500 - - write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu1/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu2/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu3/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu5/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu7/cpufreq/sched_pixel/down_rate_limit_us 500 - write /sys/devices/system/cpu/cpu8/cpufreq/sched_pixel/down_rate_limit_us 500 - - # Default rampup multiplier setup - write /proc/vendor_sched/groups/bg/rampup_multiplier 0 - write /proc/vendor_sched/groups/cam/rampup_multiplier 1 - write /proc/vendor_sched/groups/cam_power/rampup_multiplier 1 - write /proc/vendor_sched/groups/dex2oat/rampup_multiplier 0 - write /proc/vendor_sched/groups/fg/rampup_multiplier 0 - write /proc/vendor_sched/groups/fg_wi/rampup_multiplier 1 - write /proc/vendor_sched/groups/nnapi/rampup_multiplier 0 - write /proc/vendor_sched/groups/ota/rampup_multiplier 0 - write /proc/vendor_sched/groups/rt/rampup_multiplier 0 - write /proc/vendor_sched/groups/sf/rampup_multiplier 1 - write /proc/vendor_sched/groups/sys/rampup_multiplier 0 - write /proc/vendor_sched/groups/sys_bg/rampup_multiplier 0 - write /proc/vendor_sched/groups/ta/rampup_multiplier 1 - write /proc/vendor_sched/adpf_rampup_multiplier 4 - - # Default util_est setup - write /proc/vendor_sched/groups/bg/disable_util_est 1 - write /proc/vendor_sched/groups/cam/disable_util_est 0 - write /proc/vendor_sched/groups/cam_power/disable_util_est 0 - write /proc/vendor_sched/groups/dex2oat/disable_util_est 1 - write /proc/vendor_sched/groups/fg/disable_util_est 1 - write /proc/vendor_sched/groups/fg_wi/disable_util_est 0 - write /proc/vendor_sched/groups/nnapi/disable_util_est 1 - write /proc/vendor_sched/groups/ota/disable_util_est 1 - write /proc/vendor_sched/groups/rt/disable_util_est 1 - write /proc/vendor_sched/groups/sf/disable_util_est 0 - write /proc/vendor_sched/groups/sys/disable_util_est 1 - write /proc/vendor_sched/groups/sys_bg/disable_util_est 1 - write /proc/vendor_sched/groups/ta/disable_util_est 0 - - # Default sched_batch setup - write /proc/vendor_sched/groups/bg/use_batch_policy 1 - write /proc/vendor_sched/groups/cam/use_batch_policy 0 - write /proc/vendor_sched/groups/cam_power/use_batch_policy 0 - write /proc/vendor_sched/groups/dex2oat/use_batch_policy 0 - write /proc/vendor_sched/groups/fg/use_batch_policy 0 - write /proc/vendor_sched/groups/fg_wi/use_batch_policy 0 - write /proc/vendor_sched/groups/nnapi/use_batch_policy 0 - write /proc/vendor_sched/groups/ota/use_batch_policy 0 - write /proc/vendor_sched/groups/rt/use_batch_policy 0 - write /proc/vendor_sched/groups/sf/use_batch_policy 0 - write /proc/vendor_sched/groups/sys/use_batch_policy 0 - write /proc/vendor_sched/groups/sys_bg/use_batch_policy 1 - write /proc/vendor_sched/groups/ta/use_batch_policy 0 - - # RT uclamp setting - write /proc/sys/kernel/sched_util_clamp_min_rt_default 0 - - write /proc/vendor_sched/groups/cam/prefer_idle 1 - write /proc/vendor_sched/groups/cam/uclamp_min 1 - - chown system system /dev/cpuset/cgroup.procs - - # Add a boost for NNAPI HAL - write /proc/vendor_sched/groups/nnapi/prefer_idle 0 - write /proc/vendor_sched/groups/nnapi/uclamp_min 512 - -on property:sys.boot_completed=1 - - # Setup scheduler parameters - write /proc/vendor_sched/min_granularity_ns 1000000 - write /proc/vendor_sched/latency_ns 8000000 - write /proc/vendor_sched/max_load_balance_interval 1 - write /proc/vendor_sched/enable_hrtick 1 - - # Setup final cpu.uclamp - write /proc/vendor_sched/groups/ta/uclamp_min 1 - write /proc/vendor_sched/groups/fg/uclamp_min 0 - write /proc/vendor_sched/groups/sys/prefer_idle 0 - - # Set ug group - write /proc/vendor_sched/groups/bg/ug 0 - write /proc/vendor_sched/groups/sys_bg/ug 0 - write /proc/vendor_sched/groups/ota/ug 0 - write /proc/vendor_sched/groups/dex2oat/ug 1 - write /proc/vendor_sched/groups/ta/ug 1 - - # Set bg group throttle - write /proc/vendor_sched/ug_bg_group_throttle ${persist.device_config.vendor_system_native.ug_bg_group_throttle:-308} - - # Disable PMU freq limit - write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy1/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy2/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy3/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy5/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy7/sched_pixel/pmu_limit_enable 1 - write /sys/devices/system/cpu/cpufreq/policy8/sched_pixel/pmu_limit_enable 1 - write /proc/vendor_sched/pmu_poll_enable 0 - - # Set priority task name and boost value - write /proc/vendor_sched/priority_task_name "ExoPlayer:Place" - write /proc/vendor_sched/priority_task_boost_value 742 - - write /proc/vendor_sched/boost_at_fork_task_name "_zygote" - write /proc/vendor_sched/boost_at_fork_value 768 diff --git a/performance/perf.mk b/performance/perf.mk deleted file mode 100644 index ad4011a..0000000 --- a/performance/perf.mk +++ /dev/null @@ -1,7 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/performance/sepolicy - -PRODUCT_PACKAGES += dump_perf - -# Ensure enough free space to create zram backing device -PRODUCT_PRODUCT_PROPERTIES += \ - ro.zram_backing_device_min_free_mb=1536 diff --git a/performance/sepolicy/dump_perf.te b/performance/sepolicy/dump_perf.te deleted file mode 100644 index befe9ba..0000000 --- a/performance/sepolicy/dump_perf.te +++ /dev/null @@ -1,7 +0,0 @@ -pixel_bugreport(dump_perf) - -allow dump_perf proc_vendor_sched:file r_file_perms; -userdebug_or_eng(` - allow dump_perf vendor_bts_debugfs:dir r_dir_perms; - allow dump_perf vendor_bts_debugfs:file r_file_perms; -') diff --git a/performance/sepolicy/file.te b/performance/sepolicy/file.te deleted file mode 100644 index e79f9b2..0000000 --- a/performance/sepolicy/file.te +++ /dev/null @@ -1,8 +0,0 @@ -# proactive kill -type sysfs_pakills, fs_type, sysfs_type; - -# bts dump -type vendor_bts_debugfs, fs_type, debugfs_type; - -# proc_compaction_proactiveness type -type proc_compaction_proactiveness, fs_type, proc_type; diff --git a/performance/sepolicy/file_contexts b/performance/sepolicy/file_contexts deleted file mode 100644 index 171529e..0000000 --- a/performance/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_perf u:object_r:dump_perf_exec:s0 - diff --git a/performance/sepolicy/genfs_contexts b/performance/sepolicy/genfs_contexts deleted file mode 100644 index 57e3634..0000000 --- a/performance/sepolicy/genfs_contexts +++ /dev/null @@ -1,4 +0,0 @@ -genfscon proc /sys/kernel/sched_pelt_multiplier u:object_r:proc_sched:s0 -genfscon sysfs /kernel/vendor_mm/pa_kill u:object_r:sysfs_pakills:s0 -genfscon debugfs /bts u:object_r:vendor_bts_debugfs:s0 -genfscon proc /sys/vm/compaction_proactiveness u:object_r:proc_compaction_proactiveness:s0 diff --git a/performance/sepolicy/hal_power_default.te b/performance/sepolicy/hal_power_default.te deleted file mode 100644 index 036e37e..0000000 --- a/performance/sepolicy/hal_power_default.te +++ /dev/null @@ -1,12 +0,0 @@ -hal_client_domain(hal_power_default, hal_thermal) - -# allow power hal to access pa kill knobs -allow hal_power_default sysfs_pakills:file rw_file_perms; -allow hal_power_default sysfs_pakills:dir r_dir_perms; -r_dir_file(hal_power_default, sysfs_vendor_mm); - -# allow power hal to access vendor_mm knobs -allow hal_power_default sysfs_vendor_mm:file rw_file_perms; - -# Allow set display early wake up -allow hal_power_default sysfs_display:file rw_file_perms; diff --git a/performance/sepolicy/init.te b/performance/sepolicy/init.te deleted file mode 100644 index 5d1d13f..0000000 --- a/performance/sepolicy/init.te +++ /dev/null @@ -1,2 +0,0 @@ -# zram -allow init ram_device:blk_file w_file_perms; diff --git a/performance/sepolicy/proc_vendor_sched.te b/performance/sepolicy/proc_vendor_sched.te deleted file mode 100644 index dc78c75..0000000 --- a/performance/sepolicy/proc_vendor_sched.te +++ /dev/null @@ -1,2 +0,0 @@ -#Vendor Sched -allow proc_vendor_sched proc:filesystem associate; diff --git a/performance/sepolicy/vendor_init.te b/performance/sepolicy/vendor_init.te deleted file mode 100644 index 188984f..0000000 --- a/performance/sepolicy/vendor_init.te +++ /dev/null @@ -1,3 +0,0 @@ -# MM -allow vendor_init proc_percpu_pagelist_high_fraction:file w_file_perms; -allow vendor_init proc_compaction_proactiveness:file w_file_perms; diff --git a/pixel_metrics/Android.bp b/pixel_metrics/Android.bp deleted file mode 100644 index 04d83f3..0000000 --- a/pixel_metrics/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_pixel_metrics", - srcs: ["dump_pixel_metrics.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/pixel_metrics/dump_pixel_metrics.cpp b/pixel_metrics/dump_pixel_metrics.cpp deleted file mode 100644 index 597d765..0000000 --- a/pixel_metrics/dump_pixel_metrics.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - - -int main() { - setbuf(stdout, NULL); - dumpFileContent("Long running IRQ metrics", "/sys/kernel/metrics/irq/long_irq_metrics"); - dumpFileContent("Storm IRQ metrics", "/sys/kernel/metrics/irq/storm_irq_metrics"); - dumpFileContent("Long RT Runnable metrics", "/sys/kernel/metrics/runnable/stats"); - dumpFileContent("Resume latency metrics", "/sys/kernel/metrics/resume_latency/resume_latency_metrics"); - return 0; -} - diff --git a/pixel_metrics/pixel_metrics.mk b/pixel_metrics/pixel_metrics.mk deleted file mode 100644 index 736ddf3..0000000 --- a/pixel_metrics/pixel_metrics.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pixel_metrics/sepolicy - -PRODUCT_PACKAGES += dump_pixel_metrics diff --git a/pixel_metrics/sepolicy/dump_pixel_metrics.te b/pixel_metrics/sepolicy/dump_pixel_metrics.te deleted file mode 100644 index 903a8e3..0000000 --- a/pixel_metrics/sepolicy/dump_pixel_metrics.te +++ /dev/null @@ -1,5 +0,0 @@ -pixel_bugreport(dump_pixel_metrics) - -#vendor-metrics -r_dir_file(dump_pixel_metrics, sysfs_vendor_metrics) -allow dump_pixel_metrics vendor_dumpsys:file execute_no_trans; diff --git a/pixel_metrics/sepolicy/file.te b/pixel_metrics/sepolicy/file.te deleted file mode 100644 index 63640e3..0000000 --- a/pixel_metrics/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -#vendor-metrics -type sysfs_vendor_metrics, fs_type, sysfs_type; diff --git a/pixel_metrics/sepolicy/file_contexts b/pixel_metrics/sepolicy/file_contexts deleted file mode 100644 index 966055f..0000000 --- a/pixel_metrics/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_pixel_metrics u:object_r:dump_pixel_metrics_exec:s0 diff --git a/pixel_metrics/sepolicy/genfs_contexts b/pixel_metrics/sepolicy/genfs_contexts deleted file mode 100644 index c58fbe7..0000000 --- a/pixel_metrics/sepolicy/genfs_contexts +++ /dev/null @@ -1,9 +0,0 @@ -#vendor-metrics -genfscon sysfs /kernel/metrics/resume_latency/resume_latency_metrics u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/irq/long_irq_metrics u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/irq/stats_reset u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/irq/storm_irq_metrics u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/runnable/stats_reset u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/runnable/stats u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/thermal/tr_by_group/tmu/stats u:object_r:sysfs_vendor_metrics:s0 -genfscon sysfs /kernel/metrics/thermal/tr_by_group/spmic/stats u:object_r:sysfs_vendor_metrics:s0 diff --git a/pixel_ril/compatibility_matrix.xml b/pixel_ril/compatibility_matrix.xml deleted file mode 100644 index 73d208d..0000000 --- a/pixel_ril/compatibility_matrix.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - hardware.google.ril_ext - 1 - - IRilExt - slot1 - slot2 - - - diff --git a/pixel_ril/manifest_ril.xml b/pixel_ril/manifest_ril.xml deleted file mode 100644 index a292d3f..0000000 --- a/pixel_ril/manifest_ril.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - hardware.google.ril_ext - IRilExt/slot1 - - diff --git a/pixel_ril/manifest_ril_ds.xml b/pixel_ril/manifest_ril_ds.xml deleted file mode 100644 index ade8b26..0000000 --- a/pixel_ril/manifest_ril_ds.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - hardware.google.ril_ext - IRilExt/slot1 - IRilExt/slot2 - - diff --git a/pixel_ril/ril.mk b/pixel_ril/ril.mk deleted file mode 100644 index f90e926..0000000 --- a/pixel_ril/ril.mk +++ /dev/null @@ -1,12 +0,0 @@ -BOARD_SEPOLICY_DIRS += device/google/gs-common/pixel_ril/sepolicy - -ifeq ($(SIM_COUNT), 2) - DEVICE_MANIFEST_FILE += device/google/gs-common/pixel_ril/manifest_ril_ds.xml -else - DEVICE_MANIFEST_FILE += device/google/gs-common/pixel_ril/manifest_ril.xml -endif -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/pixel_ril/compatibility_matrix.xml - -PRODUCT_PACKAGES += ril-extension - -USE_GOOGLE_RIL_EXT := true diff --git a/pixel_ril/sepolicy/rild.te b/pixel_ril/sepolicy/rild.te deleted file mode 100644 index 55bffee..0000000 --- a/pixel_ril/sepolicy/rild.te +++ /dev/null @@ -1,7 +0,0 @@ -add_service(rild, hal_ril_ext_service) -binder_call(rild, rilextensionservice_app) - -# Allow rild to ptrace for memory leak detection -userdebug_or_eng(` -allow rild self:process ptrace; -') diff --git a/pixel_ril/sepolicy/rilextensionservice_app.te b/pixel_ril/sepolicy/rilextensionservice_app.te deleted file mode 100644 index d315367..0000000 --- a/pixel_ril/sepolicy/rilextensionservice_app.te +++ /dev/null @@ -1,11 +0,0 @@ -type rilextensionservice_app, domain; -app_domain(rilextensionservice_app) - -allow rilextensionservice_app app_api_service:service_manager find; -allow rilextensionservice_app hal_ril_ext_service:service_manager find; -allow rilextensionservice_app radio_service:service_manager find; - -binder_call(rilextensionservice_app, rild) - -set_prop(rilextensionservice_app, vendor_rild_prop) -set_prop(rilextensionservice_app, radio_prop) diff --git a/pixel_ril/sepolicy/seapp_contexts b/pixel_ril/sepolicy/seapp_contexts deleted file mode 100644 index 295f5c9..0000000 --- a/pixel_ril/sepolicy/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# RIL extension service -user=_app isPrivApp=true name=com.google.android.rilextension domain=rilextensionservice_app levelFrom=all diff --git a/pixel_ril/sepolicy/service.te b/pixel_ril/sepolicy/service.te deleted file mode 100644 index 1908206..0000000 --- a/pixel_ril/sepolicy/service.te +++ /dev/null @@ -1 +0,0 @@ -type hal_ril_ext_service, hal_service_type, service_manager_type; diff --git a/pixel_ril/sepolicy/service_contexts b/pixel_ril/sepolicy/service_contexts deleted file mode 100644 index be5a8d2..0000000 --- a/pixel_ril/sepolicy/service_contexts +++ /dev/null @@ -1,3 +0,0 @@ -hardware.google.ril_ext.IRilExt/slot1 u:object_r:hal_ril_ext_service:s0 -hardware.google.ril_ext.IRilExt/slot2 u:object_r:hal_ril_ext_service:s0 -hardware.google.ril_ext.IRilExt/slot3 u:object_r:hal_ril_ext_service:s0 diff --git a/pixelstats/pixelstats.mk b/pixelstats/pixelstats.mk deleted file mode 100644 index d0c9603..0000000 --- a/pixelstats/pixelstats.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Reliability reporting -PRODUCT_PACKAGES += pixelstats-vendor - -BOARD_SEPOLICY_DIRS += device/google/gs-common/pixelstats/sepolicy diff --git a/pixelsupport/pixelsupport.mk b/pixelsupport/pixelsupport.mk deleted file mode 100644 index 068c94f..0000000 --- a/pixelsupport/pixelsupport.mk +++ /dev/null @@ -1,5 +0,0 @@ -PRODUCT_PACKAGES += PixelSupportPrebuilt - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pixelsupport/sepolicy/vendor -PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/pixelsupport/sepolicy/product/public -PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/pixelsupport/sepolicy/product/private diff --git a/pixelsupport/sepolicy/product/private/certs/pixelsupport.x509.pem b/pixelsupport/sepolicy/product/private/certs/pixelsupport.x509.pem deleted file mode 100644 index 40c874d..0000000 --- a/pixelsupport/sepolicy/product/private/certs/pixelsupport.x509.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGBzCCA++gAwIBAgIVAJriiL3+mR75mIC8e0Xqoz59LduNMA0GCSqGSIb3DQEBCwUAMIGSMQsw -CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEU -MBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxLjAsBgNVBAMMJWNvbV9nb29n -bGVfYW5kcm9pZF9hcHBzX3BpeGVsX3N1cHBvcnQwIBcNMjIxMjEyMTM1MDA3WhgPMjA1MjEyMTIx -MzUwMDdaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91 -bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxLjAsBgNV -BAMMJWNvbV9nb29nbGVfYW5kcm9pZF9hcHBzX3BpeGVsX3N1cHBvcnQwggIiMA0GCSqGSIb3DQEB -AQUAA4ICDwAwggIKAoICAQCSWvRumhZOIAZmWKcuVjc1l3OIIWc/nSRVnsfdzeRqK0jwVFcTqMDs -kmZtEj/UTW+N91ExRzWvAQ027AcE7TGF3X2iKKAfpSB0fpVQato5RIzOrRbwgAzsIvBdVtExqSNk -5vh8xJ0azHt6Jn77gW03Mq7AL55Si5q3vU1meeGBPD/YWeqd/oNhPfe0kAHdNnnTOnN6SBxSeO8r -YukV4XYJ3BxgWD1sm2NI8kZ+OGAooBFflZYXoY6NVfLXm6jsqWnooAok7CrNxZc/wstiwd8yYX6f -6R1Trox3a9xOy7E+6Rig0XhbWm4pbp3Zu0OLArUalbQ1cjd1qFy6q9maieBn14ad+UtLNOUjCx91 -hLWg/mdpYCvArQb3bBDJdjYfdoo7Q8F9QW3JrFrbIeBezM4TTdK9v/sM4+1OxEo6vwMKQM9Ata/H -Mn89a4nFHgRqGIMKK8zh0Eob+OwiBakviVhAI1o7IONujcJ2hfuyHNPZb8sT0Rewxtw2fD/Jwj+l -ADmlXWw553geFcwP1SqOC6j/XOeazSvV4ccCME2VZqIE4pmL+RUr+cgAyQHXPZnet74C7K9sNRV6 -JluS6inqP4lKp7gSFuVrQNYHawNPVinbeTLYEu+df3m3yrHAUpaSvsSUC6qQVWCs0sI8PC6A1+bV -DXMsIYRvrSnmtN75vOECaQIDAQABo1AwTjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBTODyZ1S/is -Y/2ZuMl8B1M6kFiJwDAfBgNVHSMEGDAWgBTODyZ1S/isY/2ZuMl8B1M6kFiJwDANBgkqhkiG9w0B -AQsFAAOCAgEAL26IGjeu8Q5tn/b4vfYa+7bRUwozAJA9Buyduw/4wVG6rIAkpEsghkgnoOvyjD72 -ncbCkDoBV3a1PLw2W/bMQWfZvYScOzc2yFwcR9LdQIiEYmtgnwuJHnqc2MDsh+MDeclblyBYfIQQ -bpZ0JArKalSmDyul0QIcfHq+RKmGAzC3bx0xigclIZJxXEG4tyQylttnqNodAEqYdhMMRajI3w9t -61QwqNv1KTGJt1sC2Q7NyzbZJo02Kwu711Dw6KnVgHaGKC2sRIixsvjm2s6f9/CcVasuLopkJnyl -epPeD2jHwHdE4/c2K5ZVQeZ+R0pIOEBKwg1AVkn+/UTbhpjYCkEGP09e8T45Y+//eMlrbORJAbji -H5cfD9aSO2z4slN4B4w+Fw9Kn+a7bsN2xhv7lvAgQ92aq9g/YS1YysZ7kSoCpmKl7rN+0V/RGRVP -ab2Cb0C3+JewTnOAF30e7zVs9Vaq3oTAV4XFYNiDRUBU/rvv8EIZKcBdufFJmCGYUpmm1EQQdsTt -mFMPEh5I4Qd0sy+HKvLjThcMGHqDX0bCeXkbFZdj0GXPOOt5LX8NZBdnsbVgENrZml318uLEj3ZU -DlojsfsTlVcs5eIPX6Dkx0OdgVcMAXnLF+vjP/ygWuLqiPFPCrZD1b+2g2P9Yip3e221tuyca42b -q3bvQEBwOsA= ------END CERTIFICATE----- diff --git a/pixelsupport/sepolicy/product/private/keys.conf b/pixelsupport/sepolicy/product/private/keys.conf deleted file mode 100644 index eff6067..0000000 --- a/pixelsupport/sepolicy/product/private/keys.conf +++ /dev/null @@ -1,2 +0,0 @@ -[@PIXELSUPPORT] -ALL : device/google/gs-common/pixelsupport/sepolicy/product/private/certs/pixelsupport.x509.pem diff --git a/pixelsupport/sepolicy/product/private/mac_permissions.xml b/pixelsupport/sepolicy/product/private/mac_permissions.xml deleted file mode 100644 index cb8d42a..0000000 --- a/pixelsupport/sepolicy/product/private/mac_permissions.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - diff --git a/pixelsupport/sepolicy/product/private/pixelsupport_app.te b/pixelsupport/sepolicy/product/private/pixelsupport_app.te deleted file mode 100644 index be6f7dd..0000000 --- a/pixelsupport/sepolicy/product/private/pixelsupport_app.te +++ /dev/null @@ -1,11 +0,0 @@ -typeattribute pixelsupport_app coredomain; - -app_domain(pixelsupport_app) -# Access the network. -net_domain(pixelsupport_app) -# Access bluetooth. -bluetooth_domain(pixelsupport_app) - -allow pixelsupport_app app_api_service:service_manager find; -allow pixelsupport_app radio_service:service_manager find; - diff --git a/pixelsupport/sepolicy/product/private/seapp_contexts b/pixelsupport/sepolicy/product/private/seapp_contexts deleted file mode 100644 index f16a054..0000000 --- a/pixelsupport/sepolicy/product/private/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Pixel Support App -user=_app seinfo=PixelSupport name=com.google.android.apps.pixel.support domain=pixelsupport_app type=app_data_file isPrivApp=true levelFrom=user diff --git a/pixelsupport/sepolicy/product/public/pixelsupport_app.te b/pixelsupport/sepolicy/product/public/pixelsupport_app.te deleted file mode 100644 index 1846ac9..0000000 --- a/pixelsupport/sepolicy/product/public/pixelsupport_app.te +++ /dev/null @@ -1,2 +0,0 @@ -type pixelsupport_app, domain; - diff --git a/pixelsupport/sepolicy/vendor/pixelsupport_app.te b/pixelsupport/sepolicy/vendor/pixelsupport_app.te deleted file mode 100644 index e3b380c..0000000 --- a/pixelsupport/sepolicy/vendor/pixelsupport_app.te +++ /dev/null @@ -1,2 +0,0 @@ -set_prop(pixelsupport_app, vendor_gti_prop) - diff --git a/power/Android.bp b/power/Android.bp deleted file mode 100644 index b70372c..0000000 --- a/power/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -prebuilt_etc { - name: "init.power-gs.rc", - src: "init.power-gs.rc", - vendor: true, - sub_dir: "init", -} diff --git a/power/OWNERS b/power/OWNERS deleted file mode 100644 index 09c47ea..0000000 --- a/power/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -joaodias@google.com -frankvarela@google.com -krossmo@google.com -cozette@google.com -dennisyee@google.com diff --git a/power/init.power-gs.rc b/power/init.power-gs.rc deleted file mode 100644 index 03748a2..0000000 --- a/power/init.power-gs.rc +++ /dev/null @@ -1,3 +0,0 @@ -on property:sys.boot_completed=1 - # Reduce pm_freeze_timeout value - write /sys/power/pm_freeze_timeout 1000 diff --git a/power/power.mk b/power/power.mk deleted file mode 100644 index 336cd96..0000000 --- a/power/power.mk +++ /dev/null @@ -1 +0,0 @@ -PRODUCT_PACKAGES += init.power-gs.rc diff --git a/powerstats/AdaptiveDvfsStateResidencyDataProvider.cpp b/powerstats/AdaptiveDvfsStateResidencyDataProvider.cpp deleted file mode 100644 index c842d3e..0000000 --- a/powerstats/AdaptiveDvfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 "AdaptiveDvfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::Split; -using android::base::Trim; - -static const std::string pathSuffix = "/time_in_state"; -static const std::string stateSuffix = "MHz"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -AdaptiveDvfsStateResidencyDataProvider::AdaptiveDvfsStateResidencyDataProvider( - std::string path, - uint64_t clockRate, - std::vector> powerEntities) - : DvfsStateResidencyDataProvider(path, clockRate, {}) { - size_t len = 0; - char *line = nullptr; - std::vector> states = {}; - std::vector parts; - - for (int32_t i = 0; i < powerEntities.size(); i++) { - std::string freqPath = powerEntities[i].second + pathSuffix; - std::unique_ptr fp(fopen(freqPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << freqPath; - continue; - } - - while (getline(&line, &len, fp.get()) != -1) { - parts = Split(Trim(std::string(line)), " "); - if (parts.size() > 0) { - std::string freqStr = Trim(parts[0]); - states.push_back(std::make_pair( - freqStr.substr(0, freqStr.length() - 3) + stateSuffix, - freqStr)); - } - } - - // 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)}); - } - - free(line); -} - -bool AdaptiveDvfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - return DvfsStateResidencyDataProvider::getStateResidencies(residencies); -} - -std::unordered_map> - AdaptiveDvfsStateResidencyDataProvider::getInfo() { - return DvfsStateResidencyDataProvider::getInfo(); -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/Android.bp b/powerstats/Android.bp deleted file mode 100644 index 74935c7..0000000 --- a/powerstats/Android.bp +++ /dev/null @@ -1,24 +0,0 @@ -soong_namespace { - imports: [ - "hardware/google/pixel", - ], -} - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_library { - name: "android.hardware.power.stats-impl.gs-common", - vendor_available: true, - export_include_dirs: ["include"], - defaults: ["powerstats_pixel_defaults"], - - srcs: [ - "*.cpp", - ], - - shared_libs: [ - "android.hardware.power.stats-impl.pixel", - ], -} diff --git a/powerstats/AocStateResidencyDataProvider.cpp b/powerstats/AocStateResidencyDataProvider.cpp deleted file mode 100644 index 38cd85f..0000000 --- a/powerstats/AocStateResidencyDataProvider.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2020 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 "AocStateResidencyDataProvider.h" - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -AocStateResidencyDataProvider::AocStateResidencyDataProvider( - std::vector> ids, - std::vector> states, - const uint64_t aocClock) { - // AoC stats are reported in ticks. - static const uint64_t AOC_CLK = aocClock; - std::function aocTickToMs = [](uint64_t a) { return a / AOC_CLK; }; - GenericStateResidencyDataProvider::StateResidencyConfig config = { - .entryCountSupported = true, - .entryCountPrefix = "Counter:", - .totalTimeSupported = true, - .totalTimePrefix = "Cumulative time:", - .totalTimeTransform = aocTickToMs, - .lastEntrySupported = true, - .lastEntryPrefix = "Time last entered:", - .lastEntryTransform = aocTickToMs, - }; - for (const auto &id : ids) { - for (const auto &state : states) { - std::vector> aocStateHeaders = { - std::make_pair(state.first, ""), - }; - std::vector cfgs; - cfgs.emplace_back(generateGenericStateResidencyConfigs(config, aocStateHeaders), - id.first, ""); - std::unique_ptr sdp( - new GenericStateResidencyDataProvider(id.second + state.second, cfgs)); - mProviders[id.first].push_back(std::move(sdp)); - } - } -} - -bool AocStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - // States from the same power entity are merged. - bool ret = true; - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateResidencies; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> residency; - ret &= provider->getStateResidencies(&residency); - - // Each provider should only return data for curEntity but checking anyway - if (residency.find(curEntity) != residency.end()) { - for (auto &r : residency.at(curEntity)) { - /* - * Modifying stateId here because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - r.id = stateId++; - stateResidencies.push_back(r); - } - } - } - - residencies->emplace(curEntity, stateResidencies); - } - return ret; -} - -std::unordered_map> AocStateResidencyDataProvider::getInfo() { - // States from the same power entity are merged - std::unordered_map> infos; - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateInfos; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> info = provider->getInfo(); - - // Each provider should only return data for curEntity but checking anyway - if (info.find(curEntity) != info.end()) { - for (auto &i : info.at(curEntity)) { - /* - * Modifying stateId because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - i.id = stateId++; - stateInfos.push_back(i); - } - } - } - - infos.emplace(curEntity, stateInfos); - } - - return infos; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/AocTimedStateResidencyDataProvider.cpp b/powerstats/AocTimedStateResidencyDataProvider.cpp deleted file mode 100644 index ead2a42..0000000 --- a/powerstats/AocTimedStateResidencyDataProvider.cpp +++ /dev/null @@ -1,121 +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. - */ - -#include "AocTimedStateResidencyDataProvider.h" - -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -AocTimedStateResidencyDataProvider::AocTimedStateResidencyDataProvider( - std::vector> ids, - std::vector> states, - const uint64_t timeoutMillis, - const uint64_t aocClock) - : AocStateResidencyDataProvider(ids, states, aocClock) { - static const uint64_t DEFAULT_MAX_TIME_PER_STATE_MILLIS = 120; - - mTimeoutMillis = - timeoutMillis == 0 ? DEFAULT_MAX_TIME_PER_STATE_MILLIS * states.size() : timeoutMillis; - - mAsyncThread = std::thread(&AocTimedStateResidencyDataProvider::getStateResidenciesAsync, this); -} - -bool AocTimedStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - bool ret = true; - std::unique_lock statusLock(mStatusMutex); - - if (mAsyncStatus != COMPLETED) { - LOG(ERROR) << "The async thread is not ready: " << mAsyncStatus; - return false; - } - - mStateResidencies.clear(); - - mAsyncStatus = RUN; - mRunCond.notify_one(); - - auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(mTimeoutMillis); - auto isCompleted = - mCompletedCond.wait_until(statusLock, timeout, [this]{ return mAsyncStatus == COMPLETED; }); - - if (isCompleted) { - for (const auto &residency : mStateResidencies) { - residencies->emplace(residency.first, residency.second); - } - } else { - LOG(ERROR) << __func__ << " for AoC timed out: " << mTimeoutMillis << " ms"; - ret = false; - } - - return ret; -} - -void AocTimedStateResidencyDataProvider::getStateResidenciesAsync() { - std::unique_lock statusLock(mStatusMutex); - - mAsyncStatus = COMPLETED; - - while (1) { - mRunCond.wait(statusLock, [this]{ return mAsyncStatus == RUN; }); - - mAsyncStatus = RUNNING; - statusLock.unlock(); - - // States from the same power entity are merged. - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateResidencies; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> residency; - provider->getStateResidencies(&residency); - - // Each provider should only return data for curEntity but checking anyway - if (residency.find(curEntity) != residency.end()) { - for (auto &r : residency.at(curEntity)) { - /* - * Modifying stateId here because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - r.id = stateId++; - stateResidencies.push_back(r); - } - } - } - mStateResidencies.emplace(curEntity, stateResidencies); - } - - statusLock.lock(); - mAsyncStatus = COMPLETED; - mCompletedCond.notify_one(); - } // while loop -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/CpupmStateResidencyDataProvider.cpp b/powerstats/CpupmStateResidencyDataProvider.cpp deleted file mode 100644 index 2adae54..0000000 --- a/powerstats/CpupmStateResidencyDataProvider.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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 "CpupmStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseUint; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -CpupmStateResidencyDataProvider::CpupmStateResidencyDataProvider( - const std::string &path, - const Config &config, - const std::string &sleepPath, - const SleepConfig &sleepConfig) - : mPath(std::move(path)), - mConfig(std::move(config)), - mSleepPath(std::move(sleepPath)), - mSleepConfig(std::move(sleepConfig)) {} - -int32_t CpupmStateResidencyDataProvider::matchState(char const *line) { - for (int32_t i = 0; i < mConfig.states.size(); i++) { - if (mConfig.states[i].second == Trim(std::string(line))) { - return i; - } - } - return -1; -} - -int32_t CpupmStateResidencyDataProvider::matchEntity(char const *line) { - for (int32_t i = 0; i < mConfig.entities.size(); i++) { - if (StartsWith(Trim(std::string(line)), mConfig.entities[i].second)) { - return i; - } - } - return -1; -} - -bool CpupmStateResidencyDataProvider::parseState( - char const *line, uint64_t *duration, uint64_t *count) { - std::vector parts = Split(line, " "); - if (parts.size() != 5) { - return false; - } - if (!ParseUint(Trim(parts[1]), count)) { - return false; - } - if (!ParseUint(Trim(parts[3]), duration)) { - return false; - } - return true; -} - -bool CpupmStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << mPath; - return false; - } - - std::unique_ptr sleepFp(fopen(mSleepPath.c_str(), "r"), fclose); - if (!sleepFp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << mSleepPath; - return false; - } - - for (int32_t i = 0; i < mConfig.entities.size(); i++) { - std::vector stateResidencies(mConfig.states.size()); - for (int32_t j = 0; j < stateResidencies.size(); j++) { - stateResidencies[j].id = j; - } - residencies->emplace(mConfig.entities[i].first, stateResidencies); - } - - size_t len = 0; - char *line = nullptr; - - int32_t temp, entityIndex, stateId = -1; - uint64_t duration, count, sleepDurationMs = 0; - auto it = residencies->end(); - int32_t sleepIndex = 0; - - // Parse state for sleep duration - while (getline(&line, &len, sleepFp.get()) != -1) { - std::string trimedLine = Trim(std::string(line)); - if (StartsWith(trimedLine, mSleepConfig[sleepIndex])) { - if (sleepIndex < mSleepConfig.size() - 1) { - sleepIndex++; - continue; - } else { - std::vector parts = Split(trimedLine, " "); - if (parts.size() == 2) { - ParseUint(parts[1], &sleepDurationMs); - sleepDurationMs /= NS_TO_MS; - } - break; - } - } - } - - // Parse state for CPUPM entities - while (getline(&line, &len, fp.get()) != -1) { - temp = matchState(line); - // Assign new id only when a new valid state is encountered. - if (temp >= 0) { - stateId = temp; - } - - if (stateId < 0) continue; - - entityIndex = matchEntity(line); - - if (entityIndex < 0) continue; - - it = residencies->find(mConfig.entities[entityIndex].first); - if (it != residencies->end()) { - if (parseState(line, &duration, &count)) { - it->second[stateId].totalTimeInStateMs = duration / US_TO_MS + sleepDurationMs; - it->second[stateId].totalStateEntryCount = count; - } else { - LOG(ERROR) << "Failed to parse duration and count from [" << std::string(line) - << "]"; - return false; - } - } - } - - free(line); - - return true; -} - -std::unordered_map> CpupmStateResidencyDataProvider::getInfo() { - std::unordered_map> info; - for (auto const &entity : mConfig.entities) { - std::vector stateInfo(mConfig.states.size()); - int32_t stateId = 0; - for (auto const &state : mConfig.states) { - stateInfo[stateId] = State{ - .id = stateId, - .name = state.first - }; - stateId++; - } - info.emplace(entity.first, stateInfo); - } - return info; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DevfreqStateResidencyDataProvider.cpp b/powerstats/DevfreqStateResidencyDataProvider.cpp deleted file mode 100644 index d59e1e5..0000000 --- a/powerstats/DevfreqStateResidencyDataProvider.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2021 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 "DevfreqStateResidencyDataProvider.h" - -#include - -static const std::string nameSuffix = "-DVFS"; -static const std::string pathSuffix = "/time_in_state"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -DevfreqStateResidencyDataProvider::DevfreqStateResidencyDataProvider(const std::string& name, - const std::string& path) : mName(name + nameSuffix), mPath(path + pathSuffix) {} - -bool DevfreqStateResidencyDataProvider::extractNum(const char *str, char **str_end, int base, - int64_t* num) { - // errno can be set to any non-zero value by a library function call - // regardless of whether there was an error, so it needs to be cleared - // in order to check the error set by strtoll - errno = 0; - *num = std::strtoll(str, str_end, base); - return (errno != ERANGE); -} - -std::vector> DevfreqStateResidencyDataProvider::parseTimeInState() { - // Using FILE* instead of std::ifstream for performance reasons - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << "Failed to open file " << mPath; - return {}; - } - - std::vector> timeInState; - - char *line = nullptr; - size_t len = 0; - while (getline(&line, &len, fp.get()) != -1) { - char* pEnd; - int64_t frequencyHz, totalTimeMs; - if (!extractNum(line, &pEnd, 10, &frequencyHz) || - !extractNum(pEnd, &pEnd, 10, &totalTimeMs)) { - PLOG(ERROR) << "Failed to parse " << mPath; - free(line); - return {}; - } - - timeInState.push_back({frequencyHz, totalTimeMs}); - } - - free(line); - return timeInState; -} - -bool DevfreqStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::vector> timeInState = parseTimeInState(); - - if (timeInState.empty()) { - return false; - } - - int32_t id = 0; - std::vector stateResidencies; - for (const auto[frequencyHz, totalTimeMs] : timeInState) { - StateResidency s = {.id = id++, .totalTimeInStateMs = totalTimeMs}; - stateResidencies.push_back(s); - } - - residencies->emplace(mName, stateResidencies); - return true; -} - -std::unordered_map> DevfreqStateResidencyDataProvider::getInfo() { - std::vector> timeInState = parseTimeInState(); - - if (timeInState.empty()) { - return {}; - } - - int32_t id = 0; - std::vector states; - for (const auto[frequencyHz, totalTimeMs] : timeInState) { - State s = {.id = id++, .name = std::to_string(frequencyHz / 1000) + "MHz"}; - states.push_back(s); - } - - return {{mName, states}}; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DisplayMrrStateResidencyDataProvider.cpp b/powerstats/DisplayMrrStateResidencyDataProvider.cpp deleted file mode 100644 index 8ab9af4..0000000 --- a/powerstats/DisplayMrrStateResidencyDataProvider.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 -#include -#include - -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 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(); - std::string statePath = mPath + AVAILABLE_STATE; - std::unique_ptr 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 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> *residencies) { - if (mConfigs.empty()) { - LOG(ERROR) << "Display MRR state list is empty!"; - return false; - } - - std::string path = mPath + TIME_IN_STATE; - std::unique_ptr fp(fopen(path.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << "Failed to open file " << path; - return false; - } - - std::vector 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::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> DisplayMrrStateResidencyDataProvider::getInfo() -{ - int32_t dispId; - std::string name; - std::vector 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 diff --git a/powerstats/DvfsStateResidencyDataProvider.cpp b/powerstats/DvfsStateResidencyDataProvider.cpp deleted file mode 100644 index ba8bd5e..0000000 --- a/powerstats/DvfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2020 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 "DvfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseUint; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -static const std::string nameSuffix = "-DVFS"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -DvfsStateResidencyDataProvider::DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, - std::vector cfgs) - : mPowerEntities(std::move(cfgs)), mPath(std::move(path)), mClockRate(clockRate) {} - -int32_t DvfsStateResidencyDataProvider::matchEntity(char const *line) { - for (int32_t i = 0; i < mPowerEntities.size(); i++) { - if (mPowerEntities[i].powerEntityName == Trim(std::string(line))) { - return i; - } - } - return -1; -} - -int32_t DvfsStateResidencyDataProvider::matchState(char const *line, const Config& powerEntity) { - for (int32_t i = 0; i < powerEntity.states.size(); i++) { - if (StartsWith(Trim(std::string(line)), powerEntity.states[i].second)) { - return i; - } - } - return -1; -} - -bool DvfsStateResidencyDataProvider::parseState(char const *line, uint64_t *duration, - uint64_t *count) { - std::vector parts = Split(line, " "); - if (parts.size() != 7) { - return false; - } - if (!ParseUint(Trim(parts[3]), count)) { - return false; - } - if (!ParseUint(Trim(parts[6]), duration)) { - return false; - } - return true; -} - -bool DvfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << mPath; - return false; - } - - for (const Config &powerEntity : mPowerEntities) { - std::vector stateResidency(powerEntity.states.size()); - for (int32_t i = 0; i < stateResidency.size(); i++) { - stateResidency[i].id = i; - } - residencies->emplace(powerEntity.powerEntityName + nameSuffix, stateResidency); - } - - size_t len = 0; - char *line = nullptr; - - int32_t temp, powerEntityIndex, stateId = -1; - uint64_t duration, count; - auto it = residencies->end(); - - while (getline(&line, &len, fp.get()) != -1) { - temp = matchEntity(line); - // Assign new index only when a new valid entity is encountered. - if (temp >= 0) { - powerEntityIndex = temp; - it = residencies->find(mPowerEntities[powerEntityIndex].powerEntityName + nameSuffix); - } - - // The given string is last state for each entity. - if (StartsWith(Trim(std::string(line)), "last_freq_change_time_ns:")) - it = residencies->end(); - - if (it != residencies->end()) { - stateId = matchState(line, mPowerEntities[powerEntityIndex]); - - if (stateId >= 0) { - if (parseState(line, &duration, &count)) { - it->second[stateId].totalTimeInStateMs = - duration / mClockRate; - it->second[stateId].totalStateEntryCount = count; - } else { - LOG(ERROR) << "Failed to parse duration and count from [" << std::string(line) - << "]"; - return false; - } - } - } - } - - free(line); - - return true; -} - -std::unordered_map> DvfsStateResidencyDataProvider::getInfo() { - std::unordered_map> info; - for (auto const &entity : mPowerEntities) { - std::vector stateInfo(entity.states.size()); - int32_t stateId = 0; - for (auto const &state : entity.states) { - stateInfo[stateId] = State{ - .id = stateId, - .name = state.first - }; - stateId++; - } - info.emplace(entity.powerEntityName + nameSuffix, stateInfo); - } - return info; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/OWNERS b/powerstats/OWNERS deleted file mode 100644 index e0d66d7..0000000 --- a/powerstats/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -darrenhsu@google.com -joaodias@google.com -krossmo@google.com -vincentwang@google.com diff --git a/powerstats/TpuDvfsStateResidencyDataProvider.cpp b/powerstats/TpuDvfsStateResidencyDataProvider.cpp deleted file mode 100644 index e1ce56c..0000000 --- a/powerstats/TpuDvfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 "TpuDvfsStateResidencyDataProvider.h" - -#include - -static const std::string ENTITY_NAME = "TPU-DVFS"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -TpuDvfsStateResidencyDataProvider::TpuDvfsStateResidencyDataProvider( - const std::string& path, - std::vector frequencies, - uint64_t clockRate) - : mPath(path), mFrequencies(std::move(frequencies)), mClockRate(clockRate) {} - -bool TpuDvfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - // Using FILE* instead of std::ifstream for performance reasons - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << "Failed to open file " << mPath; - return false; - } - - std::vector stateResidencies; - for (int i = 0; i < mFrequencies.size(); i++) { - StateResidency s = {.id = i, .totalTimeInStateMs = 0}; - stateResidencies.push_back(s); - } - - char *line = nullptr; - size_t len = 0; - std::istringstream ssLine; - std::string split; - int32_t lineIdx = 0; - std::vector stateIdxMap; - int32_t colIdx; - std::vector::const_iterator found; - while (getline(&line, &len, fp.get()) != -1) { - ssLine.clear(); - ssLine.str(line); - colIdx = 0; - for (std::string split; std::getline(ssLine, split, ' ');) { - // Skip first column - if (split.find(':') != std::string::npos) - continue; - - if (lineIdx == 0) { - // Build the state index map by first row - split.erase(split.find_last_not_of(" \n\r\t") + 1); - found = std::find(mFrequencies.begin(), mFrequencies.end(), split); - if (found != mFrequencies.end()) { - stateIdxMap.push_back(found - mFrequencies.begin()); - } else { - PLOG(ERROR) << "TPU frequency " << split << " is not found in " << mPath; - stateIdxMap.push_back(0); - } - } else { - // Add up time in frequency per uid - stateResidencies[stateIdxMap[colIdx]].totalTimeInStateMs += - std::atoll(split.c_str()) / mClockRate; - } - colIdx++; - } - lineIdx++; - } - - residencies->emplace(ENTITY_NAME, stateResidencies); - return true; -} - -std::unordered_map> TpuDvfsStateResidencyDataProvider::getInfo() { - std::vector states; - for (int32_t id = 0; id < mFrequencies.size(); id++) { - State s = - {.id = id, .name = std::to_string(std::atol(mFrequencies[id].c_str()) / 1000) + "MHz"}; - states.push_back(s); - } - - return {{ENTITY_NAME, states}}; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/UfsStateResidencyDataProvider.cpp b/powerstats/UfsStateResidencyDataProvider.cpp deleted file mode 100644 index aec7724..0000000 --- a/powerstats/UfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 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 "UfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseInt; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -const int32_t HIBERNATE_STATE_ID = 0; -const std::string UFS_NAME = "UFS"; - -UfsStateResidencyDataProvider::UfsStateResidencyDataProvider(std::string prefix) : kPrefix(prefix) {} - -bool UfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - StateResidency residency; - residency.id = HIBERNATE_STATE_ID; - - // The transform function converts microseconds to milliseconds. - std::function usecToMs = [](uint64_t a) { return a / 1000; }; - - residency.totalTimeInStateMs = usecToMs(readStat(kPrefix + "hibern8_total_us")); - residency.totalStateEntryCount = readStat(kPrefix + "hibern8_exit_cnt"); - residency.lastEntryTimestampMs = usecToMs(readStat(kPrefix + "last_hibern8_enter_time")); - - residencies->emplace(UFS_NAME, std::vector{residency}); - return true; -} - -std::unordered_map> UfsStateResidencyDataProvider::getInfo() { - return {{UFS_NAME, std::vector{{HIBERNATE_STATE_ID, "HIBERN8"}} }}; -} - -int64_t UfsStateResidencyDataProvider::readStat(std::string path) { - std::unique_ptr fp(fopen(path.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << path - << " Error = " << strerror(errno); - return 0; - } - const size_t size = 20; - char buf[size]; - (void)fread(&buf, sizeof(char), size, fp.get()); - int64_t ret; - if (!ParseInt(Trim(std::string(buf)), &ret)) { - LOG(ERROR) << "Failed to parse int64 from [" << std::string(buf) << "]"; - } - return ret; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/AdaptiveDvfsStateResidencyDataProvider.h b/powerstats/include/AdaptiveDvfsStateResidencyDataProvider.h deleted file mode 100644 index 5983f0b..0000000 --- a/powerstats/include/AdaptiveDvfsStateResidencyDataProvider.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 "DvfsStateResidencyDataProvider.h" - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class AdaptiveDvfsStateResidencyDataProvider : public DvfsStateResidencyDataProvider { - public: - /* - * path - path to dvfs sysfs node. - * clockRate - clock rate in KHz. - * powerEntities - list of power entity pairs (name to power entity, path to frequency table) - */ - AdaptiveDvfsStateResidencyDataProvider( - std::string path, - uint64_t clockRate, - std::vector> powerEntities); - ~AdaptiveDvfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/AocStateResidencyDataProvider.h b/powerstats/include/AocStateResidencyDataProvider.h deleted file mode 100644 index 708ea4c..0000000 --- a/powerstats/include/AocStateResidencyDataProvider.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2020 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 -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class AocStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - AocStateResidencyDataProvider(std::vector> ids, - std::vector> states, - const uint64_t aocClock); - ~AocStateResidencyDataProvider() = default; - bool getStateResidencies( - std::unordered_map> *residencies) override; - std::unordered_map> getInfo() override; - - protected: - std::unordered_map> /* providers */> mProviders; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/AocTimedStateResidencyDataProvider.h b/powerstats/include/AocTimedStateResidencyDataProvider.h deleted file mode 100644 index 8611ae6..0000000 --- a/powerstats/include/AocTimedStateResidencyDataProvider.h +++ /dev/null @@ -1,65 +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. - */ -#pragma once - -#include "AocStateResidencyDataProvider.h" - -#include -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -enum AsyncStatus { - COMPLETED, - RUN, - RUNNING -}; - -class AocTimedStateResidencyDataProvider : public AocStateResidencyDataProvider { - public: - AocTimedStateResidencyDataProvider( - std::vector> ids, - std::vector> states, - const uint64_t timeoutMillis, - const uint64_t aocClock); - ~AocTimedStateResidencyDataProvider() = default; - - bool getStateResidencies( - std::unordered_map> *residencies) override; - - private: - void getStateResidenciesAsync(); - - uint64_t mTimeoutMillis; - std::thread mAsyncThread; - std::mutex mStatusMutex; - std::condition_variable mRunCond; - std::condition_variable mCompletedCond; - std::unordered_map> mStateResidencies; - AsyncStatus mAsyncStatus; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/CpupmStateResidencyDataProvider.h b/powerstats/include/CpupmStateResidencyDataProvider.h deleted file mode 100644 index be8ee46..0000000 --- a/powerstats/include/CpupmStateResidencyDataProvider.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class CpupmStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - class Config { - public: - // List of power entity name pairs (name to display, name to parse) - std::vector> entities; - - // List of state pairs (state to display, state to parse). - std::vector> states; - }; - - typedef std::vector SleepConfig; - - /* - * path - path to cpupm sysfs node. - */ - CpupmStateResidencyDataProvider( - const std::string &path, - const Config &config, - const std::string &sleepPath, - const SleepConfig &sleepConfig); - ~CpupmStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - int32_t matchEntity(char const *line); - int32_t matchState(char const *line); - bool parseState(char const *line, uint64_t *duration, uint64_t *count); - - // A constant to represent the number of microseconds in one millisecond. - const uint64_t US_TO_MS = 1000; - // A constant to represent the number of nanoseconds in one millisecond. - const uint64_t NS_TO_MS = 1000000; - - const std::string mPath; - const Config mConfig; - const std::string mSleepPath; - const SleepConfig mSleepConfig; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/DevfreqStateResidencyDataProvider.h b/powerstats/include/DevfreqStateResidencyDataProvider.h deleted file mode 100644 index 8341b43..0000000 --- a/powerstats/include/DevfreqStateResidencyDataProvider.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2021 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 - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class DevfreqStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - DevfreqStateResidencyDataProvider(const std::string& name, const std::string& path); - ~DevfreqStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - bool extractNum(const char *str, char **str_end, int base, int64_t* num); - std::vector> parseTimeInState(); - const std::string mName; - const std::string mPath; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/DisplayMrrStateResidencyDataProvider.h b/powerstats/include/DisplayMrrStateResidencyDataProvider.h deleted file mode 100644 index 81ea17e..0000000 --- a/powerstats/include/DisplayMrrStateResidencyDataProvider.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 - -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> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> 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 mConfigs; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/DvfsStateResidencyDataProvider.h b/powerstats/include/DvfsStateResidencyDataProvider.h deleted file mode 100644 index 0aeafb7..0000000 --- a/powerstats/include/DvfsStateResidencyDataProvider.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2020 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 - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class DvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - class Config { - public: - // Power entity name to parse. - std::string powerEntityName; - - // List of state pairs (name to display, name to parse). - std::vector> states; - }; - /* - * path - path to dvfs sysfs node. - * clockRate - clock rate in KHz. - */ - DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, std::vector cfgs); - ~DvfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - protected: - std::vector mPowerEntities; - - private: - int32_t matchEntity(char const *line); - int32_t matchState(char const *line, const Config& powerEntity); - bool parseState(char const *line, uint64_t *duration, uint64_t *count); - - const std::string mPath; - const uint64_t mClockRate; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/TpuDvfsStateResidencyDataProvider.h b/powerstats/include/TpuDvfsStateResidencyDataProvider.h deleted file mode 100644 index 9ce3bd3..0000000 --- a/powerstats/include/TpuDvfsStateResidencyDataProvider.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class TpuDvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - TpuDvfsStateResidencyDataProvider( - const std::string& path, std::vector frequencies, uint64_t clockRate); - ~TpuDvfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - const std::string mPath; - const std::vector mFrequencies; - const uint64_t mClockRate; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/include/UfsStateResidencyDataProvider.h b/powerstats/include/UfsStateResidencyDataProvider.h deleted file mode 100644 index f4ef268..0000000 --- a/powerstats/include/UfsStateResidencyDataProvider.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2021 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 - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class UfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - UfsStateResidencyDataProvider(std::string prefix); - ~UfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - int64_t readStat(std::string path); - - const std::string kPrefix; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/radio/dump.mk b/radio/dump.mk deleted file mode 100644 index fef7974..0000000 --- a/radio/dump.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/radio/sepolicy/ diff --git a/radio/sepolicy/dump_radio.te b/radio/sepolicy/dump_radio.te deleted file mode 100644 index 7970f08..0000000 --- a/radio/sepolicy/dump_radio.te +++ /dev/null @@ -1,10 +0,0 @@ -pixel_bugreport(dump_radio) - -userdebug_or_eng(` - allow dump_radio radio_vendor_data_file:dir create_dir_perms; - allow dump_radio radio_vendor_data_file:file create_file_perms; - allow dump_radio tcpdump_vendor_data_file:dir r_dir_perms; - allow dump_radio tcpdump_vendor_data_file:file r_file_perms; - get_prop(dump_radio, vendor_rild_prop) - get_prop(dump_radio vendor_tcpdump_log_prop) -') diff --git a/radio/sepolicy/file.te b/radio/sepolicy/file.te deleted file mode 100644 index 95b24c0..0000000 --- a/radio/sepolicy/file.te +++ /dev/null @@ -1,9 +0,0 @@ -# Data -type tcpdump_vendor_data_file, file_type, data_file_type; - -# Modem -type sysfs_modem_state, sysfs_type, fs_type; - -userdebug_or_eng(` - typeattribute tcpdump_vendor_data_file mlstrustedobject; -') diff --git a/radio/sepolicy/file_contexts b/radio/sepolicy/file_contexts deleted file mode 100644 index 20d786c..0000000 --- a/radio/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_radio u:object_r:dump_radio_exec:s0 -/data/vendor/tcpdump_logger(/.*)? u:object_r:tcpdump_vendor_data_file:s0 diff --git a/radio/sepolicy/genfs_contexts b/radio/sepolicy/genfs_contexts deleted file mode 100644 index 039f329..0000000 --- a/radio/sepolicy/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# modem state node -genfscon sysfs /devices/platform/cpif/modem_state u:object_r:sysfs_modem_state:s0 - diff --git a/ramdump_and_coredump/ramdump_and_coredump.mk b/ramdump_and_coredump/ramdump_and_coredump.mk deleted file mode 100644 index b8b6f7a..0000000 --- a/ramdump_and_coredump/ramdump_and_coredump.mk +++ /dev/null @@ -1,12 +0,0 @@ -PRODUCT_PACKAGES += \ - sscoredump \ - -# When neither AOSP nor factory targets -ifeq (,$(filter aosp_% factory_% lineage_%, $(TARGET_PRODUCT))) - PRODUCT_PACKAGES += SSRestartDetector -endif - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/ramdump_and_coredump/sepolicy - -# sscoredump -PRODUCT_PROPERTY_OVERRIDES += vendor.debug.ssrdump.type=sscoredump diff --git a/ramdump_and_coredump/sepolicy/bug_map b/ramdump_and_coredump/sepolicy/bug_map deleted file mode 100644 index 0554746..0000000 --- a/ramdump_and_coredump/sepolicy/bug_map +++ /dev/null @@ -1,3 +0,0 @@ -ramdump vendor_hw_plat_prop file b/161103878 -ramdump public_vendor_default_prop file b/161103878 -ramdump proc_bootconfig file b/181615626 diff --git a/ramdump_and_coredump/sepolicy/device.te b/ramdump_and_coredump/sepolicy/device.te deleted file mode 100644 index 7614dd4..0000000 --- a/ramdump_and_coredump/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type sscoredump_device, dev_type; diff --git a/ramdump_and_coredump/sepolicy/dump_ramdump.te b/ramdump_and_coredump/sepolicy/dump_ramdump.te deleted file mode 100644 index 8bf6ccc..0000000 --- a/ramdump_and_coredump/sepolicy/dump_ramdump.te +++ /dev/null @@ -1,10 +0,0 @@ -pixel_bugreport(dump_ramdump) - -userdebug_or_eng(` - allow dump_ramdump mnt_vendor_file:dir search; - allow dump_ramdump vendor_shell_exec:file execute_no_trans; - allow dump_ramdump vendor_toolbox_exec:file execute_no_trans; - - allow dump_ramdump ramdump_vendor_mnt_file:dir search; - allow dump_ramdump ramdump_vendor_mnt_file:file r_file_perms; -') diff --git a/ramdump_and_coredump/sepolicy/file.te b/ramdump_and_coredump/sepolicy/file.te deleted file mode 100644 index 10c3171..0000000 --- a/ramdump_and_coredump/sepolicy/file.te +++ /dev/null @@ -1,15 +0,0 @@ -# ramdump: file -type ramdump_vendor_data_file, file_type, data_file_type, mlstrustedobject; -type ramdump_vendor_mnt_file, file_type, data_file_type, mlstrustedobject; -type ramdump_vendor_fs, fusefs_type, data_file_type, mlstrustedobject; - -# sscoredump: file -type sscoredump_vendor_data_coredump_file, file_type, data_file_type, mlstrustedobject; -type sscoredump_vendor_data_crashinfo_file, file_type, data_file_type, mlstrustedobject; - -# sscoredump: sysfs -type sysfs_sscoredump_level, sysfs_type, fs_type; # sscoredump level -type sysfs_sscoredump_subsystem_report_count, sysfs_type, fs_type; # subsystem report_count: per device explicit path - -# ssr_detector_app -type sscoredump_vendor_data_logcat_file, file_type, data_file_type, mlstrustedobject; diff --git a/ramdump_and_coredump/sepolicy/file_contexts b/ramdump_and_coredump/sepolicy/file_contexts deleted file mode 100644 index 747fc02..0000000 --- a/ramdump_and_coredump/sepolicy/file_contexts +++ /dev/null @@ -1,17 +0,0 @@ -# dump_ramdump -/vendor/bin/dump/dump_ramdump u:object_r:dump_ramdump_exec:s0 - -# ramdump -/data/vendor/ramdump(/.*)? u:object_r:ramdump_vendor_data_file:s0 -/mnt/vendor/ramdump(/.*)? u:object_r:ramdump_vendor_mnt_file:s0 -/vendor/bin/ramdump u:object_r:ramdump_exec:s0 -/vendor/bin/ramdump32 u:object_r:ramdump_exec:s0 - -# sscoredump -/data/vendor/ssrdump(/.*)? u:object_r:sscoredump_vendor_data_crashinfo_file:s0 -/data/vendor/ssrdump/coredump(/.*)? u:object_r:sscoredump_vendor_data_coredump_file:s0 -/dev/sscd_.* u:object_r:sscoredump_device:s0 -/vendor/bin/sscoredump u:object_r:sscoredump_exec:s0 - -# ssr_detector_app -/data/vendor/ssrdump/logcat(/.*)? u:object_r:sscoredump_vendor_data_logcat_file:s0 diff --git a/ramdump_and_coredump/sepolicy/genfs_contexts b/ramdump_and_coredump/sepolicy/genfs_contexts deleted file mode 100644 index 5a6e494..0000000 --- a/ramdump_and_coredump/sepolicy/genfs_contexts +++ /dev/null @@ -1 +0,0 @@ -genfscon sysfs /class/sscoredump/level u:object_r:sysfs_sscoredump_level:s0 diff --git a/ramdump_and_coredump/sepolicy/property.te b/ramdump_and_coredump/sepolicy/property.te deleted file mode 100644 index e708b5a..0000000 --- a/ramdump_and_coredump/sepolicy/property.te +++ /dev/null @@ -1,2 +0,0 @@ -# ramdump -vendor_internal_prop(vendor_ramdump_prop) diff --git a/ramdump_and_coredump/sepolicy/property_contexts b/ramdump_and_coredump/sepolicy/property_contexts deleted file mode 100644 index a50f5a9..0000000 --- a/ramdump_and_coredump/sepolicy/property_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# ramdump -ro.boot.ramdump u:object_r:vendor_ramdump_prop:s0 -vendor.debug.ramdump. u:object_r:vendor_ramdump_prop:s0 diff --git a/ramdump_and_coredump/sepolicy/ramdump.te b/ramdump_and_coredump/sepolicy/ramdump.te deleted file mode 100644 index d66139f..0000000 --- a/ramdump_and_coredump/sepolicy/ramdump.te +++ /dev/null @@ -1,48 +0,0 @@ -type ramdump_exec, exec_type, vendor_file_type, file_type; -type ramdump, domain; - -userdebug_or_eng(` - init_daemon_domain(ramdump) - - set_prop(ramdump, vendor_ramdump_prop) - - # f2fs set pin file requires sys_admin - allow ramdump self:capability { sys_admin sys_rawio }; - - allow ramdump ramdump_vendor_data_file:dir create_dir_perms; - allow ramdump ramdump_vendor_data_file:file create_file_perms; - allow ramdump proc_cmdline:file r_file_perms; - - allow ramdump block_device:dir search; - allow ramdump misc_block_device:blk_file rw_file_perms; - allow ramdump userdata_block_device:blk_file rw_file_perms; - - # Allow ReadDefaultFstab(). - read_fstab(ramdump) - - # read /fstab.${ro.hardware} - allow ramdump rootfs:file r_file_perms; - - r_dir_file(ramdump, sysfs_type) - - # To access statsd. - hwbinder_use(ramdump) - get_prop(ramdump, hwservicemanager_prop) - get_prop(ramdump, boot_status_prop) - allow ramdump fwk_stats_hwservice:hwservice_manager find; - binder_call(ramdump, stats_service_server) - allow ramdump fwk_stats_service:service_manager find; - binder_use(ramdump) - - # To implement fusefs (ramdumpfs) under /mnt/vendor/ramdump. - allow ramdump fuse:filesystem relabelfrom; - allow ramdump fuse_device:chr_file rw_file_perms; - allow ramdump mnt_vendor_file:dir r_dir_perms; - allow ramdump ramdump_vendor_mnt_file:dir { getattr mounton }; - allow ramdump ramdump_vendor_fs:filesystem { mount unmount relabelfrom relabelto }; - allow ramdump_vendor_mnt_file ramdump_vendor_fs:filesystem associate; - - # Access new Stats AIDL APIs (ag/13714907). - allow ramdump fwk_stats_service:service_manager find; - binder_call(ramdump, servicemanager) -') diff --git a/ramdump_and_coredump/sepolicy/ramdump_app.te b/ramdump_and_coredump/sepolicy/ramdump_app.te deleted file mode 100644 index 674786b..0000000 --- a/ramdump_and_coredump/sepolicy/ramdump_app.te +++ /dev/null @@ -1,34 +0,0 @@ -# SEpolicy for com.android.ramdump -type ramdump_app, domain; - -userdebug_or_eng(` - app_domain(ramdump_app) - - # For using Firebase Cloud Firestore - net_domain(ramdump_app) - - allow ramdump_app app_api_service:service_manager find; - - # For Firebase Analytics - allow ramdump_app privapp_data_file:file x_file_perms; - allow ramdump_app privapp_data_file:lnk_file r_file_perms; - - allow ramdump_app ramdump_vendor_data_file:file create_file_perms; - allow ramdump_app ramdump_vendor_data_file:dir create_dir_perms; - - set_prop(ramdump_app, vendor_ramdump_prop) - get_prop(ramdump_app, system_boot_reason_prop) - - # To access ramdumpfs. - allow ramdump_app mnt_vendor_file:dir search; - allow ramdump_app ramdump_vendor_mnt_file:dir create_dir_perms; - allow ramdump_app ramdump_vendor_mnt_file:file create_file_perms; - - # To access subsystem ramdump files and dirs. - allow ramdump_app sscoredump_vendor_data_crashinfo_file:dir r_dir_perms; - allow ramdump_app sscoredump_vendor_data_crashinfo_file:file r_file_perms; - allow ramdump_app sscoredump_vendor_data_coredump_file:dir r_dir_perms; - allow ramdump_app sscoredump_vendor_data_coredump_file:file r_file_perms; - allow ramdump_app sscoredump_vendor_data_logcat_file:dir r_dir_perms; - allow ramdump_app sscoredump_vendor_data_logcat_file:file r_file_perms; -') diff --git a/ramdump_and_coredump/sepolicy/seapp_contexts b/ramdump_and_coredump/sepolicy/seapp_contexts deleted file mode 100644 index 2618216..0000000 --- a/ramdump_and_coredump/sepolicy/seapp_contexts +++ /dev/null @@ -1,5 +0,0 @@ -# ramdump_app -user=_app seinfo=platform name=com.android.ramdump domain=ramdump_app type=app_data_file levelFrom=all - -# ssr_detector_app -user=system seinfo=platform name=com.google.SSRestartDetector domain=ssr_detector_app type=system_app_data_file levelFrom=user diff --git a/ramdump_and_coredump/sepolicy/sscoredump.te b/ramdump_and_coredump/sepolicy/sscoredump.te deleted file mode 100644 index 70d6e1b..0000000 --- a/ramdump_and_coredump/sepolicy/sscoredump.te +++ /dev/null @@ -1,18 +0,0 @@ -type sscoredump, domain; -type sscoredump_exec, vendor_file_type, exec_type, file_type; - -init_daemon_domain(sscoredump) - -set_prop(sscoredump, vendor_ssrdump_prop) - -allow sscoredump device:dir r_dir_perms; -allow sscoredump sscoredump_device:chr_file rw_file_perms; -allow sscoredump sscoredump_vendor_data_crashinfo_file:dir create_dir_perms; -allow sscoredump sscoredump_vendor_data_crashinfo_file:file create_file_perms; -allow sscoredump sysfs_sscoredump_subsystem_report_count:file r_file_perms; - -userdebug_or_eng(` - allow sscoredump sysfs_sscoredump_level:file rw_file_perms; - allow sscoredump sscoredump_vendor_data_coredump_file:dir create_dir_perms; - allow sscoredump sscoredump_vendor_data_coredump_file:file create_file_perms; -') diff --git a/ramdump_and_coredump/sepolicy/ssr_detector_app.te b/ramdump_and_coredump/sepolicy/ssr_detector_app.te deleted file mode 100644 index ffd612a..0000000 --- a/ramdump_and_coredump/sepolicy/ssr_detector_app.te +++ /dev/null @@ -1,27 +0,0 @@ -type ssr_detector_app, domain; - -app_domain(ssr_detector_app) -allow ssr_detector_app app_api_service:service_manager find; -allow ssr_detector_app radio_service:service_manager find; - -allow ssr_detector_app system_app_data_file:dir create_dir_perms; -allow ssr_detector_app system_app_data_file:file create_file_perms; - -allow ssr_detector_app sscoredump_vendor_data_crashinfo_file:dir r_dir_perms; -allow ssr_detector_app sscoredump_vendor_data_crashinfo_file:file r_file_perms; - -userdebug_or_eng(` - allow ssr_detector_app sscoredump_vendor_data_coredump_file:dir r_dir_perms; - allow ssr_detector_app sscoredump_vendor_data_coredump_file:file r_file_perms; - allow ssr_detector_app sscoredump_vendor_data_logcat_file:dir create_dir_perms; - allow ssr_detector_app sscoredump_vendor_data_logcat_file:file create_file_perms; - get_prop(ssr_detector_app, vendor_aoc_prop) - allow ssr_detector_app sysfs_sjtag:dir r_dir_perms; - allow ssr_detector_app sysfs_sjtag:file rw_file_perms; - allow ssr_detector_app proc_vendor_sched:dir search; - allow ssr_detector_app proc_vendor_sched:file rw_file_perms; - allow ssr_detector_app cgroup:file write; -') - -get_prop(ssr_detector_app, vendor_ssrdump_prop) -get_prop(ssr_detector_app, vendor_wifi_version) diff --git a/recorder/recorder.mk b/recorder/recorder.mk deleted file mode 100644 index 87620da..0000000 --- a/recorder/recorder.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/recorder/sepolicy/vendor -PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/recorder/sepolicy/product/public -PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/recorder/sepolicy/product/private diff --git a/recorder/sepolicy/product/private/certs/com_google_android_apps_recorder.x509.pem b/recorder/sepolicy/product/private/certs/com_google_android_apps_recorder.x509.pem deleted file mode 100644 index 833c86b..0000000 --- a/recorder/sepolicy/product/private/certs/com_google_android_apps_recorder.x509.pem +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF+zCCA+OgAwIBAgIVAJFfB9eQ7J1w93C6aGBchm77ysA3MA0GCSqGSIb3DQEBCwUAMIGNMQsw -CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEU -MBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxKTAnBgNVBAMMIGNvbV9nb29n -bGVfYW5kcm9pZF9hcHBzX3JlY29yZGVyMB4XDTE5MDIxNTE1NDQxMloXDTQ5MDIxNTE1NDQxMlow -gY0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBW -aWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEpMCcGA1UEAwwgY29t -X2dvb2dsZV9hbmRyb2lkX2FwcHNfcmVjb3JkZXIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK -AoICAQCFSs/DqyyRbMD2mEHxxv+DDnV7V8j/RUB43aZXC11kKbLAD/E8/WxV+e9frFoXlzXepK4m -FliWHyLWNSUmFwVxl2JsrkxUJ4QWXIpw9azHkW9kO5r/VPTXCBAZn80qqaqHlzplHbflxLiQc+zv -lWEg7HJPBMMMFC3yCYfhLbDrriZdMnT4mHMLUo24TzO2znv7c7SDBWQ57lAsdRB0OX+N4DfBXvUR -QLUO9FazerGdcK58KHkxgo3ZHY3c2+efkfCkZUgu6HKLwA24O2e0/iYmC7vQTItGYCCyzbdlXDix -t0YgpsdcsOtVSJLwv6movtAX9JGsrGkvZR9Ffa52Vfc+vW0yqahHxVFJ5VD6UrrQpkWjonrsIbHb -RLQ05ZM735kd4NWrxgS0sDwdfvhmsj29Ag3q/cuIpG/+x37+vmTlMKggeqxSxoQ4RwGyZuvyb8PB -/lCf6r6bAYyr88oAs03ATz3RqRH38rkHmFp5Cdf488tw2Wj6vB/JqnfPN8woslle0hUIkqH7Ezna -0zF79yov7oePFdqr++khDHrrMQziwIk2PN+V0MLGQpmX5FF47Zmprtzvu52QN2f5rnKq2HSfBG0i -FqZ8/iAEnUsCngVObHaASPxXq1AKiy3iEJaLDjFhGbQk9mbj9o/RHb0kyorI3d90PU8ss8xNsUnm -pXa4sQIDAQABo1AwTjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBRXxQfB1H79Hq56Ld1GUrRRfzWo -ojAfBgNVHSMEGDAWgBRXxQfB1H79Hq56Ld1GUrRRfzWoojANBgkqhkiG9w0BAQsFAAOCAgEARATw -47mgvvLpdLTPzjORUSLBWXS2WdH43o9tPBNOaLBVRWiua2OyMp8F+nbxm4y/3djGuXsn5S2F12jp -7xQZcBU4c21vF/ttio/spnnkPBnf0nKndTLoKt4Tpcxq4vnyqyXlBJHIybh+bbc6HVTYM6n8k4vw -KReUjEjCXAxZ8vWjTgSOAtDrHkaez3tOkACMFmRv+JP1zNG32chLG+8K0/pyLsnknloPAk02Btoc -t7FI4XKtS/9Z9oipMHfWg8fjI4vRXqiiAR4ctf9EgxcwHY/KVX8RJxsAXMgl65e7qGagbfTWCbHl -MnRnapjLKkvJKPiIbBx/xdgUoOxdugwL6XPfzg4THQzAiduCgxkDs/H3SQWem6VBZ57KSuudJsop -s5hb7GS2Hqb5F3YHAlSGQxvj37mDTzbuTH3paqzPwSgnqw0jnkGl//f2osw/mqfD5msDLk4UcmpQ -IeC10ofhF7hzaZOGwMg8VGzsMR5M154haxj6Y2NFEir6ylz/stPrelkwDvMIDgIororj2Bj7TkWu -+EABNAr8h9yTsJEvxayNMk96U+Rn2LKMZilJdf00SILpr6IFTD8uvRwLIHSCjSbd9C8kkAqbqKs4 -VCg5HPLHjxyXgWOAK1IeqqnryaFPjLqa2RsG6UL+UtIjC6eWMsWOfvRRrpTU21mo2Koc0MI= ------END CERTIFICATE----- diff --git a/recorder/sepolicy/product/private/google_recorder_app.te b/recorder/sepolicy/product/private/google_recorder_app.te deleted file mode 100644 index ac308aa..0000000 --- a/recorder/sepolicy/product/private/google_recorder_app.te +++ /dev/null @@ -1,16 +0,0 @@ -app_domain(google_recorder_app) -net_domain(google_recorder_app) - -get_prop(google_recorder_app, graphics_config_writable_prop) - -allow google_recorder_app app_api_service:service_manager find; -allow google_recorder_app audioserver_service:service_manager find; -allow google_recorder_app mediaextractor_service:service_manager find; -allow google_recorder_app mediametrics_service:service_manager find; -allow google_recorder_app mediaserver_service:service_manager find; - -allow google_recorder_app privapp_data_file:lnk_file r_file_perms; -allow google_recorder_app privapp_data_file:file execute; - -# Library code may try to access default properties, but should be denied -dontaudit google_recorder_app default_prop:file read; diff --git a/recorder/sepolicy/product/private/keys.conf b/recorder/sepolicy/product/private/keys.conf deleted file mode 100644 index 9dad2f5..0000000 --- a/recorder/sepolicy/product/private/keys.conf +++ /dev/null @@ -1,2 +0,0 @@ -[@GOOGLERECORDER] -ALL : device/google/gs-common/recorder/sepolicy/product/private/certs/com_google_android_apps_recorder.x509.pem diff --git a/recorder/sepolicy/product/private/mac_permissions.xml b/recorder/sepolicy/product/private/mac_permissions.xml deleted file mode 100644 index b1d21bf..0000000 --- a/recorder/sepolicy/product/private/mac_permissions.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - diff --git a/recorder/sepolicy/product/private/seapp_contexts b/recorder/sepolicy/product/private/seapp_contexts deleted file mode 100644 index f264927..0000000 --- a/recorder/sepolicy/product/private/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Google Recorder -user=_app isPrivApp=true seinfo=GoogleRecorder name=com.google.android.apps.recorder domain=google_recorder_app type=app_data_file levelFrom=all diff --git a/recorder/sepolicy/product/public/google_recorder_app.te b/recorder/sepolicy/product/public/google_recorder_app.te deleted file mode 100644 index b718e12..0000000 --- a/recorder/sepolicy/product/public/google_recorder_app.te +++ /dev/null @@ -1 +0,0 @@ -type google_recorder_app, domain; diff --git a/recorder/sepolicy/vendor/google_recorder_app.te b/recorder/sepolicy/vendor/google_recorder_app.te deleted file mode 100644 index e140678..0000000 --- a/recorder/sepolicy/vendor/google_recorder_app.te +++ /dev/null @@ -1 +0,0 @@ -get_prop(google_recorder_app, vendor_audio_prop_restricted) diff --git a/sensors/Android.bp b/sensors/Android.bp deleted file mode 100644 index dec4991..0000000 --- a/sensors/Android.bp +++ /dev/null @@ -1,20 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_sensors", - srcs: ["dump_sensors.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdumpstateutil", - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/sensors/dump_sensors.cpp b/sensors/dump_sensors.cpp deleted file mode 100644 index 4c406ce..0000000 --- a/sensors/dump_sensors.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include -#include -#include -#include "DumpstateUtil.h" - -int main() { - setbuf(stdout, NULL); - - runCommand("USF statistics", "/vendor/bin/usf_stats get --all"); - if (!::android::os::dumpstate::PropertiesHelper::IsUserBuild()) { - // Not a user build, if this is also not a production device dump the USF registry. - std::string hwRev = ::android::base::GetProperty("ro.boot.hardware.revision", ""); - if (hwRev.find("DEV") != std::string::npos || - hwRev.find("PROTO") != std::string::npos || - hwRev.find("EVT") != std::string::npos || - hwRev.find("DVT") != std::string::npos || - hwRev.find("PVT") != std::string::npos) { - runCommand("USF Registry", "/vendor/bin/usf_reg_edit save -"); - dumpFileContent("USF Last Stat Buffer", "/data/vendor/sensors/debug/stats.history"); - } - } - return 0; -} diff --git a/sensors/sensors.mk b/sensors/sensors.mk deleted file mode 100644 index b350a6a..0000000 --- a/sensors/sensors.mk +++ /dev/null @@ -1,3 +0,0 @@ -PRODUCT_PACKAGES += dump_sensors -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/sensors/sepolicy - diff --git a/sensors/sepolicy/dump_sensors.te b/sensors/sepolicy/dump_sensors.te deleted file mode 100644 index 7d37a63..0000000 --- a/sensors/sepolicy/dump_sensors.te +++ /dev/null @@ -1,11 +0,0 @@ -pixel_bugreport(dump_sensors) -allow dump_sensors aoc_device:chr_file rw_file_perms; -allow dump_sensors device:dir r_dir_perms; -allow dump_sensors vendor_shell_exec:file execute_no_trans; -allow dump_sensors vendor_usf_stats:file execute_no_trans; - -userdebug_or_eng(` - allow dump_sensors vendor_usf_reg_edit:file execute_no_trans; - allow dump_sensors sensor_debug_data_file:dir r_dir_perms; - allow dump_sensors sensor_debug_data_file:file r_file_perms; -') diff --git a/sensors/sepolicy/file.te b/sensors/sepolicy/file.te deleted file mode 100644 index f59381b..0000000 --- a/sensors/sepolicy/file.te +++ /dev/null @@ -1,18 +0,0 @@ -# -# USF file SELinux type enforcements. -# - -type vendor_usf_stats, vendor_file_type, file_type; -type vendor_usf_reg_edit, vendor_file_type, file_type; - -# Declare the sensor registry persist file type. By convention, persist file -# types begin with "persist_". -type persist_sensor_reg_file, file_type, vendor_persist_type; - -# Declare the sensor registry data file type. By convention, data file types -# end with "data_file". -type sensor_reg_data_file, file_type, data_file_type; - -# Declare the sensor debug data file type. By convention, data file types -# end with "data_file". -type sensor_debug_data_file, file_type, data_file_type; diff --git a/sensors/sepolicy/file_contexts b/sensors/sepolicy/file_contexts deleted file mode 100644 index d41b33e..0000000 --- a/sensors/sepolicy/file_contexts +++ /dev/null @@ -1,16 +0,0 @@ -# -# USF SELinux file security contexts. -# - -/vendor/bin/dump/dump_sensors u:object_r:dump_sensors_exec:s0 -/vendor/bin/usf_stats u:object_r:vendor_usf_stats:s0 -/vendor/bin/usf_reg_edit u:object_r:vendor_usf_reg_edit:s0 - -# Sensor registry persist files. -/mnt/vendor/persist/sensors/registry(/.*)? u:object_r:persist_sensor_reg_file:s0 - -# Sensor registry data files. -/data/vendor/sensors/registry(/.*)? u:object_r:sensor_reg_data_file:s0 - -# Sensor debug data files. -/data/vendor/sensors/debug(/.*)? u:object_r:sensor_debug_data_file:s0 diff --git a/sensors/sepolicy/hal_sensors_default.te b/sensors/sepolicy/hal_sensors_default.te deleted file mode 100644 index 846b016..0000000 --- a/sensors/sepolicy/hal_sensors_default.te +++ /dev/null @@ -1,73 +0,0 @@ -# -# USF sensor HAL SELinux type enforcements. -# - -# Allow reading of sensor registry persist files. -allow hal_sensors_default mnt_vendor_file:dir search; -allow hal_sensors_default persist_file:dir search; -allow hal_sensors_default persist_file:file r_file_perms; -r_dir_file(hal_sensors_default, persist_sensor_reg_file) - -# Allow creation and writing of sensor registry data files. -allow hal_sensors_default sensor_reg_data_file:dir rw_dir_perms; -allow hal_sensors_default sensor_reg_data_file:file create_file_perms; - -userdebug_or_eng(` - # Allow creation and writing of sensor debug data files. - allow hal_sensors_default sensor_debug_data_file:dir rw_dir_perms; - allow hal_sensors_default sensor_debug_data_file:file create_file_perms; -') - -# Allow access to the AoC communication driver. -allow hal_sensors_default aoc_device:chr_file rw_file_perms; - -# Allow access to the AoC clock and kernel boot time sys FS node. This is needed -# to synchronize the AP and AoC clock timestamps. -allow hal_sensors_default sysfs_aoc_boottime:file rw_file_perms; - -# Allow access to the sysfs_aoc. -allow hal_sensors_default sysfs_aoc:dir search; -allow hal_sensors_default sysfs_aoc:file r_file_perms; - -# Allow sensor HAL to reset AOC. -allow hal_sensors_default sysfs_aoc_reset:file rw_file_perms; - -# Allow sensor HAL to read AoC dumpstate. -allow hal_sensors_default sysfs_aoc_dumpstate:file r_file_perms; - -# Allow access for AoC properties. -get_prop(hal_sensors_default, vendor_aoc_prop) - -# Allow create thread to watch AOC's device. -allow hal_sensors_default device:dir r_dir_perms; - -# Allow access to sensor service for sensor_listener. -binder_call(hal_sensors_default, system_server); - -# Allow use of the USF low latency transport. -usf_low_latency_transport(hal_sensors_default) - -# Allow sensor HAL to access to display sysfs. -allow hal_sensors_default sysfs_display:file r_file_perms; - -# Allow display_info_service access to the backlight driver. -allow hal_sensors_default sysfs_leds:dir search; -allow hal_sensors_default sysfs_leds:file rw_file_perms; - -# Allow SensorSuez to connect AIDL stats. -binder_use(hal_sensors_default); -allow hal_sensors_default fwk_stats_service:service_manager find; - -# Allow access to CHRE socket to connect to nanoapps. -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. -r_dir_file(hal_sensors_default, sysfs_batteryinfo) diff --git a/sensors/sepolicy/te_macros b/sensors/sepolicy/te_macros deleted file mode 100644 index 01ac13c..0000000 --- a/sensors/sepolicy/te_macros +++ /dev/null @@ -1,14 +0,0 @@ -# -# USF SELinux type enforcement macros. -# - -# -# usf_low_latency_transport(domain) -# -# Allows domain use of the USF low latency transport. -# -define(`usf_low_latency_transport', ` - allow $1 hal_graphics_mapper_hwservice:hwservice_manager find; - hal_client_domain($1, hal_graphics_allocator) -') - diff --git a/sepolicy/Android.bp b/sepolicy/Android.bp deleted file mode 100644 index be5970c..0000000 --- a/sepolicy/Android.bp +++ /dev/null @@ -1,11 +0,0 @@ -se_flags { - name: "usb_udc_sysfs_selinux_flags", - flags: ["RELEASE_USB_UDC_SYSFS_SELINUX_POLICY_ENABLED"], - export_to: ["all_selinux_flags"], -} - -se_flags { - name: "pixel_selinux_flags", - flags: ["RELEASE_PIXEL_MALI_SEPOLICY_ENABLED"], - export_to: ["all_selinux_flags"], -} diff --git a/sepolicy/OWNERS b/sepolicy/OWNERS deleted file mode 100644 index aab78ab..0000000 --- a/sepolicy/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -include platform/system/sepolicy:/OWNERS - -wilsonsung@google.com -rurumihong@google.com - diff --git a/sepolicy/README.txt b/sepolicy/README.txt deleted file mode 100644 index d1ad3e6..0000000 --- a/sepolicy/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This folder holds content for pixel sepolicy operations. Device sepolicy like -file.te, file_contexts will not live in here. diff --git a/soc/Android.bp b/soc/Android.bp deleted file mode 100644 index e81f567..0000000 --- a/soc/Android.bp +++ /dev/null @@ -1,35 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_devfreq", - srcs: ["dump_devfreq.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} - -cc_binary { - name: "dump_soc", - srcs: ["dump_soc.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/soc/dump_devfreq.cpp b/soc/dump_devfreq.cpp deleted file mode 100644 index da91a62..0000000 --- a/soc/dump_devfreq.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include - -const char* dvfs_paths[][2] = { - {"MIF DVFS", "/sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/trans_stat"}, - {"INT DVFS", "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/trans_stat"}, - {"INTCAM DVFS", "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/trans_stat"}, - {"DISP DVFS", "/sys/devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp/trans_stat"}, - {"CAM DVFS", "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam/trans_stat"}, - {"TNR DVFS", "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr/trans_stat"}, - {"MFC DVFS", "/sys/devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc/trans_stat"}, - {"BO DVFS", "/sys/devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo/trans_stat"}, - {"BW DVFS", "/sys/devices/platform/17000080.devfreq_bw/devfreq/17000080.devfreq_bw/trans_stat"}, - {"DSU DVFS", "/sys/devices/platform/17000090.devfreq_dsu/devfreq/17000090.devfreq_dsu/trans_stat"}, - {"BCI DVFS", "/sys/devices/platform/170000a0.devfreq_bci/devfreq/170000a0.devfreq_bci/trans_stat"}, - {"BTS stats", "/sys/devices/platform/exynos-bts/bts_stats"} -}; -int main() { - - for (auto &dvfs_path : dvfs_paths ) { - if(!access(dvfs_path[1], R_OK)) { - dumpFileContent(dvfs_path[0], dvfs_path[1]); - } - } - return 0; -} diff --git a/soc/dump_soc.cpp b/soc/dump_soc.cpp deleted file mode 100644 index ab3ac2d..0000000 --- a/soc/dump_soc.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 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. - */ -#include -#include -#include -#include -#include -#include - -std::string readFile(const std::string& file_path) { - std::string content; - if(android::base::ReadFileToString(file_path.c_str(), &content)) { - return std::regex_replace(content, std::regex("\\r\\n|\\r|\\n"),""); - } - return content; -} - -// Dump chip ID. -int main() { - dumpFileContent("AP HW TUNE", "/sys/devices/system/chip-id/ap_hw_tune_str"); - dumpFileContent("DVFS VERSION", "/sys/devices/system/chip-id/dvfs_version"); - dumpFileContent("EVT VERSION", "/sys/devices/system/chip-id/evt_ver"); - dumpFileContent("LOT ID", "/sys/devices/system/chip-id/lot_id"); - dumpFileContent("PACKAGE", "/sys/devices/system/chip-id/pkg_revision"); - dumpFileContent("PRODUCT ID", "/sys/devices/system/chip-id/product_id"); - dumpFileContent("REVISION", "/sys/devices/system/chip-id/revision"); - dumpFileContent("RAW STR", "/sys/devices/system/chip-id/raw_str"); - dumpFileContent("CPU present", "/sys/devices/system/cpu/present"); - dumpFileContent("CPU online", "/sys/devices/system/cpu/online"); - - printf("------ CPU time-in-state ------\n"); - std::string states; - std::unique_ptr cpudir(opendir("/sys/devices/system/cpu/"), closedir); - if (!cpudir) { - ALOGE("Fail To Open Dir /sys/devices/system/cpu/"); - return 0; - } - dirent *entry; - while ((entry = readdir(cpudir.get())) != nullptr) { - std::string core(entry->d_name); - if (core.find("cpu") != std::string::npos) { - std::string path("/sys/devices/system/cpu/" + core + "/cpufreq/stats/time_in_state"); - if(!access(path.c_str(), R_OK)){ - dumpFileContent(path.c_str(), path.c_str()); - } - } - std::string cpu_idle_path("/sys/devices/system/cpu/" + core + "/cpuidle"); - std::unique_ptr statedir(opendir(cpu_idle_path.c_str()), closedir); - if (!statedir) { - continue; - } - dirent *state_entry; - while ((state_entry = readdir(statedir.get())) != nullptr) { - std::string cpu_idle_state_path(state_entry->d_name); - std::string full_state_path; - full_state_path += cpu_idle_path; - full_state_path += "/"; - full_state_path += cpu_idle_state_path; - if (cpu_idle_state_path.find("state") != std::string::npos) { - std::string name(full_state_path + "/name"); - std::string desc(full_state_path + "/desc"); - std::string time(full_state_path + "/time"); - std::string usage(full_state_path + "/usage"); - states += full_state_path+": "+readFile(name)+" "+readFile(desc)+" "+readFile(time)+" "+readFile(usage)+"\n"; - } - } - } - printf("------ CPU cpuidle ------\n%s\n", states.c_str()); - - dumpFileContent("INTERRUPTS", "/proc/interrupts"); - return 0; -} diff --git a/soc/freq.mk b/soc/freq.mk deleted file mode 100644 index bd79977..0000000 --- a/soc/freq.mk +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/soc/sepolicy/freq - -PRODUCT_PACKAGES += dump_devfreq - diff --git a/soc/sepolicy/freq/dump_devfreq.te b/soc/sepolicy/freq/dump_devfreq.te deleted file mode 100644 index 75aa325..0000000 --- a/soc/sepolicy/freq/dump_devfreq.te +++ /dev/null @@ -1,5 +0,0 @@ -pixel_bugreport(dump_devfreq) -allow dump_devfreq sysfs_cpu:file r_file_perms; -allow dump_devfreq sysfs_exynos_bts:dir r_dir_perms; -allow dump_devfreq sysfs_exynos_bts_stats:file r_file_perms; - diff --git a/soc/sepolicy/freq/file.te b/soc/sepolicy/freq/file.te deleted file mode 100644 index 1201d5a..0000000 --- a/soc/sepolicy/freq/file.te +++ /dev/null @@ -1,4 +0,0 @@ -type sysfs_cpu, sysfs_type, fs_type; -type sysfs_exynos_bts, sysfs_type, fs_type; -type sysfs_exynos_bts_stats, sysfs_type, fs_type; - diff --git a/soc/sepolicy/freq/file_contexts b/soc/sepolicy/freq/file_contexts deleted file mode 100644 index b1f5b4f..0000000 --- a/soc/sepolicy/freq/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_devfreq u:object_r:dump_devfreq_exec:s0 - diff --git a/soc/sepolicy/freq/genfs_contexts b/soc/sepolicy/freq/genfs_contexts deleted file mode 100644 index 7795c12..0000000 --- a/soc/sepolicy/freq/genfs_contexts +++ /dev/null @@ -1,31 +0,0 @@ -# CPU -genfscon sysfs /devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000080.devfreq_bw/devfreq/17000080.devfreq_bw/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000090.devfreq_dsu/devfreq/17000090.devfreq_dsu/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/170000a0.devfreq_bci/devfreq/170000a0.devfreq_bci/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000080.devfreq_bw/devfreq/17000080.devfreq_bw/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/17000090.devfreq_dsu/devfreq/17000090.devfreq_dsu/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/170000a0.devfreq_bci/devfreq/170000a0.devfreq_bci/trans_stat u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/1f000000.mali/time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/1f000000.mali/uid_time_in_state u:object_r:sysfs_cpu:s0 -genfscon sysfs /devices/platform/cpupm/cpupm/time_in_state u:object_r:sysfs_cpu:s0 - -# Exynos -genfscon sysfs /devices/platform/exynos-bts u:object_r:sysfs_exynos_bts:s0 -genfscon sysfs /devices/platform/exynos-bts/bts_stats u:object_r:sysfs_exynos_bts_stats:s0 - diff --git a/soc/sepolicy/soc/dump_memory.te b/soc/sepolicy/soc/dump_memory.te deleted file mode 100644 index 7502f3a..0000000 --- a/soc/sepolicy/soc/dump_memory.te +++ /dev/null @@ -1,14 +0,0 @@ -pixel_bugreport(dump_memory) -allow dump_memory vendor_toolbox_exec:file execute_no_trans; -userdebug_or_eng(` - allow dump_memory vendor_dmabuf_debugfs:file r_file_perms; - allow dump_memory vendor_page_pinner_debugfs:dir r_dir_perms; - allow dump_memory vendor_page_pinner_debugfs:file r_file_perms; - allow dump_memory vendor_cma_debugfs:dir r_dir_perms; - allow dump_memory vendor_cma_debugfs:file r_file_perms; - allow dump_memory debugfs_tracing_instances:dir search; - allow dump_memory debugfs_tracing_instances:file r_file_perms; - allow dump_memory sysfs_pixel_stat:dir r_dir_perms; - allow dump_memory sysfs_pixel_stat:file r_file_perms; -') - diff --git a/soc/sepolicy/soc/dump_soc.te b/soc/sepolicy/soc/dump_soc.te deleted file mode 100644 index b103de4..0000000 --- a/soc/sepolicy/soc/dump_soc.te +++ /dev/null @@ -1,2 +0,0 @@ -pixel_bugreport(dump_soc) -allow dump_soc sysfs_chip_id:file r_file_perms; diff --git a/soc/sepolicy/soc/dumpstate.te b/soc/sepolicy/soc/dumpstate.te deleted file mode 100644 index 1d23bb4..0000000 --- a/soc/sepolicy/soc/dumpstate.te +++ /dev/null @@ -1,2 +0,0 @@ -dontaudit dumpstate vendor_dmabuf_debugfs:file r_file_perms; - diff --git a/soc/sepolicy/soc/file.te b/soc/sepolicy/soc/file.te deleted file mode 100644 index 63b579d..0000000 --- a/soc/sepolicy/soc/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type vendor_dmabuf_debugfs, fs_type, debugfs_type; -type vendor_page_pinner_debugfs, fs_type, debugfs_type; -type vendor_cma_debugfs, fs_type, debugfs_type; diff --git a/soc/sepolicy/soc/file_contexts b/soc/sepolicy/soc/file_contexts deleted file mode 100644 index 5adc605..0000000 --- a/soc/sepolicy/soc/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/bin/dump/dump_soc u:object_r:dump_soc_exec:s0 -/vendor/bin/dump/dump_memory u:object_r:dump_memory_exec:s0 - diff --git a/soc/sepolicy/soc/genfs_contexts b/soc/sepolicy/soc/genfs_contexts deleted file mode 100644 index bba996d..0000000 --- a/soc/sepolicy/soc/genfs_contexts +++ /dev/null @@ -1,12 +0,0 @@ -genfscon sysfs /devices/system/chip-id/ap_hw_tune_str u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/dvfs_version u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/evt_ver u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/lot_id u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/pkg_revision u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/product_id u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/revision u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/raw_str u:object_r:sysfs_chip_id:s0 - -genfscon debugfs /dma_buf/bufinfo u:object_r:vendor_dmabuf_debugfs:s0 -genfscon debugfs /page_pinner u:object_r:vendor_page_pinner_debugfs:s0 -genfscon debugfs /cma u:object_r:vendor_cma_debugfs:s0 diff --git a/soc/soc.mk b/soc/soc.mk deleted file mode 100644 index 05618f1..0000000 --- a/soc/soc.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/soc/sepolicy/soc - -PRODUCT_PACKAGES += dump_soc diff --git a/sota_app/factoryota-watch.mk b/sota_app/factoryota-watch.mk deleted file mode 100644 index 3107a1c..0000000 --- a/sota_app/factoryota-watch.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_PACKAGES += \ - FactoryOtaWearPrebuilt - -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/sota_app/sepolicy/system_ext diff --git a/sota_app/factoryota.mk b/sota_app/factoryota.mk deleted file mode 100644 index 14ed2b5..0000000 --- a/sota_app/factoryota.mk +++ /dev/null @@ -1,4 +0,0 @@ -PRODUCT_PACKAGES += \ - FactoryOtaPrebuilt - -SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/sota_app/sepolicy/system_ext diff --git a/sota_app/sepolicy/system_ext/factory_ota_app.te b/sota_app/sepolicy/system_ext/factory_ota_app.te deleted file mode 100644 index f48adeb..0000000 --- a/sota_app/sepolicy/system_ext/factory_ota_app.te +++ /dev/null @@ -1,32 +0,0 @@ -type factory_ota_app, domain, coredomain; - -app_domain(factory_ota_app) -net_domain(factory_ota_app) - -# Write to /data/ota_package for OTA packages. -# Factory OTA client will download OTA image into ota_package folder and unzip it. -# Than Update engine could use it to execute OTA process. -# So Factory OTA client need read / write and create file access right for this folder -allow factory_ota_app ota_package_file:dir rw_dir_perms; -allow factory_ota_app ota_package_file:file create_file_perms; - -# Properties -# For write system property persist.* -set_prop(factory_ota_app, sota_prop); - -# Services -# For get access WiFi manager service and activity service -allow factory_ota_app app_api_service:service_manager find; -# Allow Factory OTA to call Update Engine -binder_call(factory_ota_app, update_engine) -# Allow Update Engine to call the Factory OTA callback -binder_call(update_engine, factory_ota_app) -#For access update engine function -allow factory_ota_app update_engine_service:service_manager find; -#For disable NFC wake up device feature -allow factory_ota_app nfc_service:service_manager find; -#For get device IMEI -allow factory_ota_app radio_service:service_manager find; - -# For suppress more GPU service sepolicy error log. -dontaudit factory_ota_app gpuservice:binder call; diff --git a/sota_app/sepolicy/system_ext/property_contexts b/sota_app/sepolicy/system_ext/property_contexts deleted file mode 100644 index deb34dc..0000000 --- a/sota_app/sepolicy/system_ext/property_contexts +++ /dev/null @@ -1,5 +0,0 @@ -ro.boot.sota u:object_r:sota_prop:s0 -ro.boot.sota. u:object_r:sota_prop:s0 -persist.vendor.factoryota. u:object_r:sota_prop:s0 -persist.vendor.radio.bootwithlpm u:object_r:sota_prop:s0 -persist.vendor.nfc.factoryota. u:object_r:sota_prop:s0 diff --git a/sota_app/sepolicy/system_ext/seapp_contexts b/sota_app/sepolicy/system_ext/seapp_contexts deleted file mode 100644 index 673f451..0000000 --- a/sota_app/sepolicy/system_ext/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Factory OTA -user=_app seinfo=platform name=com.google.android.factoryota domain=factory_ota_app levelFrom=all diff --git a/sota_app/sepolicy/system_ext/vendor_init.te b/sota_app/sepolicy/system_ext/vendor_init.te deleted file mode 100644 index 11191e3..0000000 --- a/sota_app/sepolicy/system_ext/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, sota_prop) diff --git a/storage/Android.bp b/storage/Android.bp deleted file mode 100644 index eb806bc..0000000 --- a/storage/Android.bp +++ /dev/null @@ -1,28 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary { - name: "dump_storage", - srcs: ["dump_storage.cpp"], - init_rc: ["init.storage.rc"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libdump", - "liblog", - ], - vendor: true, - relative_install_path: "dump", -} - -sh_binary { - name: "storage_intelligence.sh", - src: "storage_intelligence.sh", - init_rc: ["storage.intelligence.rc"], - vendor: true, -} diff --git a/storage/dump_storage.cpp b/storage/dump_storage.cpp deleted file mode 100644 index b324723..0000000 --- a/storage/dump_storage.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define F2FS_FSCK_TIME_PROPERTY "ro.boottime.init.fsck.data" -#define F2FS_MNT_TIME_PROPERTY "ro.boottime.init.mount.data" -#define BUILD_TYPE_PROPERTY "ro.build.type" - -void read_buffer(int buf_id, int total_len, const char* path) -{ - int i, len; - system("mkdir -m 0770 -p /data/vendor/storage/"); - auto cmd = android::base::StringPrintf("rm -f /data/vendor/storage/%s\n", path); - system(cmd.c_str()); - - for (i=0;i<=total_len;i+=524288) { - if (total_len-i < 524288) { - len = total_len-i; - printf("/vendor/bin/sg_read_buffer -m 0x1c -i %d -l %d -o %d -r /dev/sg3 >> /data/vendor/storage/%s\n", - buf_id, len, i, path); - auto cmd = android::base::StringPrintf( - "/vendor/bin/sg_read_buffer -m 0x1c -i %d -l %d -o %d -r /dev/sg3 >> /data/vendor/storage/%s\n", - buf_id, len, i, path); - system(cmd.c_str()); - break; - } - len = 524288; - printf("/vendor/bin/sg_read_buffer -m 0x1c -i %d -l %d -o %d -r /dev/sg3 >> /data/vendor/storage/%s\n", - buf_id, len, i, path); - auto cmd = android::base::StringPrintf( - "/vendor/bin/sg_read_buffer -m 0x1c -i %d -l %d -o %d -r /dev/sg3 >> /data/vendor/storage/%s\n", - buf_id, len, i, path); - system(cmd.c_str()); - } -} - -int main() { - //F2FS - dumpFileContent("F2FS status", "/sys/kernel/debug/f2fs/status"); - dumpFileContent("F2FS fsck", "/dev/fscklogs/fsck"); - - int fsck_time = android::base::GetIntProperty(F2FS_FSCK_TIME_PROPERTY, 0); - printf("--- F2FS - fsck time (ms) ---\n%d\n\n", fsck_time); - int mnt_time = android::base::GetIntProperty(F2FS_MNT_TIME_PROPERTY, 0); - printf("--- F2FS - checkpoint=disable time (ms) ---\n%d\n\n", mnt_time); - - const std::string f2fs_proc_path("/proc/fs/f2fs/"); - std::unique_ptr procdir( - opendir(f2fs_proc_path.c_str()), closedir); - if (procdir) { - dirent *proc_entry; - while ((proc_entry = readdir(procdir.get())) != nullptr) { - std::string proc_name(proc_entry->d_name); - if (proc_name == "." || proc_name == ".." || - strncmp(proc_name.c_str(), "dm-", 3)) - continue; - dumpFileContent(("F2FS - " + proc_name).c_str(), - (f2fs_proc_path + proc_name + "/disk_map").c_str()); - } - } - - //UFS - dumpFileContent("UFS model", "/sys/block/sda/device/model"); - dumpFileContent("UFS rev", "/sys/block/sda/device/rev"); - dumpFileContent("UFS size", "/sys/block/sda/size"); - - dumpFileContent("UFS phy version", - "/dev/sys/block/bootdevice/pixel/phy_version"); - dumpFileContent("UFS phy release_date", - "/dev/sys/block/bootdevice/pixel/phy_release_date"); - - dumpFileContent("UFS Slow IO Read", - "/dev/sys/block/bootdevice/slowio_read_cnt"); - dumpFileContent("UFS Slow IO Write", - "/dev/sys/block/bootdevice/slowio_write_cnt"); - dumpFileContent("UFS Slow IO Unmap", - "/dev/sys/block/bootdevice/slowio_unmap_cnt"); - dumpFileContent("UFS Slow IO Sync", - "/dev/sys/block/bootdevice/slowio_sync_cnt"); - - printf("------ UFS err_stats ------\n"); - const std::string ufs_err_stats_path( - "/dev/sys/block/bootdevice/err_stats/"); - std::unique_ptr statdir( - opendir(ufs_err_stats_path.c_str()), closedir); - if (statdir) { - dirent *stat_entry; - while ((stat_entry = readdir(statdir.get())) != nullptr) { - std::string stat_name(stat_entry->d_name); - if (stat_name == "." || stat_name == "..") continue; - dumpFileContent(stat_name.c_str(), - (ufs_err_stats_path + stat_name).c_str()); - } - } - - printf("\n------ UFS io_stats ------\n"); - printf("\t\t%-12s %-12s %-12s %-12s %-12s %-12s\n", "ReadCnt", "ReadBytes", - "WriteCnt", "WriteBytes", "RWCnt", "RWBytes"); - const std::string ufs_io_stats = "/dev/sys/block/bootdevice/io_stats/"; - const std::string iostats_seq[3] = {"_start", "_complete", "_maxdiff"}; - const std::string iostats[6] = {"rcnt", "rbyte", "wcnt", "wbyte", "rwcnt", - "rwbyte"}; - - for (int i = 0; i < 3; i++) { - const std::string header[3] = {"Started: \t", "Completed: \t", - "MaxDiff: \t"}; - printf("%s", header[i].c_str()); - for (int j = 0; j < 6; j++) { - std::string iostat_path = ufs_io_stats.c_str(); - iostat_path.append(iostats[j].c_str()); - iostat_path.append(iostats_seq[i].c_str()); - std::ifstream io_stats_file(iostat_path.c_str()); - unsigned long io_stat_atom = 0; - if (io_stats_file.is_open()) { - io_stats_file >> io_stat_atom; - printf("%-12lu ", io_stat_atom); - io_stats_file.close(); - } - } - printf("\n"); - } - - printf("\n------ UFS req_stats ------\n"); - printf("\t%-12s %-12s %-12s %-12s %-12s %-12s\n", "All", "Write", "Read", - "Security", "Flush", "Discard"); - const std::string ufs_req_stats = "/dev/sys/block/bootdevice/req_stats/"; - const std::string reqstats_seq[4] = {"_min", "_max", "_avg", "_sum"}; - const std::string reqstats[6] = {"all", "write", "read", "security", - "flush", "discard"}; - - for (int i = 0; i < 4; i++) { - const std::string header[4] = {"Min:\t", "Max: \t", "Avg: \t", - "Count: \t"}; - printf("%s", header[i].c_str()); - for (int j = 0; j < 6; j++) { - std::string reqstat_path = ufs_req_stats.c_str(); - reqstat_path.append(reqstats[j].c_str()); - reqstat_path.append(reqstats_seq[i].c_str()); - std::ifstream req_stats_file(reqstat_path.c_str()); - unsigned long req_stat_atom = 0; - if (req_stats_file.is_open()) { - req_stats_file >> req_stat_atom; - printf("%-12lu ", req_stat_atom); - req_stats_file.close(); - } - } - printf("\n"); - } - - printf("\n------ UFS health ------\n"); - dumpFileContent( - "", - "/dev/sys/block/bootdevice/health_descriptor/life_time_estimation_a"); - dumpFileContent( - "", - "/dev/sys/block/bootdevice/health_descriptor/life_time_estimation_b"); - dumpFileContent("", "/dev/sys/block/bootdevice/health_descriptor/eol_info"); - dumpFileContent( - "", - "/dev/sys/block/bootdevice/health_descriptor/life_time_estimation_c"); - - printf("\n------ UFS error history ------\n"); - std::string build_type = android::base::GetProperty(BUILD_TYPE_PROPERTY, ""); - if (build_type == "eng") { - std::string sg_read_buffer = "/vendor/bin/sg_read_buffer"; - std::ifstream sg_read_buffer_file(sg_read_buffer.c_str()); - if (sg_read_buffer_file.is_open()) { - const std::string ufs_ver_path( - "/dev/sys/block/bootdevice/device_descriptor/specification_version"); - std::ifstream ufs_ver_file(ufs_ver_path); - std::string ufs_ver; - if (ufs_ver_file.is_open()) { - ufs_ver_file >> ufs_ver; - ufs_ver_file.close(); - } - if (strcmp(ufs_ver.c_str(), "0x0210")) { - const std::string ufs_brand_path("/sys/block/sda/device/vendor"); - std::ifstream ufs_brand_file(ufs_brand_path); - std::string ufs_brand; - if (ufs_brand_file.is_open()) { - ufs_brand_file >> ufs_brand; - ufs_brand_file.close(); - } - - std::map const table = - { - {"MICRON", 0x12C}, - {"KIOXIA", 0x198}, - {"SKhynix", 0x1AD}, - {"SAMSUNG", 0x1CE} - }; - auto ufs_vendor_id = table.find(ufs_brand); - if (ufs_vendor_id != table.end()) { - switch(ufs_vendor_id->second){ - case 0x12C: //MICRON - read_buffer(16, 2097152, "micron_10_ufs_err_history.dat"); - read_buffer(18, 10485760, "micron_12_ufs_err_history.dat"); - read_buffer(19, 10485760, "micron_13_ufs_err_history.dat"); - break; - case 0x198: //KIOXIA - read_buffer(16, 16773120, "kioxia_10_ufs_err_history.dat"); - read_buffer(17, 2097152, "kioxia_11_ufs_err_history.dat"); - read_buffer(18, 131072, "kioxia_12_ufs_err_history.dat"); - break; - case 0x1AD: //SKhynix - if (!strcmp(ufs_ver.c_str(), "0x0310")) { - read_buffer(0, 4096, "skhynix_00_ufs_err_history.dat"); - read_buffer(16, 131072, "skhynix_10_ufs_err_history.dat"); - read_buffer(17, 131072, "skhynix_11_ufs_err_history.dat"); - read_buffer(18, 131072, "skhynix_12_ufs_err_history.dat"); - read_buffer(19, 131072, "skhynix_13_ufs_err_history.dat"); - } else { - read_buffer(0, 4096, "skhynix_00_ufs_err_history.dat"); - read_buffer(16, 8388608, "skhynix_10_ufs_err_history.dat"); - read_buffer(17, 8388608, "skhynix_11_ufs_err_history.dat"); - } - break; - case 0x1CE: //SAMSUNG - if (!strcmp(ufs_ver.c_str(), "0x0310")) - read_buffer(16, 8404992, "samsung_10_ufs_err_history.dat"); - else - read_buffer(16, 12599296, "samsung_10_ufs_err_history.dat"); - break; - default: - break; - } - } - sg_read_buffer_file.close(); - } - } else - printf("sg_read_buffer does not exist\n"); - } - - return 0; -} diff --git a/storage/init.storage.rc b/storage/init.storage.rc deleted file mode 100644 index a7edf23..0000000 --- a/storage/init.storage.rc +++ /dev/null @@ -1,77 +0,0 @@ -on init - # Make foreground and background I/O priority different. none-to-rt was - # introduced in kernel 5.14. promote-to-rt was introduced in kernel 6.5. - # Write none-to-rt first and promote-to-rt next to support both older and - # newer kernel versions. - write /dev/blkio/blkio.prio.class none-to-rt - write /dev/blkio/blkio.prio.class promote-to-rt - -on property:ro.build.type=eng - write /dev/sys/block/bootdevice/pixel/enable_pixel_ufs_logging 1 - 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 - write /dev/sys/fs/by-name/userdata/max_io_bytes 524288 - write /dev/sys/fs/by-name/userdata/min_hot_blocks 0 - - # 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 - write /dev/sys/block/by-name/zoned_device/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 /dev/sys/block/by-name/rootdisk/queue/nr_requests 256 - - # UFS - write /dev/sys/block/bootdevice/clkgate_enable 0 - write /dev/sys/block/bootdevice/wb_on 0 - write /dev/sys/block/bootdevice/enable_wb_buf_flush 0 - -on property:sys.boot_completed=1 - # Health Storage HAL - chown system system /dev/sys/block/bootdevice/manual_gc - write /dev/sys/block/bootdevice/manual_gc 0 - - # Power HAL access - chmod 0664 /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 diff --git a/storage/sepolicy/charger_vendor.te b/storage/sepolicy/charger_vendor.te deleted file mode 100644 index 62a7661..0000000 --- a/storage/sepolicy/charger_vendor.te +++ /dev/null @@ -1,3 +0,0 @@ -# fork from dcb05d13 -allow charger_vendor sysfs_scsi_devices_0000:file r_file_perms; - diff --git a/storage/sepolicy/device.te b/storage/sepolicy/device.te deleted file mode 100644 index 1252ee0..0000000 --- a/storage/sepolicy/device.te +++ /dev/null @@ -1,11 +0,0 @@ -# Userdata Exp block device. -type userdata_exp_block_device, dev_type; - -# Block Devices -type persist_block_device, dev_type; -type efs_block_device, dev_type; -type modem_userdata_block_device, dev_type; - -# Storage firmware upgrade -type ufs_internal_block_device, dev_type; - diff --git a/storage/sepolicy/dump_storage.te b/storage/sepolicy/dump_storage.te deleted file mode 100644 index 67c4b9a..0000000 --- a/storage/sepolicy/dump_storage.te +++ /dev/null @@ -1,33 +0,0 @@ -# adb bugreport -pixel_bugreport(dump_storage) - -# adb bugreport -allow dump_storage sysfs_scsi_devices_0000:dir r_dir_perms; -allow dump_storage sysfs_scsi_devices_0000:file r_file_perms; -allow dump_storage sysfs:file r_file_perms; - -allow dump_storage proc_f2fs:dir r_dir_perms; -allow dump_storage proc_f2fs:file r_file_perms; - -# adb bugreport -userdebug_or_eng(` - allow dump_storage debugfs_f2fs:dir r_dir_perms; - allow dump_storage debugfs_f2fs:file r_file_perms; - allow dump_storage sg_device:chr_file rw_file_perms; - allow dump_storage proc:file r_file_perms; - allow dump_storage vendor_shell_exec:file execute_no_trans; - allow dump_storage vendor_toolbox_exec:file execute_no_trans; - allow dump_storage sg_util_exec:file execute_no_trans; - allow dump_storage vendor_data_file:dir create_dir_perms; - allow dump_storage vendor_data_file:file create_file_perms; - allow dump_storage dump_storage_data_file:dir rw_dir_perms; - allow dump_storage dump_storage_data_file:file create_file_perms; -') - -# adb bugreport -get_prop(dump_storage, boottime_public_prop) - -# adb bugreport -dontaudit dump_storage debugfs_f2fs:dir r_dir_perms; -dontaudit dump_storage debugfs_f2fs:file r_file_perms; - diff --git a/storage/sepolicy/dumpstate.te b/storage/sepolicy/dumpstate.te deleted file mode 100644 index 2220870..0000000 --- a/storage/sepolicy/dumpstate.te +++ /dev/null @@ -1,7 +0,0 @@ -# adb bugreport -allow dumpstate sysfs_scsi_devices_0000:file r_file_perms; -allow dumpstate persist_file:dir { getattr }; -allow dumpstate modem_efs_file:dir { getattr }; -allow dumpstate modem_userdata_file:dir { getattr }; -allow dumpstate vold:binder { call }; - diff --git a/storage/sepolicy/e2fs.te b/storage/sepolicy/e2fs.te deleted file mode 100644 index 92ff839..0000000 --- a/storage/sepolicy/e2fs.te +++ /dev/null @@ -1,10 +0,0 @@ -# fix mkfs -allow e2fs userdata_exp_block_device:blk_file rw_file_perms; -allow e2fs efs_block_device:blk_file rw_file_perms; -allow e2fs modem_userdata_block_device:blk_file rw_file_perms; -allowxperm e2fs { persist_block_device efs_block_device modem_userdata_block_device }:blk_file ioctl { - BLKSECDISCARD BLKDISCARD BLKPBSZGET BLKDISCARDZEROES BLKROGET -}; -allow e2fs sysfs_scsi_devices_0000:dir r_dir_perms; -allow e2fs sysfs_scsi_devices_0000:file r_file_perms; - diff --git a/storage/sepolicy/fastbootd.te b/storage/sepolicy/fastbootd.te deleted file mode 100644 index e571d0b..0000000 --- a/storage/sepolicy/fastbootd.te +++ /dev/null @@ -1,3 +0,0 @@ -# fastbootd -allow fastbootd devpts:chr_file rw_file_perms; - diff --git a/storage/sepolicy/file.te b/storage/sepolicy/file.te deleted file mode 100644 index 59b739d..0000000 --- a/storage/sepolicy/file.te +++ /dev/null @@ -1,8 +0,0 @@ -# file.te -type debugfs_f2fs, debugfs_type, fs_type; -type dump_storage_data_file, file_type, data_file_type; -type sg_device, dev_type; -type sg_util_exec, exec_type, vendor_file_type, file_type; - -# Intelligence Service -type intelligence_data_file, file_type, data_file_type; diff --git a/storage/sepolicy/file_contexts b/storage/sepolicy/file_contexts deleted file mode 100644 index 18527fb..0000000 --- a/storage/sepolicy/file_contexts +++ /dev/null @@ -1,13 +0,0 @@ -# storage -/data/vendor/intelligence(/.*)? u:object_r:intelligence_data_file:s0 -/data/vendor/storage(/.*)? u:object_r:dump_storage_data_file:s0 - -/dev/block/by-name/userdata_exp.* u:object_r:userdata_exp_block_device:s0 -/dev/sg[0-9] u:object_r:sg_device:s0 - -/sys/devices/platform/[0-9a-z]+\.ufs/pixel/enable_pixel_ufs_logging u:object_r:sysfs_scsi_devices_0000:s0 - -/vendor/bin/dump/dump_storage u:object_r:dump_storage_exec:s0 -/vendor/bin/sg_read_buffer u:object_r:sg_util_exec:s0 -/vendor/bin/storage_intelligence\.sh u:object_r:storage_intelligence_exec:s0 -/vendor/bin/ufs_firmware_update\.sh u:object_r:ufs_firmware_update_exec:s0 diff --git a/storage/sepolicy/fsck.te b/storage/sepolicy/fsck.te deleted file mode 100644 index 6502995..0000000 --- a/storage/sepolicy/fsck.te +++ /dev/null @@ -1,8 +0,0 @@ -# fix fsck -allow fsck userdata_exp_block_device:blk_file rw_file_perms; -allow fsck efs_block_device:blk_file rw_file_perms; -allow fsck modem_userdata_block_device:blk_file rw_file_perms; -allow fsck sysfs_scsi_devices_0000:dir r_dir_perms; -allow fsck sysfs_scsi_devices_0000:file r_file_perms; -allow fsck persist_block_device:blk_file rw_file_perms; - diff --git a/storage/sepolicy/genfs_contexts b/storage/sepolicy/genfs_contexts deleted file mode 100644 index 69baae6..0000000 --- a/storage/sepolicy/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# f2fs -genfscon debugfs /f2fs u:object_r:debugfs_f2fs:s0 - diff --git a/storage/sepolicy/hal_health_default.te b/storage/sepolicy/hal_health_default.te deleted file mode 100644 index 49bf50c..0000000 --- a/storage/sepolicy/hal_health_default.te +++ /dev/null @@ -1,3 +0,0 @@ -# dumpsys android.hardware.power.stats.IPowerStats/default -r_dir_file(hal_health_default, sysfs_scsi_devices_0000) - diff --git a/storage/sepolicy/hal_health_storage_default.te b/storage/sepolicy/hal_health_storage_default.te deleted file mode 100644 index 20a3b7d..0000000 --- a/storage/sepolicy/hal_health_storage_default.te +++ /dev/null @@ -1,4 +0,0 @@ -# Access to /sys/devices/platform/*ufs/* -allow hal_health_storage_default sysfs_scsi_devices_0000:dir r_dir_perms; -allow hal_health_storage_default sysfs_scsi_devices_0000:file rw_file_perms; - diff --git a/storage/sepolicy/hal_power_stats_default.te b/storage/sepolicy/hal_power_stats_default.te deleted file mode 100644 index edd286c..0000000 --- a/storage/sepolicy/hal_power_stats_default.te +++ /dev/null @@ -1,3 +0,0 @@ -# dumpsys android.hardware.power.stats.IPowerStats/default -r_dir_file(hal_power_stats_default, sysfs_scsi_devices_0000) - diff --git a/storage/sepolicy/init.te b/storage/sepolicy/init.te deleted file mode 100644 index 321a7ad..0000000 --- a/storage/sepolicy/init.te +++ /dev/null @@ -1,4 +0,0 @@ -# init -allow init sysfs_scsi_devices_0000:file w_file_perms; -allow init userdata_exp_block_device:blk_file write; -allow init intelligence_data_file:dir mounton; diff --git a/storage/sepolicy/kernel.te b/storage/sepolicy/kernel.te deleted file mode 100644 index b9712b1..0000000 --- a/storage/sepolicy/kernel.te +++ /dev/null @@ -1,3 +0,0 @@ -# for intelligence service - -allow kernel userdata_exp_block_device:blk_file { read write }; diff --git a/storage/sepolicy/property.te b/storage/sepolicy/property.te deleted file mode 100644 index 598c71a..0000000 --- a/storage/sepolicy/property.te +++ /dev/null @@ -1,3 +0,0 @@ -# for intelligence service - -vendor_internal_prop(vendor_intelligence_prop) diff --git a/storage/sepolicy/property_contexts b/storage/sepolicy/property_contexts deleted file mode 100644 index b436986..0000000 --- a/storage/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -persist.vendor.intelligence u:object_r:vendor_intelligence_prop:s0 diff --git a/storage/sepolicy/recovery.te b/storage/sepolicy/recovery.te deleted file mode 100644 index 8f5556c..0000000 --- a/storage/sepolicy/recovery.te +++ /dev/null @@ -1,7 +0,0 @@ -# factory data reset -recovery_only(` - allow recovery sysfs_ota:file rw_file_perms; - allow recovery sysfs_scsi_devices_0000:file r_file_perms; - allow recovery sysfs_scsi_devices_0000:dir r_dir_perms; -') - diff --git a/storage/sepolicy/storage_intelligence.te b/storage/sepolicy/storage_intelligence.te deleted file mode 100644 index 66d14df..0000000 --- a/storage/sepolicy/storage_intelligence.te +++ /dev/null @@ -1,12 +0,0 @@ -# support intelligence service -init_daemon_domain(storage_intelligence) -type storage_intelligence, domain; -type storage_intelligence_exec, vendor_file_type, exec_type, file_type; - -set_prop(storage_intelligence, vendor_intelligence_prop); - -allow storage_intelligence vendor_toolbox_exec:file execute_no_trans; - -# for storage management -allow storage_intelligence block_device:dir { search }; -allow storage_intelligence userdata_exp_block_device:blk_file rw_file_perms; diff --git a/storage/sepolicy/tracking_denials/bug_map b/storage/sepolicy/tracking_denials/bug_map deleted file mode 100644 index a1e8298..0000000 --- a/storage/sepolicy/tracking_denials/bug_map +++ /dev/null @@ -1 +0,0 @@ -shell vendor_intelligence_prop file b/378120929 diff --git a/storage/sepolicy/ufs_firmware_update.te b/storage/sepolicy/ufs_firmware_update.te deleted file mode 100644 index 2313121..0000000 --- a/storage/sepolicy/ufs_firmware_update.te +++ /dev/null @@ -1,11 +0,0 @@ -# support ufs ffu via ota -init_daemon_domain(ufs_firmware_update) -type ufs_firmware_update, domain; -type ufs_firmware_update_exec, vendor_file_type, exec_type, file_type; - -# support ufs ffu via ota -allow ufs_firmware_update vendor_toolbox_exec:file execute_no_trans; -allow ufs_firmware_update block_device:dir { search }; -allow ufs_firmware_update ufs_internal_block_device:blk_file rw_file_perms; -allow ufs_firmware_update sysfs_scsi_devices_0000:file r_file_perms; - diff --git a/storage/sepolicy/vendor_init.te b/storage/sepolicy/vendor_init.te deleted file mode 100644 index cbb2990..0000000 --- a/storage/sepolicy/vendor_init.te +++ /dev/null @@ -1,8 +0,0 @@ -# vendor_init -allow vendor_init sg_device:chr_file r_file_perms; - -# dirty swappiness -allow vendor_init proc_dirty:file w_file_perms; - -# intelligence -set_prop(vendor_init, vendor_intelligence_prop); diff --git a/storage/sepolicy/vold.te b/storage/sepolicy/vold.te deleted file mode 100644 index b776c80..0000000 --- a/storage/sepolicy/vold.te +++ /dev/null @@ -1,17 +0,0 @@ -# ufs hagc -allow vold sysfs_scsi_devices_0000:file rw_file_perms; - -# Access userdata_exp block device. -allow vold userdata_exp_block_device:blk_file rw_file_perms; -allowxperm vold userdata_exp_block_device:blk_file ioctl BLKSECDISCARD; - -# adb bugreport -dontaudit vold dumpstate:fifo_file rw_file_perms; -dontaudit vold dumpstate:fd use ; - -# fix idle-maint -allow vold efs_block_device:blk_file { getattr }; -allow vold modem_userdata_block_device:blk_file { getattr }; -allow vold modem_efs_file:dir { read open ioctl }; -allow vold modem_userdata_file:dir { read open ioctl }; - diff --git a/storage/storage.intelligence.rc b/storage/storage.intelligence.rc deleted file mode 100644 index f22d813..0000000 --- a/storage/storage.intelligence.rc +++ /dev/null @@ -1,24 +0,0 @@ -# For intelligence service -# on -> mount(ok) -> on -# off -> write_zeroes -> remove -> rm(ok) -> disable -# on -> mount(fail) -> remove -> rm(ok) -> disable - -service storage_intelligence /vendor/bin/storage_intelligence.sh - user root - disabled - oneshot - -on boot && property:persist.vendor.intelligence=on - mkdir /data/vendor/intelligence 0770 vendor_intelligence vendor_intelligence - mount f2fs loop@/dev/block/by-name/userdata_exp.ai /data/vendor/intelligence rw - restorecon_recursive /data/vendor/intelligence - mount f2fs /data/vendor/intelligence /data/vendor/intelligence remount ro - start storage_intelligence - -on boot && property:persist.vendor.intelligence=off - start storage_intelligence - -on property:persist.vendor.intelligence=remove - rm /data/userdata_exp.ai - rmdir /data/vendor/intelligence - setprop persist.vendor.intelligence disable diff --git a/storage/storage.mk b/storage/storage.mk deleted file mode 100644 index 72330a0..0000000 --- a/storage/storage.mk +++ /dev/null @@ -1,5 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += \ - device/google/gs-common/storage/sepolicy \ - device/google/gs-common/storage/sepolicy/tracking_denials - -PRODUCT_PACKAGES += dump_storage diff --git a/storage/storage_intelligence.sh b/storage/storage_intelligence.sh deleted file mode 100755 index 509f12e..0000000 --- a/storage/storage_intelligence.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/vendor/bin/sh -# -# The script belongs to the feature of AI preload feature, go/gemini-package - -property="persist.vendor.intelligence" -partition="/dev/block/by-name/userdata_exp.ai" -mount_point="/data/vendor/intelligence" -backend_file="/data/userdata_exp.ai" - -request=`getprop $property` - -if [ "$request" == "on" ]; then - mounted=`grep $mount_point /proc/mounts` - if [ "$mounted" ]; then - setprop $property on - else - setprop $property remove - fi -elif [ "$request" == "off" ]; then - dd if=/dev/zero of=$partition bs=4k count=2 - setprop $property remove -fi diff --git a/storage/tracking_denials/bug_map b/storage/tracking_denials/bug_map deleted file mode 100644 index a1e8298..0000000 --- a/storage/tracking_denials/bug_map +++ /dev/null @@ -1 +0,0 @@ -shell vendor_intelligence_prop file b/378120929 diff --git a/telephony/pktrouter.mk b/telephony/pktrouter.mk deleted file mode 100644 index 7f054e6..0000000 --- a/telephony/pktrouter.mk +++ /dev/null @@ -1,3 +0,0 @@ -PRODUCT_PACKAGES += wfc-pkt-router -PRODUCT_PROPERTY_OVERRIDES += vendor.pktrouter=1 -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/telephony/sepolicy diff --git a/telephony/sepolicy/device.te b/telephony/sepolicy/device.te deleted file mode 100644 index 3225bac..0000000 --- a/telephony/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type pktrouter_device, dev_type; diff --git a/telephony/sepolicy/file_contexts b/telephony/sepolicy/file_contexts deleted file mode 100644 index f6e73db..0000000 --- a/telephony/sepolicy/file_contexts +++ /dev/null @@ -1,4 +0,0 @@ -# WFC -/vendor/bin/wfc-pkt-router u:object_r:pktrouter_exec:s0 - -/dev/umts_wfc[01] u:object_r:pktrouter_device:s0 diff --git a/telephony/sepolicy/netutils_wrapper.te b/telephony/sepolicy/netutils_wrapper.te deleted file mode 100644 index ff1be58..0000000 --- a/telephony/sepolicy/netutils_wrapper.te +++ /dev/null @@ -1,7 +0,0 @@ -allow netutils_wrapper pktrouter:fd use; -allow netutils_wrapper pktrouter:fifo_file write; -allow netutils_wrapper pktrouter:netlink_route_socket { read write }; -allow netutils_wrapper pktrouter:packet_socket { read write }; -allow netutils_wrapper pktrouter:rawip_socket { read write }; -allow netutils_wrapper pktrouter:udp_socket { read write }; -allow netutils_wrapper pktrouter_device:chr_file rw_file_perms; diff --git a/telephony/sepolicy/pktrouter.te b/telephony/sepolicy/pktrouter.te deleted file mode 100644 index b7d2e11..0000000 --- a/telephony/sepolicy/pktrouter.te +++ /dev/null @@ -1,14 +0,0 @@ -type pktrouter, domain; -type pktrouter_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(pktrouter) -net_domain(pktrouter) - -domain_auto_trans(pktrouter, netutils_wrapper_exec, netutils_wrapper); - -allow pktrouter pktrouter_device:chr_file rw_file_perms; -allow pktrouter radio_device:chr_file r_file_perms; -allow pktrouter self:netlink_route_socket nlmsg_write; -allow pktrouter self:packet_socket { bind create read write getattr shutdown}; -allow pktrouter self:capability net_raw; - -get_prop(pktrouter, vendor_ims_prop); diff --git a/telephony/sepolicy/property.te b/telephony/sepolicy/property.te deleted file mode 100644 index a3d6a39..0000000 --- a/telephony/sepolicy/property.te +++ /dev/null @@ -1 +0,0 @@ -vendor_internal_prop(vendor_ims_prop) diff --git a/telephony/sepolicy/property_contexts b/telephony/sepolicy/property_contexts deleted file mode 100644 index 4165d92..0000000 --- a/telephony/sepolicy/property_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# for ims service -vendor.pktrouter u:object_r:vendor_ims_prop:s0 - diff --git a/telephony/sepolicy/vendor_init.te b/telephony/sepolicy/vendor_init.te deleted file mode 100644 index 3a86781..0000000 --- a/telephony/sepolicy/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, vendor_ims_prop) diff --git a/thermal/OWNERS b/thermal/OWNERS deleted file mode 100644 index 5538b5f..0000000 --- a/thermal/OWNERS +++ /dev/null @@ -1 +0,0 @@ -include platform/hardware/google/pixel:/thermal/OWNERS diff --git a/thermal/dump/Android.bp b/thermal/dump/Android.bp deleted file mode 100644 index 70fef5c..0000000 --- a/thermal/dump/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_thermal.sh", - src: "dump_thermal.sh", - vendor: true, - sub_dir: "dump", -} diff --git a/thermal/dump/dump_thermal.sh b/thermal/dump/dump_thermal.sh deleted file mode 100644 index bd3aad9..0000000 --- a/thermal/dump/dump_thermal.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/vendor/bin/sh - -echo 'Temperatures' -for f in /sys/class/thermal/thermal* ; do - echo `cat $f/type`: `cat $f/temp` -done - -echo 'Cooling Device Current State' -for f in /sys/class/thermal/cooling* ; do - echo `cat $f/type`: `cat $f/cur_state` -done - -echo 'Cooling Device User Vote State' -for f in /sys/class/thermal/cooling* ; do - if ! [ -r $f/user_vote ]; then continue; fi; - echo `cat $f/type`: `cat $f/user_vote` -done - -echo 'Cooling Device Time in State' -for f in /sys/class/thermal/cooling* ; do - echo `cat $f/type`: `cat $f/stats/time_in_state_ms` -done - -echo 'Cooling Device Trans Table' -for f in /sys/class/thermal/cooling* ; do - echo `cat $f/type`: `cat $f/stats/trans_table` -done - -echo 'Cooling Device State2Power Table' -for f in /sys/class/thermal/cooling* ; do - if ! [ -r $f/state2power_table ]; then continue; fi; - echo `cat $f/type`: `cat $f/state2power_table` -done - -echo 'TMU state:' -cat /sys/module/gs_thermal/parameters/tmu_reg_dump_state -echo 'TMU intpend:' -cat /sys/module/gs_thermal/parameters/tmu_reg_dump_intpend -echo 'TMU current temperature:' -cat /sys/module/gs_thermal/parameters/tmu_reg_dump_current_temp -echo 'TMU_TOP rise thresholds:' -cat /sys/module/gs_thermal/parameters/tmu_top_reg_dump_rise_thres -echo 'TMU_TOP fall thresholds:' -cat /sys/module/gs_thermal/parameters/tmu_top_reg_dump_fall_thres -echo 'TMU_SUB rise thresholds:' -cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_rise_thres -echo 'TMU_SUB fall thresholds:' -cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_fall_thres diff --git a/thermal/dump/thermal.mk b/thermal/dump/thermal.mk deleted file mode 100644 index 4bb0344..0000000 --- a/thermal/dump/thermal.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy/dump - -PRODUCT_PACKAGES += dump_thermal.sh diff --git a/thermal/sepolicy/dump/dump_thermal.te b/thermal/sepolicy/dump/dump_thermal.te deleted file mode 100644 index c36f7cd..0000000 --- a/thermal/sepolicy/dump/dump_thermal.te +++ /dev/null @@ -1,7 +0,0 @@ -pixel_bugreport(dump_thermal) - -allow dump_thermal sysfs_thermal:dir r_dir_perms; -allow dump_thermal sysfs_thermal:file r_file_perms; -allow dump_thermal sysfs_thermal:lnk_file r_file_perms; -allow dump_thermal vendor_toolbox_exec:file execute_no_trans; - diff --git a/thermal/sepolicy/dump/file_contexts b/thermal/sepolicy/dump/file_contexts deleted file mode 100644 index 461a07b..0000000 --- a/thermal/sepolicy/dump/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_thermal\.sh u:object_r:dump_thermal_exec:s0 diff --git a/thermal/sepolicy/dump/genfs_contexts b/thermal/sepolicy/dump/genfs_contexts deleted file mode 100644 index 1422e63..0000000 --- a/thermal/sepolicy/dump/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -# thermal sysfs files -genfscon sysfs /module/gs_thermal/parameters u:object_r:sysfs_thermal:s0 - diff --git a/thermal/sepolicy/thermal_hal/file.te b/thermal/sepolicy/thermal_hal/file.te deleted file mode 100644 index a2b1ab8..0000000 --- a/thermal/sepolicy/thermal_hal/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type thermal_link_device, dev_type; -type debugfs_thermal, debugfs_type, fs_type; diff --git a/thermal/sepolicy/thermal_hal/file_contexts b/thermal/sepolicy/thermal_hal/file_contexts deleted file mode 100644 index c3fb04f..0000000 --- a/thermal/sepolicy/thermal_hal/file_contexts +++ /dev/null @@ -1,6 +0,0 @@ -/vendor/bin/hw/android\.hardware\.thermal@2\.0-service\.pixel u:object_r:hal_thermal_default_exec:s0 -/vendor/bin/hw/android\.hardware\.thermal-service\.pixel u:object_r:hal_thermal_default_exec:s0 -/vendor/bin/thermal_logd u:object_r:init-thermal-logging-sh_exec:s0 -/vendor/bin/thermal_controld u:object_r:pixel-thermal-control-sh_exec:s0 -/vendor/bin/thermal_symlinks u:object_r:init-thermal-symlinks-sh_exec:s0 -/dev/thermal(/.*)? u:object_r:thermal_link_device:s0 diff --git a/thermal/sepolicy/thermal_hal/genfs_contexts b/thermal/sepolicy/thermal_hal/genfs_contexts deleted file mode 100644 index 699d0ca..0000000 --- a/thermal/sepolicy/thermal_hal/genfs_contexts +++ /dev/null @@ -1,5 +0,0 @@ -genfscon sysfs /devices/virtual/thermal u:object_r:sysfs_thermal:s0 -genfscon sysfs /devices/virtual/powercap u:object_r:sysfs_thermal:s0 -genfscon sysfs /class/thermal u:object_r:sysfs_thermal:s0 -genfscon sysfs /class/powercap u:object_r:sysfs_thermal:s0 -genfscon debugfs /gs101-thermal u:object_r:debugfs_thermal:s0 diff --git a/thermal/sepolicy/thermal_hal/hal_thermal_default.te b/thermal/sepolicy/thermal_hal/hal_thermal_default.te deleted file mode 100644 index 41a0f5e..0000000 --- a/thermal/sepolicy/thermal_hal/hal_thermal_default.te +++ /dev/null @@ -1,17 +0,0 @@ -allow hal_thermal_default sysfs_thermal:dir r_dir_perms; -allow hal_thermal_default sysfs_thermal:file rw_file_perms; -allow hal_thermal_default sysfs_thermal:lnk_file r_file_perms; -allow hal_thermal_default thermal_link_device:dir r_dir_perms; -allow hal_thermal_default proc_stat:file r_file_perms; -allow hal_thermal_default self:netlink_generic_socket create_socket_perms_no_ioctl; -allow hal_thermal_default self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; -allow hal_thermal_default sysfs_gpu:file r_file_perms; - -hal_client_domain(hal_thermal_default, hal_power); - -# read thermal_config -get_prop(hal_thermal_default, vendor_thermal_prop) - -# Needed for reporting thermal stats event -allow hal_thermal_default fwk_stats_service:service_manager find; -binder_call(hal_thermal_default, servicemanager) diff --git a/thermal/sepolicy/thermal_hal/init-thermal-logging.sh.te b/thermal/sepolicy/thermal_hal/init-thermal-logging.sh.te deleted file mode 100644 index 3da540e..0000000 --- a/thermal/sepolicy/thermal_hal/init-thermal-logging.sh.te +++ /dev/null @@ -1,10 +0,0 @@ -type init-thermal-logging-sh, domain; -type init-thermal-logging-sh_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(init-thermal-logging-sh) - -userdebug_or_eng(` - allow init-thermal-logging-sh vendor_toolbox_exec:file rx_file_perms; - allow init-thermal-logging-sh sysfs_thermal:dir r_dir_perms; - allow init-thermal-logging-sh sysfs_thermal:file r_file_perms; -') diff --git a/thermal/sepolicy/thermal_hal/init-thermal-symlinks.sh.te b/thermal/sepolicy/thermal_hal/init-thermal-symlinks.sh.te deleted file mode 100644 index 093512c..0000000 --- a/thermal/sepolicy/thermal_hal/init-thermal-symlinks.sh.te +++ /dev/null @@ -1,12 +0,0 @@ -type init-thermal-symlinks-sh, domain; -type init-thermal-symlinks-sh_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(init-thermal-symlinks-sh) - -allow init-thermal-symlinks-sh vendor_toolbox_exec:file rx_file_perms; -allow init-thermal-symlinks-sh thermal_link_device:dir rw_dir_perms; -allow init-thermal-symlinks-sh thermal_link_device:lnk_file create_file_perms; -allow init-thermal-symlinks-sh sysfs_thermal:dir r_dir_perms; -allow init-thermal-symlinks-sh sysfs_thermal:file r_file_perms; -allow init-thermal-symlinks-sh sysfs_thermal:lnk_file r_file_perms; -set_prop(init-thermal-symlinks-sh, vendor_thermal_prop) diff --git a/thermal/sepolicy/thermal_hal/pixel-thermal-control.sh.te b/thermal/sepolicy/thermal_hal/pixel-thermal-control.sh.te deleted file mode 100644 index df699fc..0000000 --- a/thermal/sepolicy/thermal_hal/pixel-thermal-control.sh.te +++ /dev/null @@ -1,13 +0,0 @@ -type pixel-thermal-control-sh, domain; -type pixel-thermal-control-sh_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(pixel-thermal-control-sh) - -userdebug_or_eng(` - allow pixel-thermal-control-sh vendor_toolbox_exec:file execute_no_trans; - allow pixel-thermal-control-sh sysfs_thermal:dir r_dir_perms; - allow pixel-thermal-control-sh sysfs_thermal:file rw_file_perms; - allow pixel-thermal-control-sh sysfs_thermal:lnk_file r_file_perms; - allow pixel-thermal-control-sh thermal_link_device:dir r_dir_perms; - set_prop(pixel-thermal-control-sh, vendor_thermal_prop) -') diff --git a/thermal/sepolicy/thermal_hal/property.te b/thermal/sepolicy/thermal_hal/property.te deleted file mode 100644 index 676c85a..0000000 --- a/thermal/sepolicy/thermal_hal/property.te +++ /dev/null @@ -1,2 +0,0 @@ -#thermal HAL -vendor_internal_prop(vendor_thermal_prop) diff --git a/thermal/sepolicy/thermal_hal/property_contexts b/thermal/sepolicy/thermal_hal/property_contexts deleted file mode 100644 index 65a02ee..0000000 --- a/thermal/sepolicy/thermal_hal/property_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.thermal. u:object_r:vendor_thermal_prop:s0 diff --git a/thermal/sepolicy/thermal_hal/vendor_init.te b/thermal/sepolicy/thermal_hal/vendor_init.te deleted file mode 100644 index aaf6ac1..0000000 --- a/thermal/sepolicy/thermal_hal/vendor_init.te +++ /dev/null @@ -1,3 +0,0 @@ -allow vendor_init thermal_link_device:dir r_dir_perms; -allow vendor_init thermal_link_device:lnk_file r_file_perms; -set_prop(vendor_init, vendor_thermal_prop) diff --git a/thermal/thermal_hal/device.mk b/thermal/thermal_hal/device.mk deleted file mode 100644 index 0d696e9..0000000 --- a/thermal/thermal_hal/device.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_PACKAGES += android.hardware.thermal-service.pixel - -# Thermal utils -PRODUCT_PACKAGES += thermal_symlinks - -BOARD_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy/thermal_hal diff --git a/thermal/thermal_hal/thermal_config_schemas/Android.bp b/thermal/thermal_hal/thermal_config_schemas/Android.bp deleted file mode 100644 index ed66305..0000000 --- a/thermal/thermal_hal/thermal_config_schemas/Android.bp +++ /dev/null @@ -1,17 +0,0 @@ -cc_library_static { - name: "thermal_HAL_info_config_proto", - host_supported: true, - srcs: [ - "thermal_info_config.proto", - ], - proto: { - type: "full", - export_proto_headers: true, - include_dirs: ["external/protobuf/src"], - }, - cflags: [ - "-Wall", - "-Werror", - "-Wno-unused-parameter", - ], -} \ No newline at end of file diff --git a/thermal/thermal_hal/thermal_config_schemas/thermal_info_config.proto b/thermal/thermal_hal/thermal_config_schemas/thermal_info_config.proto deleted file mode 100644 index c97fa7f..0000000 --- a/thermal/thermal_hal/thermal_config_schemas/thermal_info_config.proto +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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. - */ - -syntax = "proto3"; - -package devices.shusky; - -message ThermalConfig { - repeated Sensor sensors = 1 [ json_name = "Sensors" ]; - repeated CoolingDevice coolingdevices = 2 [ json_name = "CoolingDevices" ]; - repeated PowerRails powerrails = 3 [ json_name = "PowerRails" ]; - Stats stats = 4 [ json_name = "Stats" ]; -} - -message Sensor { - string name = 1 [ json_name = "Name" ]; - string type = 2 [ json_name = "Type" ]; - repeated float hotthreshold = 3 [ json_name = "HotThreshold" ]; - repeated float hothysteresis = 4 [ json_name = "HotHysteresis" ]; - string temppath = 5 [ json_name = "TempPath" ]; - float multiplier = 6 [ json_name = "Multiplier" ]; - int32 pollingdelay = 7 [ json_name = "PollingDelay" ]; - int32 passivedelay = 8 [ json_name = "PassiveDelay" ]; - bool hidden = 9 [ json_name = "Hidden" ]; - bool virtualsensor = 10 [ json_name = "VirtualSensor" ]; - repeated string triggersensor = 11 [ json_name = "TriggerSensor" ]; - string formula = 12 [ json_name = "Formula" ]; - repeated string combination = 13 [ json_name = "Combination" ]; - repeated float Coefficient = 14 [ json_name = "Coefficient" ]; - bool sendpowerhint = 15 [ json_name = "SendPowerHint" ]; - bool sendcallback = 16 [ json_name = "SendCallback" ]; - PIDInfo pidinfo = 17 [ json_name = "PIDInfo" ]; - repeated ExcludedPowerInfo excludedpowerinfo = 18 - [ json_name = "ExcludedPowerInfo" ]; - repeated BindedCdevInfo bindedcdevinfos = 19 [ json_name = "BindedCdevInfo" ]; - repeated string combinationtype = 20 [ json_name = "CombinationType" ]; - string version = 21 [ json_name = "Version" ]; - int32 offset = 22 [ json_name = "Offset" ]; - repeated Profile profile = 23 [ json_name = "Profile" ]; - float vrthreshold = 24 [ json_name = "VrThreshold" ]; - bool monitor = 25 [ json_name = "Monitor" ]; -} - -message Profile { - string mode = 1 [ json_name = "Mode" ]; - repeated BindedCdevInfo bindedcdevinfo = 2 [ json_name = "BindedCdevInfo" ]; -} - -message ExcludedPowerInfo { - string powerrail = 1 [ json_name = "PowerRail" ]; - repeated float powerweight = 2 [ json_name = "PowerWeight" ]; -} - -message BindedCdevInfo { - string cdevrequest = 1 [ json_name = "CdevRequest" ]; - repeated float cdevweightforpid = 2 [ json_name = "CdevWeightForPID" ]; - int32 maxreleasestep = 3 [ json_name = "MaxReleaseStep" ]; - int32 maxthrottlestep = 4 [ json_name = "MaxThrottleStep" ]; - repeated int32 cdevceiling = 5 [ json_name = "CdevCeiling" ]; - repeated int32 limitinfo = 6 [ json_name = "LimitInfo" ]; - string bindedpowerrail = 7 [ json_name = "BindedPowerRail" ]; - bool disabled = 8 [ json_name = "Disabled" ]; -} - -message PIDInfo { - repeated float k_po = 1 [ json_name = "K_Po" ]; - repeated float k_pu = 2 [ json_name = "K_Pu" ]; - repeated float k_i = 3 [ json_name = "K_I" ]; - repeated float k_d = 4 [ json_name = "K_D" ]; - repeated float i_max = 5 [ json_name = "I_Max" ]; - repeated float s_power = 6 [ json_name = "S_Power" ]; - repeated float minallocpower = 7 [ json_name = "MinAllocPower" ]; - repeated float maxallocpower = 8 [ json_name = "MaxAllocPower" ]; - repeated float i_cutoff = 9 [ json_name = "I_Cutoff" ]; - int32 i_default = 10 [ json_name = "I_Default" ]; -} - -message CoolingDevice { - string name = 1 [ json_name = "Name" ]; - string type = 2 [ json_name = "Type" ]; - string writepath = 3 [ json_name = "WritePath" ]; - repeated int32 state2power = 4 [ json_name = "State2Power" ]; -} - -message PowerRails { - string name = 1 [ json_name = "Name" ]; - int32 powersampledelay = 2 [ json_name = "PowerSampleDelay" ]; - int32 powersamplecount = 3 [ json_name = "PowerSampleCount" ]; - bool virtualrails = 4 [ json_name = "VirtualRails" ]; - string formula = 5 [ json_name = "Formula" ]; - repeated string combination = 6 [ json_name = "Combination" ]; - repeated float coefficient = 7 [ json_name = "Coefficient" ]; -} - -message Stats { - SensorStats sensorstats = 1 [ json_name = "Sensors" ]; - CoolingDeviceStats coolingdevicestats = 2 [ json_name = "CoolingDevices" ]; -} - -message SensorStats { - repeated string recordwithdefaultthreshold = 1 - [ json_name = "RecordWithDefaultThreshold" ]; - repeated SensorStat recordwiththreshold = 2 - [ json_name = "RecordWithThreshold" ]; - Abnormality abnormality = 3 [ json_name = "Abnormality" ]; -} - -message CoolingDeviceStats { - RecordVotePerSensor recordvotepersensor = 1 - [ json_name = "RecordVotePerSensor" ]; -} - -message RecordVotePerSensor { - bool defaultthresholdenableall = 1 - [ json_name = "DefaultThresholdEnableAll" ]; -} - -message SensorStat { - string name = 1 [ json_name = "Name" ]; - repeated int32 thresholds = 2 [ json_name = "Thresholds" ]; -} - -message Abnormality { - Outlier outlier = 1 [ json_name = "Outlier" ]; - Stuck stuck = 2 [ json_name = "Stuck" ]; -} - -message Outlier { repeated Config configs = 1 [ json_name = "Configs" ]; } - -message Stuck { repeated Config configs = 1 [ json_name = "Configs" ]; } - -message Config { - repeated string monitor = 1 [ json_name = "Monitor" ]; - TempStuck tempstuck = 2 [ json_name = "TempStuck" ]; - repeated float temprange = 3 [ json_name = "TempRange" ]; -} - -message TempStuck { - int32 minpollingcount = 1 [ json_name = "MinPollingCount" ]; - int32 minstuckduration = 2 [ json_name = "MinStuckDuration" ]; -} diff --git a/touch/focaltech/Android.bp b/touch/focaltech/Android.bp deleted file mode 100644 index 0b53132..0000000 --- a/touch/focaltech/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_focaltech.sh", - src: "dump_focaltech.sh", - init_rc: ["init.touch.rc"], - vendor: true, - sub_dir: "dump", -} - -sh_binary { - name: "predump_focaltech.sh", - src: "dump_focaltech.sh", - init_rc: ["init.touch.rc"], - vendor: true, - sub_dir: "dump_touch", -} diff --git a/touch/focaltech/dump_focaltech.sh b/touch/focaltech/dump_focaltech.sh deleted file mode 100644 index 82bd2cd..0000000 --- a/touch/focaltech/dump_focaltech.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/vendor/bin/sh -path="/proc/focaltech_touch" - -echo "------ Enable Force Touch Active ------" -echo 21 > $path/force_active - -echo "------ Touch Firmware Version ------" -cat $path/FW_Version - -echo "------ Touch INT PIN Test ------" -cat $path/INT_PIN - -echo "------ Get Raw Data - Panel_Differ ------" -cat $path/selftest/Panel_Differ - -echo "------ Get Raw Data - Raw ------" -cat $path/selftest/Rawdata - -echo "------ Get Raw Data - Baseline ------" -cat $path/selftest/Baseline - -echo "------ Get Raw Data - Noise ------" -cat $path/selftest/Noise - -echo "------ Get Raw Data - Uniformity ------" -cat $path/selftest/Rawdata_Uniformity - -echo "------ Get Scap_CB ------" -cat $path/selftest/Scap_CB - -echo "------ Get Scap_Rawdata ------" -cat $path/selftest/Scap_Rawdata - -echo "------ Get Short Test ------" -cat $path/selftest/Short - -echo "------ Get HeatMap(ms,ss) ------" -cat $path/selftest/Strength - -echo "------ Disable Force Touch Active ------" -echo 20 > $path/force_active - diff --git a/touch/focaltech/focaltech.mk b/touch/focaltech/focaltech.mk deleted file mode 100644 index 5236586..0000000 --- a/touch/focaltech/focaltech.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/focaltech/sepolicy - -PRODUCT_PACKAGES += dump_focaltech.sh diff --git a/touch/focaltech/init.touch.rc b/touch/focaltech/init.touch.rc deleted file mode 100644 index b517d9e..0000000 --- a/touch/focaltech/init.touch.rc +++ /dev/null @@ -1,28 +0,0 @@ -on property:vendor.device.modules.ready=1 - chown system system /proc/focaltech_touch/Channel_Num - chown system system /proc/focaltech_touch/FW_Version - chown system system /proc/focaltech_touch/INT_PIN - chown system system /proc/focaltech_touch/force_active - chown system system /proc/focaltech_touch/Reset_Pin - chown system system /proc/focaltech_touch/fw_grip - chown system system /proc/focaltech_touch/fw_palm - chown system system /proc/focaltech_touch/heatmap_onoff - chown system system /proc/focaltech_touch/mf_mode - chown system system /proc/focaltech_touch/selftest/Baseline - chown system system /proc/focaltech_touch/selftest/Noise - chown system system /proc/focaltech_touch/selftest/Panel_Differ - chown system system /proc/focaltech_touch/selftest/Rawdata - chown system system /proc/focaltech_touch/selftest/Rawdata_Uniformity - chown system system /proc/focaltech_touch/selftest/Scap_CB - chown system system /proc/focaltech_touch/selftest/Scap_Rawdata - chown system system /proc/focaltech_touch/selftest/Short - chown system system /proc/focaltech_touch/selftest/Strength - -# Toggle glove_mode according to touch_sensitivity_mode -on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1 - write /proc/focaltech_touch/high_sensitivity 0 - -on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1 - write /proc/focaltech_touch/high_sensitivity 1 - - diff --git a/touch/focaltech/predump_focaltech.mk b/touch/focaltech/predump_focaltech.mk deleted file mode 100644 index aff76bc..0000000 --- a/touch/focaltech/predump_focaltech.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/focaltech/predump_sepolicy - -PRODUCT_PACKAGES += predump_focaltech.sh diff --git a/touch/focaltech/predump_sepolicy/file.te b/touch/focaltech/predump_sepolicy/file.te deleted file mode 100644 index 696f244..0000000 --- a/touch/focaltech/predump_sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -# touch predump script -type proc_touch, proc_type, fs_type; diff --git a/touch/focaltech/predump_sepolicy/file_contexts b/touch/focaltech/predump_sepolicy/file_contexts deleted file mode 100644 index 517895b..0000000 --- a/touch/focaltech/predump_sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/predump_focaltech\.sh u:object_r:predump_touch_exec:s0 - diff --git a/touch/focaltech/predump_sepolicy/genfs_contexts b/touch/focaltech/predump_sepolicy/genfs_contexts deleted file mode 100644 index 2ac9314..0000000 --- a/touch/focaltech/predump_sepolicy/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -genfscon proc /focaltech_touch u:object_r:proc_touch:s0 - - diff --git a/touch/focaltech/predump_sepolicy/predump_touch.te b/touch/focaltech/predump_sepolicy/predump_touch.te deleted file mode 100644 index c34ba49..0000000 --- a/touch/focaltech/predump_sepolicy/predump_touch.te +++ /dev/null @@ -1,3 +0,0 @@ -# touch predump script -allow predump_touch proc_touch:dir search; -allow predump_touch proc_touch:file rw_file_perms; diff --git a/touch/focaltech/sepolicy/dump_focaltech.te b/touch/focaltech/sepolicy/dump_focaltech.te deleted file mode 100644 index 0b0fb9a..0000000 --- a/touch/focaltech/sepolicy/dump_focaltech.te +++ /dev/null @@ -1,5 +0,0 @@ -pixel_bugreport(dump_focaltech) - -allow dump_focaltech proc_touch:dir r_dir_perms; -allow dump_focaltech proc_touch:file rw_file_perms; -allow dump_focaltech vendor_toolbox_exec:file execute_no_trans; diff --git a/touch/focaltech/sepolicy/file.te b/touch/focaltech/sepolicy/file.te deleted file mode 100644 index c9a0c1f..0000000 --- a/touch/focaltech/sepolicy/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type proc_touch, proc_type, fs_type; -type sysfs_touch, sysfs_type, fs_type; - diff --git a/touch/focaltech/sepolicy/file_contexts b/touch/focaltech/sepolicy/file_contexts deleted file mode 100644 index 250aaf9..0000000 --- a/touch/focaltech/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_focaltech\.sh u:object_r:dump_focaltech_exec:s0 - diff --git a/touch/focaltech/sepolicy/genfs_contexts b/touch/focaltech/sepolicy/genfs_contexts deleted file mode 100644 index 2ac9314..0000000 --- a/touch/focaltech/sepolicy/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -genfscon proc /focaltech_touch u:object_r:proc_touch:s0 - - diff --git a/touch/focaltech/sepolicy/vendor_init.te b/touch/focaltech/sepolicy/vendor_init.te deleted file mode 100644 index 117288e..0000000 --- a/touch/focaltech/sepolicy/vendor_init.te +++ /dev/null @@ -1,2 +0,0 @@ -allow vendor_init proc_touch:file w_file_perms; - diff --git a/touch/gti/Android.bp b/touch/gti/Android.bp deleted file mode 100644 index d22a5a4..0000000 --- a/touch/gti/Android.bp +++ /dev/null @@ -1,51 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_gti0.sh", - src: "dump_gti0.sh", - init_rc: ["init.touch.gti0.rc"], - vendor: true, - sub_dir: "dump", -} - -sh_binary { - name: "dump_gti1.sh", - src: "dump_gti1.sh", - init_rc: ["init.touch.gti1.rc"], - vendor: true, - sub_dir: "dump", -} - -cc_binary { - name: "touch_gti_ical", - srcs: ["touch_gti_ical.cpp"], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - ], - shared_libs: [ - "libbase", - "libcutils", - "liblog", - ], - vendor: true, -} - -sh_binary { - name: "predump_gti0.sh", - src: "dump_gti0.sh", - init_rc: ["init.touch.gti0.rc"], - vendor: true, - sub_dir: "dump_touch", -} - -sh_binary { - name: "predump_gti1.sh", - src: "dump_gti1.sh", - init_rc: ["init.touch.gti1.rc"], - vendor: true, - sub_dir: "dump_touch", -} diff --git a/touch/gti/dump_gti0.sh b/touch/gti/dump_gti0.sh deleted file mode 100644 index facb531..0000000 --- a/touch/gti/dump_gti0.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/vendor/bin/sh -path="/sys/devices/virtual/goog_touch_interface/gti.0" -procfs_path="/proc/goog_touch_interface/gti.0" - -if [[ -d "$procfs_path" ]]; then -heatmap_path=$procfs_path -else -heatmap_path=$path -fi - -if [[ -f "${procfs_path}/dump" ]]; then - echo "------ Dump ------" - cat ${procfs_path}/dump -fi - -echo "------ Force Touch Active ------" -result=$( cat "$path/force_active" 2>&1 ) -if [ $? -eq 0 ]; then - state=$( echo "$result" |cut -d " " -f 2 ) - if [ "$state" = "locked" ]; then - echo "The force_active is already locked!" - else - echo 1 > $path/force_active - if [ $? -ne 0 ]; then - echo "Failed to active touch device" - exit 1 - fi - fi -else - if [[ $result == *Operation\ not\ supported* ]]; then - echo "force_active is not support, skip it" - else - echo "Failed to read the state of force_force" - exit 1 - fi -fi - -echo "------ Touch Firmware Version ------" -cat $path/fw_ver - -echo "------ Panel ID ------" -cat $path/panel_id - -echo "------ Offload ID ------" -cat $path/offload_id - -echo "------ Get Mutual Sensing Data - Baseline ------" -cat $heatmap_path/ms_base - -echo "------ Get Mutual Sensing Data - Delta ------" -cat $heatmap_path/ms_diff - -echo "------ Get Mutual Sensing Data - Raw ------" -cat $heatmap_path/ms_raw - -echo "------ Get Self Sensing Data - Baseline ------" -cat $heatmap_path/ss_base - -echo "------ Get Self Sensing Data - Delta ------" -cat $heatmap_path/ss_diff - -echo "------ Get Self Sensing Data - Raw ------" -cat $heatmap_path/ss_raw - -echo "------ Self Test ------" -cat $path/self_test - -echo "------ Disable Force Touch Active ------" -echo 0 > $path/force_active diff --git a/touch/gti/dump_gti1.sh b/touch/gti/dump_gti1.sh deleted file mode 100644 index eabd6d6..0000000 --- a/touch/gti/dump_gti1.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/vendor/bin/sh -path="/sys/devices/virtual/goog_touch_interface/gti.1" -procfs_path="/proc/goog_touch_interface/gti.1" - -if [[ -d "$procfs_path" ]]; then -heatmap_path=$procfs_path -else -heatmap_path=$path -fi - -if [[ -f "${procfs_path}/dump" ]]; then - echo "------ Dump ------" - cat ${procfs_path}/dump -fi - -echo "------ Force Touch Active ------" -result=$( cat "$path/force_active" 2>&1 ) -if [ $? -eq 0 ]; then - state=$( echo "$result" |cut -d " " -f 2 ) - if [ "$state" = "locked" ]; then - echo "The force_active is already locked!" - else - echo 1 > $path/force_active - if [ $? -ne 0 ]; then - echo "Failed to active touch device" - exit 1 - fi - fi -else - if [[ $result == *Operation\ not\ supported* ]]; then - echo "force_active is not support, skip it" - else - echo "Failed to read the state of force_force" - exit 1 - fi -fi - -echo "------ Touch Firmware Version ------" -cat $path/fw_ver - -echo "------ Panel ID ------" -cat $path/panel_id - -echo "------ Offload ID ------" -cat $path/offload_id - -echo "------ Get Mutual Sensing Data - Baseline ------" -cat $heatmap_path/ms_base - -echo "------ Get Mutual Sensing Data - Delta ------" -cat $heatmap_path/ms_diff - -echo "------ Get Mutual Sensing Data - Raw ------" -cat $heatmap_path/ms_raw - -echo "------ Get Self Sensing Data - Baseline ------" -cat $heatmap_path/ss_base - -echo "------ Get Self Sensing Data - Delta ------" -cat $heatmap_path/ss_diff - -echo "------ Get Self Sensing Data - Raw ------" -cat $heatmap_path/ss_raw - -echo "------ Self Test ------" -cat $path/self_test - -echo "------ Disable Force Touch Active ------" -echo 0 > $path/force_active diff --git a/touch/gti/gti.mk b/touch/gti/gti.mk deleted file mode 100644 index 2aab821..0000000 --- a/touch/gti/gti.mk +++ /dev/null @@ -1,5 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy - -PRODUCT_PACKAGES += dump_gti0.sh -PRODUCT_PACKAGES += touch_gti_ical diff --git a/touch/gti/gti_dual.mk b/touch/gti/gti_dual.mk deleted file mode 100644 index d6b7602..0000000 --- a/touch/gti/gti_dual.mk +++ /dev/null @@ -1,6 +0,0 @@ -include device/google/gs-common/touch/gti/gti.mk - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/sepolicy_gti_dual -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy_gti_dual - -PRODUCT_PACKAGES += dump_gti1.sh diff --git a/touch/gti/ical/sepolicy/file_contexts b/touch/gti/ical/sepolicy/file_contexts deleted file mode 100644 index 9bd59c3..0000000 --- a/touch/gti/ical/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/touch_gti_ical u:object_r:gti_ical_exec:s0 diff --git a/touch/gti/ical/sepolicy/gti_ical.te b/touch/gti/ical/sepolicy/gti_ical.te deleted file mode 100644 index 228782c..0000000 --- a/touch/gti/ical/sepolicy/gti_ical.te +++ /dev/null @@ -1,8 +0,0 @@ -type gti_ical, domain; -type gti_ical_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(gti_ical) - -allow gti_ical sysfs_touch_gti:file rw_file_perms; -allow gti_ical sysfs_touch_gti:dir search; - -set_prop(gti_ical, vendor_gti_prop) diff --git a/touch/gti/ical/sepolicy/property.te b/touch/gti/ical/sepolicy/property.te deleted file mode 100644 index 94fa3fc..0000000 --- a/touch/gti/ical/sepolicy/property.te +++ /dev/null @@ -1,2 +0,0 @@ -system_public_prop(vendor_gti_prop) -typeattribute vendor_gti_prop touch_property_type; diff --git a/touch/gti/ical/sepolicy/property_contexts b/touch/gti/ical/sepolicy/property_contexts deleted file mode 100644 index e3badcd..0000000 --- a/touch/gti/ical/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.touch.gti0. u:object_r:vendor_gti_prop:s0 diff --git a/touch/gti/ical/sepolicy/vendor_init.te b/touch/gti/ical/sepolicy/vendor_init.te deleted file mode 100644 index ed0ebda..0000000 --- a/touch/gti/ical/sepolicy/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, vendor_gti_prop) diff --git a/touch/gti/ical/sepolicy_gti_dual/property_contexts b/touch/gti/ical/sepolicy_gti_dual/property_contexts deleted file mode 100644 index c3530ff..0000000 --- a/touch/gti/ical/sepolicy_gti_dual/property_contexts +++ /dev/null @@ -1 +0,0 @@ -vendor.touch.gti1. u:object_r:vendor_gti_prop:s0 diff --git a/touch/gti/init.touch.gti0.rc b/touch/gti/init.touch.gti0.rc deleted file mode 100644 index 5f8318e..0000000 --- a/touch/gti/init.touch.gti0.rc +++ /dev/null @@ -1,38 +0,0 @@ -on property:sys.boot_completed=1 - # 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/fw_ver - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/interactive_calibrate - chmod 666 /sys/devices/virtual/goog_touch_interface/gti.0/interactive_calibrate - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/panel_id - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/offload_id - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ms_base - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ms_diff - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ms_raw - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/self_test - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_base - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_diff - chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_raw - - # Procfs - chown system system /proc/goog_touch_interface - chown system system /proc/goog_touch_interface/gti.0 - chown system system /proc/goog_touch_interface/gti.0/dump - chown system system /proc/goog_touch_interface/gti.0/ms_base - chown system system /proc/goog_touch_interface/gti.0/ms_diff - chown system system /proc/goog_touch_interface/gti.0/ms_raw - chown system system /proc/goog_touch_interface/gti.0/ss_base - chown system system /proc/goog_touch_interface/gti.0/ss_diff - chown system system /proc/goog_touch_interface/gti.0/ss_raw - -on property:vendor.touch.gti0.ical=* - setprop vendor.touch.gti0.ical.state init - start touch_gti0_ical - wait_for_prop vendor.touch.gti0.ical.state done - -service touch_gti0_ical /vendor/bin/touch_gti_ical 0 ${vendor.touch.gti0.ical} - class main - user system - group system shell - disabled - oneshot diff --git a/touch/gti/init.touch.gti1.rc b/touch/gti/init.touch.gti1.rc deleted file mode 100644 index ba99210..0000000 --- a/touch/gti/init.touch.gti1.rc +++ /dev/null @@ -1,38 +0,0 @@ -on property:sys.boot_completed=1 - # 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/fw_ver - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/interactive_calibrate - chmod 666 /sys/devices/virtual/goog_touch_interface/gti.1/interactive_calibrate - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/panel_id - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/offload_id - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/ms_base - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/ms_diff - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/ms_raw - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/self_test - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/ss_base - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/ss_diff - chown system system /sys/devices/virtual/goog_touch_interface/gti.1/ss_raw - - # Procfs - chown system system /proc/goog_touch_interface - chown system system /proc/goog_touch_interface/gti.1 - chown system system /proc/goog_touch_interface/gti.1/dump - chown system system /proc/goog_touch_interface/gti.1/ms_base - chown system system /proc/goog_touch_interface/gti.1/ms_diff - chown system system /proc/goog_touch_interface/gti.1/ms_raw - chown system system /proc/goog_touch_interface/gti.1/ss_base - chown system system /proc/goog_touch_interface/gti.1/ss_diff - chown system system /proc/goog_touch_interface/gti.1/ss_raw - -on property:vendor.touch.gti1.ical=* - setprop vendor.touch.gti1.ical.state init - start touch_gti1_ical - wait_for_prop vendor.touch.gti1.ical.state done - -service touch_gti1_ical /vendor/bin/touch_gti_ical 1 ${vendor.touch.gti1.ical} - class main - user system - group system shell - disabled - oneshot diff --git a/touch/gti/predump_gti.mk b/touch/gti/predump_gti.mk deleted file mode 100644 index ae25254..0000000 --- a/touch/gti/predump_gti.mk +++ /dev/null @@ -1,7 +0,0 @@ -include device/google/gs-common/touch/predump/predump_touch.mk - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/predump_sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy - -PRODUCT_PACKAGES += predump_gti0.sh -PRODUCT_PACKAGES += touch_gti_ical diff --git a/touch/gti/predump_gti_dual.mk b/touch/gti/predump_gti_dual.mk deleted file mode 100644 index b7f2efc..0000000 --- a/touch/gti/predump_gti_dual.mk +++ /dev/null @@ -1,6 +0,0 @@ -include device/google/gs-common/touch/gti/predump_gti.mk - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/predump_sepolicy_gti_dual -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy_gti_dual - -PRODUCT_PACKAGES += predump_gti1.sh diff --git a/touch/gti/predump_sepolicy/file.te b/touch/gti/predump_sepolicy/file.te deleted file mode 100644 index c3900f0..0000000 --- a/touch/gti/predump_sepolicy/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type proc_touch_gti, proc_type, fs_type; -type sysfs_touch_gti, sysfs_type, fs_type; - diff --git a/touch/gti/predump_sepolicy/file_contexts b/touch/gti/predump_sepolicy/file_contexts deleted file mode 100644 index 6d8ca17..0000000 --- a/touch/gti/predump_sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump_touch/predump_gti0\.sh u:object_r:predump_touch_exec:s0 diff --git a/touch/gti/predump_sepolicy/genfs_contexts b/touch/gti/predump_sepolicy/genfs_contexts deleted file mode 100644 index 1dd4bad..0000000 --- a/touch/gti/predump_sepolicy/genfs_contexts +++ /dev/null @@ -1,6 +0,0 @@ -# Touch -genfscon sysfs /devices/virtual/goog_touch_interface u:object_r:sysfs_touch_gti:s0 -genfscon sysfs /devices/virtual/goog_touch_interface/gti.0/wakeup u:object_r:sysfs_wakeup:s0 -genfscon sysfs /devices/virtual/goog_touch_interface/gti.1/wakeup u:object_r:sysfs_wakeup:s0 -genfscon proc /goog_touch_interface u:object_r:proc_touch_gti:s0 - diff --git a/touch/gti/predump_sepolicy/predump_touch.te b/touch/gti/predump_sepolicy/predump_touch.te deleted file mode 100644 index 7c1f408..0000000 --- a/touch/gti/predump_sepolicy/predump_touch.te +++ /dev/null @@ -1,4 +0,0 @@ -allow predump_touch proc_touch_gti:dir r_dir_perms; -allow predump_touch proc_touch_gti:file rw_file_perms; -allow predump_touch sysfs_touch_gti:dir r_dir_perms; -allow predump_touch sysfs_touch_gti:file rw_file_perms; \ No newline at end of file diff --git a/touch/gti/predump_sepolicy_gti_dual/file_contexts b/touch/gti/predump_sepolicy_gti_dual/file_contexts deleted file mode 100644 index 02a300a..0000000 --- a/touch/gti/predump_sepolicy_gti_dual/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump_touch/predump_gti1\.sh u:object_r:predump_touch_exec:s0 - diff --git a/touch/gti/sepolicy/dump_gti.te b/touch/gti/sepolicy/dump_gti.te deleted file mode 100644 index 060fc29..0000000 --- a/touch/gti/sepolicy/dump_gti.te +++ /dev/null @@ -1,8 +0,0 @@ -pixel_bugreport(dump_gti) - -allow dump_gti proc_touch_gti:dir r_dir_perms; -allow dump_gti proc_touch_gti:file rw_file_perms; -allow dump_gti sysfs_touch_gti:dir r_dir_perms; -allow dump_gti sysfs_touch_gti:file rw_file_perms; -allow dump_gti vendor_toolbox_exec:file execute_no_trans; - diff --git a/touch/gti/sepolicy/file.te b/touch/gti/sepolicy/file.te deleted file mode 100644 index c3900f0..0000000 --- a/touch/gti/sepolicy/file.te +++ /dev/null @@ -1,3 +0,0 @@ -type proc_touch_gti, proc_type, fs_type; -type sysfs_touch_gti, sysfs_type, fs_type; - diff --git a/touch/gti/sepolicy/file_contexts b/touch/gti/sepolicy/file_contexts deleted file mode 100644 index 2fce7f5..0000000 --- a/touch/gti/sepolicy/file_contexts +++ /dev/null @@ -1 +0,0 @@ -/vendor/bin/dump/dump_gti0\.sh u:object_r:dump_gti_exec:s0 diff --git a/touch/gti/sepolicy/genfs_contexts b/touch/gti/sepolicy/genfs_contexts deleted file mode 100644 index 1dd4bad..0000000 --- a/touch/gti/sepolicy/genfs_contexts +++ /dev/null @@ -1,6 +0,0 @@ -# Touch -genfscon sysfs /devices/virtual/goog_touch_interface u:object_r:sysfs_touch_gti:s0 -genfscon sysfs /devices/virtual/goog_touch_interface/gti.0/wakeup u:object_r:sysfs_wakeup:s0 -genfscon sysfs /devices/virtual/goog_touch_interface/gti.1/wakeup u:object_r:sysfs_wakeup:s0 -genfscon proc /goog_touch_interface u:object_r:proc_touch_gti:s0 - diff --git a/touch/gti/sepolicy/hal_sensors_default.te b/touch/gti/sepolicy/hal_sensors_default.te deleted file mode 100644 index 37b93fd..0000000 --- a/touch/gti/sepolicy/hal_sensors_default.te +++ /dev/null @@ -1,2 +0,0 @@ -# Support SW_LID event from SensorHAL to configure touch input and gesture -set_prop(hal_sensors_default, vendor_gti_prop) diff --git a/touch/gti/sepolicy_gti_dual/file_contexts b/touch/gti/sepolicy_gti_dual/file_contexts deleted file mode 100644 index 21c4064..0000000 --- a/touch/gti/sepolicy_gti_dual/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_gti1\.sh u:object_r:dump_gti_exec:s0 - diff --git a/touch/gti/touch_gti_ical.cpp b/touch/gti/touch_gti_ical.cpp deleted file mode 100644 index 9b5eed5..0000000 --- a/touch/gti/touch_gti_ical.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - ** 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. - */ -#define LOG_TAG "touch_gti_ical" - -#include -#include -#include -#include -#ifdef __ANDROID__ -#include -#include -#else -#define property_set -#define property_get -#define ALOGI printf -#define ALOGW printf -#endif - -int main(int argc, char *argv[]) -{ - char *line = NULL; - size_t len = 0; - FILE *ical_fd; - const char *ical_override_cmd_prop[2] = { - [0] = "vendor.touch.gti0.ical.override.cmd", - [1] = "vendor.touch.gti1.ical.override.cmd", - }; - const char *ical_override_result_prop[2] = { - [0] = "vendor.touch.gti0.ical.override.result", - [1] = "vendor.touch.gti1.ical.override.result", - }; - const char *ical_write_history_prop[2] = { - [0] = "vendor.touch.gti0.ical.write.history", - [1] = "vendor.touch.gti1.ical.write.history", - }; - const char *ical_state_prop[2] = { - [0] = "vendor.touch.gti0.ical.state", - [1] = "vendor.touch.gti1.ical.state", - }; - const char *ical_result_prop[2] = { - [0] = "vendor.touch.gti0.ical.result", - [1] = "vendor.touch.gti1.ical.result", - }; - const char *ical_sysfs[2] = { - [0] = "/sys/devices/virtual/goog_touch_interface/gti.0/interactive_calibrate", - [1] = "/sys/devices/virtual/goog_touch_interface/gti.1/interactive_calibrate", - }; - const char *ical_override_cmd_prop_path = ical_override_cmd_prop[0]; - const char *ical_override_result_prop_path = ical_override_result_prop[0]; - const char *ical_write_history_prop_path = ical_write_history_prop[0]; - const char *ical_state_prop_path = ical_state_prop[0]; - const char *ical_result_prop_path = ical_result_prop[0]; - const char *ical_sysfs_path = ical_sysfs[0]; - const char ical_override_all_cmd_prop_val[PROPERTY_VALUE_MAX] = "xxx"; - char ical_override_cmd_prop_val[PROPERTY_VALUE_MAX] = "\0"; - char ical_override_result_prop_val[PROPERTY_VALUE_MAX] = "\0"; - char ical_write_history_prop_val[PROPERTY_VALUE_MAX] = "\0"; - - if (argc < 3) { - ALOGW("No target dev or command for interactive_calibrate sysfs.\n"); - property_set(ical_state_prop[0], "done"); - property_set(ical_state_prop[1], "done"); - return 0; - } - - if (strncmp(argv[1], "1", strlen(argv[1])) == 0 || - strncmp(argv[1], "gti1", strlen(argv[1])) == 0 || - strncmp(argv[1], "gti.1", strlen(argv[1])) == 0) { - ical_override_cmd_prop_path = ical_override_cmd_prop[1]; - ical_override_result_prop_path = ical_override_result_prop[1]; - ical_write_history_prop_path = ical_write_history_prop[1]; - ical_state_prop_path = ical_state_prop[1]; - ical_result_prop_path = ical_result_prop[1]; - ical_sysfs_path = ical_sysfs[1]; - } - - property_get(ical_override_cmd_prop_path, ical_override_cmd_prop_val, NULL); - property_get(ical_override_result_prop_path, ical_override_result_prop_val, "0 - -2147483648"); - property_get(ical_write_history_prop_path, ical_write_history_prop_val, NULL); - - property_set(ical_result_prop_path, "na"); - property_set(ical_state_prop_path, "running"); - if (access(ical_sysfs_path, F_OK | R_OK | W_OK)) { - ALOGW("Can't access %s\n", ical_sysfs_path); - property_set(ical_state_prop_path, "done"); - return 0; - } - - ical_fd = fopen(ical_sysfs_path, "r+"); - if (ical_fd == NULL) { - ALOGW("Can't fopen %s\n", ical_sysfs_path); - property_set(ical_state_prop_path, "done"); - return 0; - } - - if (strncmp(argv[2], "read", strlen(argv[2])) == 0) { - getline(&line, &len, ical_fd); - if (line != NULL) { - property_set(ical_state_prop_path, "read"); - if (strncmp(ical_override_cmd_prop_val, - ical_write_history_prop_val, - strlen(ical_write_history_prop_path)) == 0 || - strncasecmp(ical_override_cmd_prop_val, - ical_override_all_cmd_prop_val, - strlen(ical_override_all_cmd_prop_val)) == 0) { - property_set(ical_result_prop_path, ical_override_result_prop_val); - ALOGW("read(original): %s => %s", - ical_sysfs_path, line); - ALOGW("read(override): %s => %s", - ical_sysfs_path, ical_override_result_prop_val); - } else { - property_set(ical_result_prop_path, line); - ALOGI("read: %s => %s", ical_sysfs_path, line); - } - free(line); - } - } else { - property_set(ical_write_history_prop_path, argv[2]); - property_set(ical_state_prop_path, argv[2]); - fwrite(argv[2], 1, strlen(argv[2]), ical_fd); - ALOGI("write: %s => %s\n", argv[2], ical_sysfs_path); - } - property_set(ical_state_prop_path, "done"); - - fclose(ical_fd); - return 0; -} - diff --git a/touch/lsi/Android.bp b/touch/lsi/Android.bp deleted file mode 100644 index b0cef6f..0000000 --- a/touch/lsi/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_lsi.sh", - src: "dump_lsi.sh", - vendor: true, - sub_dir: "dump", -} diff --git a/touch/lsi/dump_lsi.sh b/touch/lsi/dump_lsi.sh deleted file mode 100644 index 57c7f4d..0000000 --- a/touch/lsi/dump_lsi.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/vendor/bin/sh -path="/sys/devices/virtual/sec/tsp" - -echo "--- Force Touch Active ---" -echo "force_touch_active,2,1" > $path/cmd && cat $path/cmd_result - -echo "--- LSI firmware version ---" -cat $path/fw_version - -echo "--- LSI touch status ---" -cat $path/status - -echo "--- Calibration info ---" -echo "get_mis_cal_info" > $path/cmd && cat $path/cmd_result - -echo "--- Mutual Strength ---" -echo "run_delta_read_all" > $path/cmd && cat $path/cmd_result - -echo "--- Self Strength ---" -echo "run_self_delta_read_all" > $path/cmd && cat $path/cmd_result - -echo "--- TYPE_AMBIENT_DATA ---" -echo "run_rawdata_read_type,3" > $path/cmd && cat $path/cmd_result - -echo "--- TYPE_DECODED_DATA ---" -echo "run_rawdata_read_type,5" > $path/cmd && cat $path/cmd_result - -echo "--- TYPE_OFFSET_DATA_SEC ---" -echo "run_rawdata_read_type,19" > $path/cmd && cat $path/cmd_result - -echo "--- TYPE_NOI_P2P_MIN ---" -echo "run_rawdata_read_type,30" > $path/cmd && cat $path/cmd_result - -echo "--- TYPE_NOI_P2P_MAX ---" -echo "run_rawdata_read_type,31" > $path/cmd && cat $path/cmd_result - -echo "--- Mutual Raw Cap ---" -echo "run_rawcap_read_all" > $path/cmd && cat $path/cmd_result - -echo "--- Self Raw Cap ---" -echo "run_self_rawcap_read_all" > $path/cmd && cat $path/cmd_result - -echo "--- CM2 ---" -echo "run_rawcap_high_freq_read_all" > $path/cmd && cat $path/cmd_result - -echo "--- Force Touch Active ---" -echo force_touch_active,2,0 > $path/cmd && cat $path/cmd_result - diff --git a/touch/lsi/lsi.mk b/touch/lsi/lsi.mk deleted file mode 100644 index bcb69bb..0000000 --- a/touch/lsi/lsi.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/lsi/sepolicy - -PRODUCT_PACKAGES += dump_lsi.sh diff --git a/touch/lsi/sepolicy/dump_lsi.te b/touch/lsi/sepolicy/dump_lsi.te deleted file mode 100644 index a2e114d..0000000 --- a/touch/lsi/sepolicy/dump_lsi.te +++ /dev/null @@ -1,5 +0,0 @@ -pixel_bugreport(dump_lsi) - -allow dump_lsi sysfs_touch:dir r_dir_perms; -allow dump_lsi sysfs_touch:file rw_file_perms; -allow dump_lsi vendor_toolbox_exec:file execute_no_trans; diff --git a/touch/lsi/sepolicy/file.te b/touch/lsi/sepolicy/file.te deleted file mode 100644 index 3e53ec3..0000000 --- a/touch/lsi/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type sysfs_touch, sysfs_type, fs_type; - diff --git a/touch/lsi/sepolicy/file_contexts b/touch/lsi/sepolicy/file_contexts deleted file mode 100644 index c1048fa..0000000 --- a/touch/lsi/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_lsi\.sh u:object_r:dump_lsi_exec:s0 - diff --git a/touch/lsi/sepolicy/genfs_contexts b/touch/lsi/sepolicy/genfs_contexts deleted file mode 100644 index 6dce360..0000000 --- a/touch/lsi/sepolicy/genfs_contexts +++ /dev/null @@ -1,2 +0,0 @@ -genfscon sysfs /devices/virtual/sec/tsp u:object_r:sysfs_touch:s0 - diff --git a/touch/nvt/nvt-spi20.mk b/touch/nvt/nvt-spi20.mk deleted file mode 100644 index ad46fcc..0000000 --- a/touch/nvt/nvt-spi20.mk +++ /dev/null @@ -1,2 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/nvt/sepolicy -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/nvt/sepolicy-spi20 diff --git a/touch/nvt/nvt.mk b/touch/nvt/nvt.mk deleted file mode 100644 index 9655a75..0000000 --- a/touch/nvt/nvt.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/nvt/sepolicy diff --git a/touch/nvt/sepolicy-spi20/genfs_contexts b/touch/nvt/sepolicy-spi20/genfs_contexts deleted file mode 100644 index 05467a3..0000000 --- a/touch/nvt/sepolicy-spi20/genfs_contexts +++ /dev/null @@ -1,8 +0,0 @@ -# Touch -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0 u:object_r:sysfs_touch:s0 - -# System suspend wakeup files -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/power_supply/nvt-pen-battery/wakeup u:object_r:sysfs_wakeup:s0 -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/power_supply/USI_Stylus_Battery/wakeup u:object_r:sysfs_wakeup:s0 -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/input/input2/wakeup u:object_r:sysfs_wakeup:s0 -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/wakeup u:object_r:sysfs_wakeup:s0 diff --git a/touch/nvt/sepolicy/file.te b/touch/nvt/sepolicy/file.te deleted file mode 100644 index 05a770b..0000000 --- a/touch/nvt/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type sysfs_touch, sysfs_type, fs_type; -type proc_touch, proc_type, fs_type; diff --git a/touch/nvt/sepolicy/genfs_contexts b/touch/nvt/sepolicy/genfs_contexts deleted file mode 100644 index b120511..0000000 --- a/touch/nvt/sepolicy/genfs_contexts +++ /dev/null @@ -1,12 +0,0 @@ -genfscon proc /nvt_baseline u:object_r:proc_touch:s0 -genfscon proc /nvt_cc_uniformity u:object_r:proc_touch:s0 -genfscon proc /nvt_diff u:object_r:proc_touch:s0 -genfscon proc /nvt_fw_update u:object_r:proc_touch:s0 -genfscon proc /nvt_fw_version u:object_r:proc_touch:s0 -genfscon proc /nvt_heatmap u:object_r:proc_touch:s0 -genfscon proc /nvt_pen_1d_diff u:object_r:proc_touch:s0 -genfscon proc /nvt_pen_2d_baseline u:object_r:proc_touch:s0 -genfscon proc /nvt_pen_2d_diff u:object_r:proc_touch:s0 -genfscon proc /nvt_pen_2d_raw u:object_r:proc_touch:s0 -genfscon proc /nvt_raw u:object_r:proc_touch:s0 -genfscon proc /nvt_selftest u:object_r:proc_touch:s0 diff --git a/touch/nvt/sepolicy/system_server.te b/touch/nvt/sepolicy/system_server.te deleted file mode 100644 index d65d811..0000000 --- a/touch/nvt/sepolicy/system_server.te +++ /dev/null @@ -1,2 +0,0 @@ -allow system_server sysfs_touch:dir r_dir_perms; -allow system_server sysfs_touch:file r_file_perms; diff --git a/touch/nvt/sepolicy/vendor_init.te b/touch/nvt/sepolicy/vendor_init.te deleted file mode 100644 index 8b844dd..0000000 --- a/touch/nvt/sepolicy/vendor_init.te +++ /dev/null @@ -1,5 +0,0 @@ -allow vendor_init sysfs_touch:dir r_dir_perms; -allow vendor_init sysfs_touch:file rw_file_perms; -allow vendor_init proc_touch:dir r_dir_perms; -allow vendor_init proc_touch:file rw_file_perms; -set_prop(vendor_init, gesture_prop) diff --git a/touch/predump/Android.bp b/touch/predump/Android.bp deleted file mode 100644 index 7d2adda..0000000 --- a/touch/predump/Android.bp +++ /dev/null @@ -1,17 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "predump_touch.sh", - src: "predump_touch.sh", - init_rc: ["init.touch.predump.rc"], - vendor: true, -} - -sh_binary { - name: "dump_touch.sh", - src: "dump_touch.sh", - vendor: true, - sub_dir: "dump", -} diff --git a/touch/predump/dump_touch.sh b/touch/predump/dump_touch.sh deleted file mode 100644 index 3a0f431..0000000 --- a/touch/predump/dump_touch.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/vendor/bin/sh - -DIR=/data/vendor/dump_touch -LOCKFILE="$DIR"/dumping -LOGFILE="$DIR"/dump.log - -if [ ! -f $LOCKFILE ] || [ ! -f $LOGFILE ] || [ "$(cat $LOCKFILE)" = 0 ] -then - echo "-----------------------------------------------------" - echo "Info : Touch debug data not found! Backfilling..." - echo "-----------------------------------------------------" - /vendor/bin/predump_touch.sh > /dev/null 2>&1 -fi - -state=$(cat $LOCKFILE) -if [ "$state" != 2 ] -then - echo "Unexpected state! Expected 2 but found ${state}" -fi - -if [ -f $LOGFILE ] -then - cat $LOGFILE - echo "" > $LOGFILE -fi - -if [ -f $LOCKFILE ] -then - echo 0 > $LOCKFILE -fi diff --git a/touch/predump/init.touch.predump.rc b/touch/predump/init.touch.predump.rc deleted file mode 100644 index aa93c82..0000000 --- a/touch/predump/init.touch.predump.rc +++ /dev/null @@ -1,12 +0,0 @@ -service vendor.touch_dumpstate /vendor/bin/predump_touch.sh - class main - user system - group system shell - disabled - oneshot - -on post-fs-data - mkdir /data/vendor/dump_touch 0775 system system - -on property:init.svc.dumpstatez=running - start vendor.touch_dumpstate diff --git a/touch/predump/predump_touch.mk b/touch/predump/predump_touch.mk deleted file mode 100644 index 1a6efb2..0000000 --- a/touch/predump/predump_touch.mk +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/predump/sepolicy - -PRODUCT_PACKAGES += predump_touch.sh -PRODUCT_PACKAGES += dump_touch.sh diff --git a/touch/predump/predump_touch.sh b/touch/predump/predump_touch.sh deleted file mode 100644 index 2b4c488..0000000 --- a/touch/predump/predump_touch.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/vendor/bin/sh - -DIR=/data/vendor/dump_touch -SCRIPT_DIR=/vendor/bin/dump_touch -LOCKFILE="$DIR"/dumping -LOGFILE="$DIR"/dump.log -DEBUG_START_TIME="$DIR"/start -DEBUG_END_TIME="$DIR"/end - -date +%s%N > $DEBUG_START_TIME - -if [ ! -f $LOCKFILE ] -then -#Init Setup - echo 0 > $LOCKFILE - echo "" > $LOGFILE - chmod 660 $LOCKFILE - chmod 660 $LOGFILE -fi - -date >> $LOGFILE - -state=$(cat $LOCKFILE) -if [ "$state" = 2 ] -then - echo "Warning : Pending predump data detected (state=${state})" >> $LOGFILE -elif [ "$state" != 0 ] -then - echo "Unexpected state! Expected 0 but found ${state}" >> $LOGFILE -fi - -echo 1 > $LOCKFILE - -for entry in "$SCRIPT_DIR"/*.sh -do - echo "----------------------------------" >> $LOGFILE - echo "$entry" >> $LOGFILE - echo "----------------------------------" >> $LOGFILE - sh "$entry" >> $LOGFILE 2>&1 - echo "----------------------------------" >> $LOGFILE -done - -state=$(cat $LOCKFILE) -if [ "$state" != 1 ] -then - echo "Unexpected state! Expected 1 but found ${state}" >> $LOGFILE -fi - -echo 2 > $LOCKFILE - -date +%s%N > $DEBUG_END_TIME diff --git a/touch/predump/sepolicy/dump_touch.te b/touch/predump/sepolicy/dump_touch.te deleted file mode 100644 index d383882..0000000 --- a/touch/predump/sepolicy/dump_touch.te +++ /dev/null @@ -1,5 +0,0 @@ -pixel_bugreport(dump_touch) - -allow dump_touch vendor_touch_dump_file:dir r_dir_perms; -allow dump_touch vendor_touch_dump_file:file rw_file_perms; -allow dump_touch vendor_toolbox_exec:file execute_no_trans; diff --git a/touch/predump/sepolicy/file.te b/touch/predump/sepolicy/file.te deleted file mode 100644 index 9be89f1..0000000 --- a/touch/predump/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_touch_dump_file, file_type, data_file_type; diff --git a/touch/predump/sepolicy/file_contexts b/touch/predump/sepolicy/file_contexts deleted file mode 100644 index 0a1ef36..0000000 --- a/touch/predump/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/bin/predump_touch\.sh u:object_r:predump_touch_exec:s0 -/vendor/bin/dump/dump_touch\.sh u:object_r:dump_touch_exec:s0 -/data/vendor/dump_touch/dump\.log u:object_r:vendor_touch_dump_file:s0 -/data/vendor/dump_touch/dumping u:object_r:vendor_touch_dump_file:s0 -/data/vendor/dump_touch u:object_r:vendor_touch_dump_file:s0 diff --git a/touch/predump/sepolicy/predump_touch.te b/touch/predump/sepolicy/predump_touch.te deleted file mode 100644 index edf473b..0000000 --- a/touch/predump/sepolicy/predump_touch.te +++ /dev/null @@ -1,9 +0,0 @@ -type predump_touch, domain; -type predump_touch_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(predump_touch) - -allow predump_touch vendor_touch_dump_file:dir rw_dir_perms; -allow predump_touch vendor_touch_dump_file:file create_file_perms; - -allow predump_touch vendor_toolbox_exec:file execute_no_trans; -allow predump_touch vendor_shell_exec:file execute_no_trans; diff --git a/touch/stm/Android.bp b/touch/stm/Android.bp deleted file mode 100644 index 0d64fd6..0000000 --- a/touch/stm/Android.bp +++ /dev/null @@ -1,17 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_stm.sh", - src: "dump_stm.sh", - vendor: true, - sub_dir: "dump", -} - -sh_binary { - name: "predump_stm.sh", - src: "dump_stm.sh", - vendor: true, - sub_dir: "dump_touch", -} diff --git a/touch/stm/dump_stm.sh b/touch/stm/dump_stm.sh deleted file mode 100644 index 8ef533d..0000000 --- a/touch/stm/dump_stm.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/vendor/bin/sh -spi=`getprop ro.vendor.touch.dump.sys` -proc=`getprop ro.vendor.touch.dump.proc` - -echo "------ Force Set AP as Bus Owner with Bugreport Flag ------" -echo A0 01 01 > $proc - -echo "------ STM touch firmware version ------" -cat $spi/appid - -echo "------ STM touch status ------" -cat $spi/status - -echo "------ Mutual Raw ------" -echo 13 00 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd - -echo "------ Mutual Strength ------" -echo 17 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd - -echo "------ Self Raw ------" -echo 15 00 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd - -echo "------ Mutual Raw Data ------" -echo 23 00 > $proc && cat $proc - -echo "------ Mutual Baseline Data ------" -echo 23 03 > $proc && cat $proc - -echo "------ Mutual Strength Data ------" -echo 23 02 > $proc && cat $proc - -echo "------ Self Raw Data ------" -echo 24 00 > $proc && cat $proc - -echo "------ Self Baseline Data ------" -echo 24 03 > $proc && cat $proc - -echo "------ Self Strength Data ------" -echo 24 02 > $proc && cat $proc - -echo "------ Mutual Compensation ------" -echo 32 10 > $proc && cat $proc - -echo "------ Mutual Low Power Compensation ------" -echo 32 11 > $proc && cat $proc - -echo "------ Self Compensation ------" -echo 33 12 > $proc && cat $proc - -echo "------ Golden Mutual Raw Data ------" -echo 34 > $proc && cat $proc - -echo "------ Packaging Plant - HW reset ------" -echo 01 FA 20 00 00 24 80 > $proc - -echo "------ Packaging Plant - Hibernate Memory ------" -echo 01 FA 20 00 00 68 08 > $proc - -echo "------ Packaging Plant - Read 16 bytes from Address 0x00041FD8 ------" -echo 02 FB 00 04 3F D8 00 10 01 > $proc && cat $proc - -echo "------ ITO Raw ------" -echo 01 > $spi/stm_fts_cmd && cat $spi/stm_fts_cmd - -echo "------ Restore Bus Owner ------" -echo A0 00 01 > $proc - diff --git a/touch/stm/predump_sepolicy/file.te b/touch/stm/predump_sepolicy/file.te deleted file mode 100644 index 7f298c3..0000000 --- a/touch/stm/predump_sepolicy/file.te +++ /dev/null @@ -1,3 +0,0 @@ -# touch predump script -type proc_touch, proc_type, fs_type; -type sysfs_touch, sysfs_type, fs_type; diff --git a/touch/stm/predump_sepolicy/file_contexts b/touch/stm/predump_sepolicy/file_contexts deleted file mode 100644 index 2667543..0000000 --- a/touch/stm/predump_sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump_touch/predump_stm\.sh u:object_r:predump_touch_exec:s0 - diff --git a/touch/stm/predump_sepolicy/genfs_contexts b/touch/stm/predump_sepolicy/genfs_contexts deleted file mode 100644 index 2ed8978..0000000 --- a/touch/stm/predump_sepolicy/genfs_contexts +++ /dev/null @@ -1,7 +0,0 @@ -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0 u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/platform/10d40000.spi/spi_master/spi11/spi11.0 u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/platform/10950000.spi/spi_master/spi6/spi6.0 u:object_r:sysfs_touch:s0 - -genfscon proc /fts/driver_test u:object_r:proc_touch:s0 -genfscon proc /fts_ext/driver_test u:object_r:proc_touch:s0 - diff --git a/touch/stm/predump_sepolicy/predump_touch.te b/touch/stm/predump_sepolicy/predump_touch.te deleted file mode 100644 index f0f458c..0000000 --- a/touch/stm/predump_sepolicy/predump_touch.te +++ /dev/null @@ -1,6 +0,0 @@ -# touch predump script -allow predump_touch proc_touch:file rw_file_perms; -allow predump_touch sysfs_touch:dir search; -allow predump_touch sysfs_touch:file rw_file_perms; - -get_prop(predump_touch vendor_touch_dump_path_prop) diff --git a/touch/stm/predump_sepolicy/property.te b/touch/stm/predump_sepolicy/property.te deleted file mode 100644 index 612c855..0000000 --- a/touch/stm/predump_sepolicy/property.te +++ /dev/null @@ -1,2 +0,0 @@ -# touch predump script -vendor_internal_prop(vendor_touch_dump_path_prop) diff --git a/touch/stm/predump_sepolicy/property_contexts b/touch/stm/predump_sepolicy/property_contexts deleted file mode 100644 index db9fd5a..0000000 --- a/touch/stm/predump_sepolicy/property_contexts +++ /dev/null @@ -1,2 +0,0 @@ -ro.vendor.touch.dump. u:object_r:vendor_touch_dump_path_prop:s0 - diff --git a/touch/stm/predump_sepolicy/vendor_init.te b/touch/stm/predump_sepolicy/vendor_init.te deleted file mode 100644 index 9017c5b..0000000 --- a/touch/stm/predump_sepolicy/vendor_init.te +++ /dev/null @@ -1,2 +0,0 @@ -# touch predump script -set_prop(vendor_init, vendor_touch_dump_path_prop) diff --git a/touch/stm/predump_stm20.mk b/touch/stm/predump_stm20.mk deleted file mode 100644 index cdf3e35..0000000 --- a/touch/stm/predump_stm20.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi20/spi20.0 -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts/driver_test - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/predump_sepolicy - -PRODUCT_PACKAGES += predump_stm.sh diff --git a/touch/stm/predump_stm6.mk b/touch/stm/predump_stm6.mk deleted file mode 100644 index 2cbde2c..0000000 --- a/touch/stm/predump_stm6.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi6/spi6.0 -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts_ext/driver_test - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/predump_sepolicy - -PRODUCT_PACKAGES += predump_stm.sh diff --git a/touch/stm/sepolicy/dump_stm.te b/touch/stm/sepolicy/dump_stm.te deleted file mode 100644 index f2da15f..0000000 --- a/touch/stm/sepolicy/dump_stm.te +++ /dev/null @@ -1,8 +0,0 @@ -pixel_bugreport(dump_stm) - -allow dump_stm proc_touch:file rw_file_perms; -allow dump_stm sysfs_touch:dir search; -allow dump_stm sysfs_touch:file rw_file_perms; -allow dump_stm vendor_toolbox_exec:file execute_no_trans; - -get_prop(dump_stm vendor_touch_dump_path_prop) diff --git a/touch/stm/sepolicy/file.te b/touch/stm/sepolicy/file.te deleted file mode 100644 index e197bb1..0000000 --- a/touch/stm/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type proc_touch, proc_type, fs_type; -type sysfs_touch, sysfs_type, fs_type; diff --git a/touch/stm/sepolicy/file_contexts b/touch/stm/sepolicy/file_contexts deleted file mode 100644 index 26576ef..0000000 --- a/touch/stm/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_stm\.sh u:object_r:dump_stm_exec:s0 - diff --git a/touch/stm/sepolicy/genfs_contexts b/touch/stm/sepolicy/genfs_contexts deleted file mode 100644 index 2ed8978..0000000 --- a/touch/stm/sepolicy/genfs_contexts +++ /dev/null @@ -1,7 +0,0 @@ -genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0 u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/platform/10d40000.spi/spi_master/spi11/spi11.0 u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/platform/10950000.spi/spi_master/spi6/spi6.0 u:object_r:sysfs_touch:s0 - -genfscon proc /fts/driver_test u:object_r:proc_touch:s0 -genfscon proc /fts_ext/driver_test u:object_r:proc_touch:s0 - diff --git a/touch/stm/sepolicy/property.te b/touch/stm/sepolicy/property.te deleted file mode 100644 index adb5c0d..0000000 --- a/touch/stm/sepolicy/property.te +++ /dev/null @@ -1,2 +0,0 @@ -vendor_internal_prop(vendor_touch_dump_path_prop) - diff --git a/touch/stm/sepolicy/property_contexts b/touch/stm/sepolicy/property_contexts deleted file mode 100644 index db9fd5a..0000000 --- a/touch/stm/sepolicy/property_contexts +++ /dev/null @@ -1,2 +0,0 @@ -ro.vendor.touch.dump. u:object_r:vendor_touch_dump_path_prop:s0 - diff --git a/touch/stm/sepolicy/vendor_init.te b/touch/stm/sepolicy/vendor_init.te deleted file mode 100644 index 74a6666..0000000 --- a/touch/stm/sepolicy/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, vendor_touch_dump_path_prop) diff --git a/touch/stm/stm11.mk b/touch/stm/stm11.mk deleted file mode 100644 index 37d28de..0000000 --- a/touch/stm/stm11.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi11/spi11.0 -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts/driver_test - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/sepolicy - -PRODUCT_PACKAGES += dump_stm.sh diff --git a/touch/stm/stm20.mk b/touch/stm/stm20.mk deleted file mode 100644 index b1034e2..0000000 --- a/touch/stm/stm20.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi20/spi20.0 -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts/driver_test - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/sepolicy - -PRODUCT_PACKAGES += dump_stm.sh diff --git a/touch/stm/stm6.mk b/touch/stm/stm6.mk deleted file mode 100644 index bf6e420..0000000 --- a/touch/stm/stm6.mk +++ /dev/null @@ -1,6 +0,0 @@ -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi6/spi6.0 -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.proc=/proc/fts_ext/driver_test - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/stm/sepolicy - -PRODUCT_PACKAGES += dump_stm.sh diff --git a/touch/syna/Android.bp b/touch/syna/Android.bp deleted file mode 100644 index d34ee95..0000000 --- a/touch/syna/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_syna.sh", - src: "dump_syna.sh", - init_rc: ["init.touch.syna.rc"], - vendor: true, - sub_dir: "dump", -} - -sh_binary { - name: "predump_syna.sh", - src: "dump_syna.sh", - init_rc: ["init.touch.syna.rc"], - vendor: true, - sub_dir: "dump_touch", -} diff --git a/touch/syna/dump_syna.sh b/touch/syna/dump_syna.sh deleted file mode 100644 index d749eff..0000000 --- a/touch/syna/dump_syna.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/vendor/bin/sh -path=`getprop ro.vendor.touch.dump.sys` - -echo "Enable Force Touch Active" -echo 21 > $path/force_active - -echo "Touch Firmware Information" -cat $path/info - -echo "Get Raw Data - Delta" -echo 12 > $path/get_raw_data && cat $path/get_raw_data - -echo "Get Raw Data - Raw" -echo 13 > $path/get_raw_data && cat $path/get_raw_data - -echo "Get Raw Data - Baseline" -echo 14 > $path/get_raw_data && cat $path/get_raw_data - -echo "Disable Force Touch Active" -echo 20 > $path/force_active - diff --git a/touch/syna/init.touch.syna.rc b/touch/syna/init.touch.syna.rc deleted file mode 100644 index d52ed3b..0000000 --- a/touch/syna/init.touch.syna.rc +++ /dev/null @@ -1,5 +0,0 @@ -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 diff --git a/touch/syna/predump_sepolicy/file.te b/touch/syna/predump_sepolicy/file.te deleted file mode 100644 index 3e53ec3..0000000 --- a/touch/syna/predump_sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type sysfs_touch, sysfs_type, fs_type; - diff --git a/touch/syna/predump_sepolicy/file_contexts b/touch/syna/predump_sepolicy/file_contexts deleted file mode 100644 index 37dec52..0000000 --- a/touch/syna/predump_sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump_touch/predump_syna\.sh u:object_r:predump_touch_exec:s0 - diff --git a/touch/syna/predump_sepolicy/genfs_contexts b/touch/syna/predump_sepolicy/genfs_contexts deleted file mode 100644 index f2e675f..0000000 --- a/touch/syna/predump_sepolicy/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/touch/syna/predump_sepolicy/predump_touch.te b/touch/syna/predump_sepolicy/predump_touch.te deleted file mode 100644 index 8564ec9..0000000 --- a/touch/syna/predump_sepolicy/predump_touch.te +++ /dev/null @@ -1,5 +0,0 @@ - -allow predump_touch sysfs_touch:dir r_dir_perms; -allow predump_touch sysfs_touch:file rw_file_perms; - -get_prop(predump_touch, vendor_touch_dump_path_prop) diff --git a/touch/syna/predump_sepolicy/property.te b/touch/syna/predump_sepolicy/property.te deleted file mode 100644 index 5484690..0000000 --- a/touch/syna/predump_sepolicy/property.te +++ /dev/null @@ -1 +0,0 @@ -vendor_internal_prop(vendor_touch_dump_path_prop) diff --git a/touch/syna/predump_sepolicy/property_contexts b/touch/syna/predump_sepolicy/property_contexts deleted file mode 100644 index 524cc8b..0000000 --- a/touch/syna/predump_sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -ro.vendor.touch.dump. u:object_r:vendor_touch_dump_path_prop:s0 diff --git a/touch/syna/predump_sepolicy/vendor_init.te b/touch/syna/predump_sepolicy/vendor_init.te deleted file mode 100644 index 74a6666..0000000 --- a/touch/syna/predump_sepolicy/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, vendor_touch_dump_path_prop) diff --git a/touch/syna/predump_syna19.mk b/touch/syna/predump_syna19.mk deleted file mode 100644 index e896fb7..0000000 --- a/touch/syna/predump_syna19.mk +++ /dev/null @@ -1,5 +0,0 @@ -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/predump_sepolicy - -PRODUCT_PACKAGES += predump_syna.sh diff --git a/touch/syna/predump_syna20.mk b/touch/syna/predump_syna20.mk deleted file mode 100644 index e331956..0000000 --- a/touch/syna/predump_syna20.mk +++ /dev/null @@ -1,5 +0,0 @@ -PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/predump_sepolicy - -PRODUCT_PACKAGES += predump_syna.sh diff --git a/touch/syna/sepolicy/dump_syna.te b/touch/syna/sepolicy/dump_syna.te deleted file mode 100644 index fb9705c..0000000 --- a/touch/syna/sepolicy/dump_syna.te +++ /dev/null @@ -1,8 +0,0 @@ -pixel_bugreport(dump_syna) - -allow dump_syna sysfs_touch:dir r_dir_perms; -allow dump_syna sysfs_touch:file rw_file_perms; -allow dump_syna vendor_toolbox_exec:file execute_no_trans; - -get_prop(dump_syna, vendor_touch_dump_path_prop) - diff --git a/touch/syna/sepolicy/file.te b/touch/syna/sepolicy/file.te deleted file mode 100644 index 3e53ec3..0000000 --- a/touch/syna/sepolicy/file.te +++ /dev/null @@ -1,2 +0,0 @@ -type sysfs_touch, sysfs_type, fs_type; - diff --git a/touch/syna/sepolicy/file_contexts b/touch/syna/sepolicy/file_contexts deleted file mode 100644 index 40d5707..0000000 --- a/touch/syna/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/vendor/bin/dump/dump_syna\.sh u:object_r:dump_syna_exec:s0 - diff --git a/touch/syna/sepolicy/genfs_contexts b/touch/syna/sepolicy/genfs_contexts deleted file mode 100644 index f2e675f..0000000 --- a/touch/syna/sepolicy/genfs_contexts +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/touch/syna/sepolicy/property.te b/touch/syna/sepolicy/property.te deleted file mode 100644 index 5484690..0000000 --- a/touch/syna/sepolicy/property.te +++ /dev/null @@ -1 +0,0 @@ -vendor_internal_prop(vendor_touch_dump_path_prop) diff --git a/touch/syna/sepolicy/property_contexts b/touch/syna/sepolicy/property_contexts deleted file mode 100644 index 524cc8b..0000000 --- a/touch/syna/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -ro.vendor.touch.dump. u:object_r:vendor_touch_dump_path_prop:s0 diff --git a/touch/syna/sepolicy/vendor_init.te b/touch/syna/sepolicy/vendor_init.te deleted file mode 100644 index 74a6666..0000000 --- a/touch/syna/sepolicy/vendor_init.te +++ /dev/null @@ -1 +0,0 @@ -set_prop(vendor_init, vendor_touch_dump_path_prop) diff --git a/touch/syna/syna0.mk b/touch/syna/syna0.mk deleted file mode 100644 index 9e10d2a..0000000 --- a/touch/syna/syna0.mk +++ /dev/null @@ -1,5 +0,0 @@ -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 - -PRODUCT_PACKAGES += dump_syna.sh diff --git a/touch/syna/syna19.mk b/touch/syna/syna19.mk deleted file mode 100644 index 45b053b..0000000 --- a/touch/syna/syna19.mk +++ /dev/null @@ -1,5 +0,0 @@ -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 diff --git a/touch/syna/syna20.mk b/touch/syna/syna20.mk deleted file mode 100644 index f8c0251..0000000 --- a/touch/syna/syna20.mk +++ /dev/null @@ -1,5 +0,0 @@ -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 - -PRODUCT_PACKAGES += dump_syna.sh diff --git a/touch/touchinspector/sepolicy/file.te b/touch/touchinspector/sepolicy/file.te deleted file mode 100644 index f9468a0..0000000 --- a/touch/touchinspector/sepolicy/file.te +++ /dev/null @@ -1,3 +0,0 @@ -userdebug_or_eng(` - typeattribute proc_touch mlstrustedobject; -') diff --git a/touch/touchinspector/sepolicy/google_touch_app.te b/touch/touchinspector/sepolicy/google_touch_app.te deleted file mode 100644 index 0c6928d..0000000 --- a/touch/touchinspector/sepolicy/google_touch_app.te +++ /dev/null @@ -1,9 +0,0 @@ -type google_touch_app, domain; - -userdebug_or_eng(` - app_domain(google_touch_app) - - allow google_touch_app app_api_service:service_manager find; - - allow google_touch_app proc_touch:file rw_file_perms; -') diff --git a/touch/touchinspector/sepolicy/seapp_contexts b/touch/touchinspector/sepolicy/seapp_contexts deleted file mode 100644 index 659caf4..0000000 --- a/touch/touchinspector/sepolicy/seapp_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Touch app -user=_app seinfo=platform name=com.google.touch.touchinspector domain=google_touch_app type=app_data_file levelFrom=user diff --git a/touch/touchinspector/touchinspector.mk b/touch/touchinspector/touchinspector.mk deleted file mode 100644 index 040802c..0000000 --- a/touch/touchinspector/touchinspector.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/touchinspector/sepolicy diff --git a/touch/twoshay/aidl/compatibility_matrix_gs101.xml b/touch/twoshay/aidl/compatibility_matrix_gs101.xml deleted file mode 100644 index 848051e..0000000 --- a/touch/twoshay/aidl/compatibility_matrix_gs101.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - com.google.input - 2-5 - - ITouchContextService - default - - - diff --git a/touch/twoshay/aidl/compatibility_matrix_zuma.xml b/touch/twoshay/aidl/compatibility_matrix_zuma.xml deleted file mode 100644 index 309e5bd..0000000 --- a/touch/twoshay/aidl/compatibility_matrix_zuma.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - com.google.input - 2-5 - - ITouchContextService - default - - - - com.google.input - 5 - - ITwoshayNotificationService - default - - - - com.google.input.algos.gril - 2-5 - - IGrilAntennaTuningService - default - - - - com.google.input.algos.spd - 2-5 - - IScreenProtectorDetectorService - default - - - diff --git a/touch/twoshay/aidl/manifest_gs101.xml b/touch/twoshay/aidl/manifest_gs101.xml deleted file mode 100644 index a8e389d..0000000 --- a/touch/twoshay/aidl/manifest_gs101.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - com.google.input - 5 - - ITouchContextService - default - - - diff --git a/touch/twoshay/aidl/manifest_zuma.xml b/touch/twoshay/aidl/manifest_zuma.xml deleted file mode 100644 index 67bb212..0000000 --- a/touch/twoshay/aidl/manifest_zuma.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - com.google.input - 5 - - ITouchContextService - default - - - - com.google.input - 5 - - ITwoshayNotificationService - default - - - - com.google.input.algos.gril - 5 - - IGrilAntennaTuningService - default - - - - com.google.input.algos.spd - 5 - - IScreenProtectorDetectorService - default - - - diff --git a/touch/twoshay/aidl_gs101.mk b/touch/twoshay/aidl_gs101.mk deleted file mode 100644 index 1676cba..0000000 --- a/touch/twoshay/aidl_gs101.mk +++ /dev/null @@ -1,2 +0,0 @@ -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 diff --git a/touch/twoshay/aidl_zuma.mk b/touch/twoshay/aidl_zuma.mk deleted file mode 100644 index 48714fe..0000000 --- a/touch/twoshay/aidl_zuma.mk +++ /dev/null @@ -1,2 +0,0 @@ -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 diff --git a/touch/twoshay/sepolicy/device.te b/touch/twoshay/sepolicy/device.te deleted file mode 100644 index d3ce622..0000000 --- a/touch/twoshay/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type touch_offload_device, dev_type; diff --git a/touch/twoshay/sepolicy/dumpstate.te b/touch/twoshay/sepolicy/dumpstate.te deleted file mode 100644 index 90f14b8..0000000 --- a/touch/twoshay/sepolicy/dumpstate.te +++ /dev/null @@ -1,2 +0,0 @@ -allow dumpstate touch_context_service:service_manager find; -binder_call(dumpstate, twoshay) diff --git a/touch/twoshay/sepolicy/file_contexts b/touch/twoshay/sepolicy/file_contexts deleted file mode 100644 index 09728be..0000000 --- a/touch/twoshay/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -/dev/touch_offload u:object_r:touch_offload_device:s0 -/vendor/bin/twoshay u:object_r:twoshay_exec:s0 diff --git a/touch/twoshay/sepolicy/hal_dumpstate_default.te b/touch/twoshay/sepolicy/hal_dumpstate_default.te deleted file mode 100644 index 81edc36..0000000 --- a/touch/twoshay/sepolicy/hal_dumpstate_default.te +++ /dev/null @@ -1,2 +0,0 @@ -allow hal_dumpstate_default touch_context_service:service_manager find; -binder_call(hal_dumpstate_default, twoshay) diff --git a/touch/twoshay/sepolicy/platform_app.te b/touch/twoshay/sepolicy/platform_app.te deleted file mode 100644 index fe3318d..0000000 --- a/touch/twoshay/sepolicy/platform_app.te +++ /dev/null @@ -1,5 +0,0 @@ -allow platform_app gril_antenna_tuning_service:service_manager find; -allow platform_app screen_protector_detector_service:service_manager find; -allow platform_app touch_context_service:service_manager find; -allow platform_app twoshay_notification_service:service_manager find; -binder_call(platform_app, twoshay) diff --git a/touch/twoshay/sepolicy/service.te b/touch/twoshay/sepolicy/service.te deleted file mode 100644 index dd7720c..0000000 --- a/touch/twoshay/sepolicy/service.te +++ /dev/null @@ -1,4 +0,0 @@ -type gril_antenna_tuning_service, service_manager_type, hal_service_type; -type screen_protector_detector_service, service_manager_type, hal_service_type; -type touch_context_service, service_manager_type, hal_service_type; -type twoshay_notification_service, service_manager_type, hal_service_type; diff --git a/touch/twoshay/sepolicy/service_contexts b/touch/twoshay/sepolicy/service_contexts deleted file mode 100644 index 76dc4b9..0000000 --- a/touch/twoshay/sepolicy/service_contexts +++ /dev/null @@ -1,4 +0,0 @@ -com.google.input.ITouchContextService/default u:object_r:touch_context_service:s0 -com.google.input.ITwoshayNotificationService/default u:object_r:twoshay_notification_service:s0 -com.google.input.algos.gril.IGrilAntennaTuningService/default u:object_r:gril_antenna_tuning_service:s0 -com.google.input.algos.spd.IScreenProtectorDetectorService/default u:object_r:screen_protector_detector_service:s0 diff --git a/touch/twoshay/sepolicy/twoshay.te b/touch/twoshay/sepolicy/twoshay.te deleted file mode 100644 index e910ff9..0000000 --- a/touch/twoshay/sepolicy/twoshay.te +++ /dev/null @@ -1,28 +0,0 @@ -type twoshay, domain; -type twoshay_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(twoshay) - -allow twoshay touch_offload_device:chr_file rw_file_perms; -allow twoshay twoshay:capability sys_nice; - -binder_use(twoshay) -add_service(twoshay, gril_antenna_tuning_service) -add_service(twoshay, screen_protector_detector_service) -add_service(twoshay, touch_context_service) -add_service(twoshay, twoshay_notification_service) - -binder_call(twoshay, platform_app) - -allow twoshay fwk_stats_service:service_manager find; -binder_call(twoshay, stats_service_server) - -# Allow dumpsys output in bugreports. -allow twoshay dumpstate:fd use; -allow twoshay dumpstate:fifo_file write; - -# b/198755236 -dontaudit twoshay twoshay:capability dac_override; - -# b/226830650 -dontaudit twoshay boot_status_prop:file read; diff --git a/touch/twoshay/twoshay.mk b/touch/twoshay/twoshay.mk deleted file mode 100644 index 560ef5c..0000000 --- a/touch/twoshay/twoshay.mk +++ /dev/null @@ -1,2 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/twoshay/sepolicy -PRODUCT_PACKAGES += twoshay diff --git a/trusty/Android.bp b/trusty/Android.bp deleted file mode 100644 index 536fbd3..0000000 --- a/trusty/Android.bp +++ /dev/null @@ -1,10 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -sh_binary { - name: "dump_trusty.sh", - src: "dump_trusty.sh", - vendor: true, - sub_dir: "dump", -} diff --git a/trusty/dump_trusty.sh b/trusty/dump_trusty.sh deleted file mode 100644 index 9592cd3..0000000 --- a/trusty/dump_trusty.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/vendor/bin/sh -echo "--- Trusty TEE0 Logs ---" -cat /dev/trusty-log0 diff --git a/trusty/rpmb_dev/rpmb_dev.mk b/trusty/rpmb_dev/rpmb_dev.mk deleted file mode 100644 index 31c68ef..0000000 --- a/trusty/rpmb_dev/rpmb_dev.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/trusty/rpmb_dev/sepolicy - -PRODUCT_PACKAGES += rpmb_dev diff --git a/trusty/rpmb_dev/sepolicy/file_contexts b/trusty/rpmb_dev/sepolicy/file_contexts deleted file mode 100644 index 1a44f7d..0000000 --- a/trusty/rpmb_dev/sepolicy/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Binaries -/vendor/bin/rpmb_dev u:object_r:rpmb_dev_exec:s0 diff --git a/trusty/rpmb_dev/sepolicy/rpmb_dev.te b/trusty/rpmb_dev/sepolicy/rpmb_dev.te deleted file mode 100644 index 0f46e03..0000000 --- a/trusty/rpmb_dev/sepolicy/rpmb_dev.te +++ /dev/null @@ -1,4 +0,0 @@ -type rpmb_dev, domain; -type rpmb_dev_exec, vendor_file_type, exec_type, file_type; - -init_daemon_domain(rpmb_dev) diff --git a/trusty/sepolicy/device.te b/trusty/sepolicy/device.te deleted file mode 100644 index bb85670..0000000 --- a/trusty/sepolicy/device.te +++ /dev/null @@ -1 +0,0 @@ -type trusty_log_device, dev_type; diff --git a/trusty/sepolicy/dump_trusty.te b/trusty/sepolicy/dump_trusty.te deleted file mode 100644 index d4e0d6e..0000000 --- a/trusty/sepolicy/dump_trusty.te +++ /dev/null @@ -1,4 +0,0 @@ -pixel_bugreport(dump_trusty) - -allow dump_trusty trusty_log_device:chr_file r_file_perms; -allow dump_trusty vendor_toolbox_exec:file execute_no_trans; diff --git a/trusty/sepolicy/file_contexts b/trusty/sepolicy/file_contexts deleted file mode 100644 index d961e84..0000000 --- a/trusty/sepolicy/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/bin/dump/dump_trusty\.sh u:object_r:dump_trusty_exec:s0 - -/dev/trusty-log0 u:object_r:trusty_log_device:s0 diff --git a/trusty/sepolicy/tee.te b/trusty/sepolicy/tee.te deleted file mode 100644 index 50aab69..0000000 --- a/trusty/sepolicy/tee.te +++ /dev/null @@ -1 +0,0 @@ -allow tee sg_device:chr_file rw_file_perms; diff --git a/trusty/trusty.mk b/trusty/trusty.mk deleted file mode 100644 index 1786817..0000000 --- a/trusty/trusty.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/trusty/sepolicy - -PRODUCT_PACKAGES += dump_trusty.sh diff --git a/tts/de-de/de-de-x-multi-r57.zvoice b/tts/de-de/de-de-x-multi-r57.zvoice deleted file mode 100644 index 1660eab..0000000 Binary files a/tts/de-de/de-de-x-multi-r57.zvoice and /dev/null differ diff --git a/tts/es-es/es-es-x-multi-r56.zvoice b/tts/es-es/es-es-x-multi-r56.zvoice deleted file mode 100644 index a63cdc4..0000000 Binary files a/tts/es-es/es-es-x-multi-r56.zvoice and /dev/null differ diff --git a/tts/fr-fr/fr-fr-x-multi-r57.zvoice b/tts/fr-fr/fr-fr-x-multi-r57.zvoice deleted file mode 100644 index 4aa6148..0000000 Binary files a/tts/fr-fr/fr-fr-x-multi-r57.zvoice and /dev/null differ diff --git a/tts/it-it/it-it-x-multi-r54.zvoice b/tts/it-it/it-it-x-multi-r54.zvoice deleted file mode 100644 index e016410..0000000 Binary files a/tts/it-it/it-it-x-multi-r54.zvoice and /dev/null differ diff --git a/tts/ja-jp/ja-jp-x-multi-r55.zvoice b/tts/ja-jp/ja-jp-x-multi-r55.zvoice deleted file mode 100644 index c8d3f15..0000000 Binary files a/tts/ja-jp/ja-jp-x-multi-r55.zvoice and /dev/null differ diff --git a/tts/voice_packs.mk b/tts/voice_packs.mk deleted file mode 100644 index 204da3b..0000000 --- a/tts/voice_packs.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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. - -# Voice packs for Text-To-Speech -PRODUCT_COPY_FILES += \ - device/google/gs-common/tts/ja-jp/ja-jp-x-multi-r55.zvoice:product/tts/google/ja-jp/ja-jp-x-multi-r55.zvoice\ - device/google/gs-common/tts/fr-fr/fr-fr-x-multi-r57.zvoice:product/tts/google/fr-fr/fr-fr-x-multi-r57.zvoice\ - device/google/gs-common/tts/de-de/de-de-x-multi-r57.zvoice:product/tts/google/de-de/de-de-x-multi-r57.zvoice\ - device/google/gs-common/tts/it-it/it-it-x-multi-r54.zvoice:product/tts/google/it-it/it-it-x-multi-r54.zvoice\ - device/google/gs-common/tts/es-es/es-es-x-multi-r56.zvoice:product/tts/google/es-es/es-es-x-multi-r56.zvoice diff --git a/umfw_stat/Android.bp b/umfw_stat/Android.bp deleted file mode 100644 index 765c4be..0000000 --- a/umfw_stat/Android.bp +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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. -// - -// Package defs. -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -// UmfwStat dump tool binary. -cc_binary { - name: "dump_umfw_stat", - srcs: ["dump_umfw_stat.cpp"], - cflags: [ - "-Wall", - "-Werror", - "-Wextra", - ], - shared_libs: [ - "libdump", - ], - vendor: true, - relative_install_path: "dump", -} diff --git a/umfw_stat/dump_umfw_stat.cpp b/umfw_stat/dump_umfw_stat.cpp deleted file mode 100644 index 6c3594d..0000000 --- a/umfw_stat/dump_umfw_stat.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// 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. -// - -// -// UmfwStat dump tool. -// - -#include - -int main() { - // Set stdout to be unbuffered. - setbuf(stdout, NULL); - - // Dump AoC statistics. - // TODO(b/272300997): Add timeouts for requests. - runCommand("AoC A32 statistics", - "timeout 0.5 /vendor/bin/umfw_stat_tool -s aoc:1 get_all"); - runCommand("AoC FF1 statistics", - "timeout 0.5 /vendor/bin/umfw_stat_tool -s aoc:2 get_all"); - runCommand("AoC HF0 statistics", - "timeout 0.5 /vendor/bin/umfw_stat_tool -s aoc:3 get_all"); - runCommand("AoC HF1 statistics", - "timeout 0.5 /vendor/bin/umfw_stat_tool -s aoc:4 get_all"); - - return 0; -} - diff --git a/umfw_stat/sepolicy/dump_umfw_stat.te b/umfw_stat/sepolicy/dump_umfw_stat.te deleted file mode 100644 index dac2d25..0000000 --- a/umfw_stat/sepolicy/dump_umfw_stat.te +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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. -# - -# -# UmfwStat dump tool type enforcing file. -# - -pixel_bugreport(dump_umfw_stat) -allow dump_umfw_stat aoc_device:chr_file rw_file_perms; -allow dump_umfw_stat device:dir r_dir_perms; -allow dump_umfw_stat vendor_shell_exec:file execute_no_trans; -allow dump_umfw_stat vendor_umfw_stat_tool:file execute_no_trans; -allow dump_umfw_stat vendor_toolbox_exec:file execute_no_trans; - diff --git a/umfw_stat/sepolicy/file.te b/umfw_stat/sepolicy/file.te deleted file mode 100644 index 239ce5a..0000000 --- a/umfw_stat/sepolicy/file.te +++ /dev/null @@ -1,21 +0,0 @@ -# -# 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. -# - -# -# UmfwStat type enforcing file. -# - -type vendor_umfw_stat_tool, vendor_file_type, file_type; diff --git a/umfw_stat/sepolicy/file_contexts b/umfw_stat/sepolicy/file_contexts deleted file mode 100644 index 876ba67..0000000 --- a/umfw_stat/sepolicy/file_contexts +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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. -# - -# -# UmfwStat security contexts. -# - -/vendor/bin/dump/dump_umfw_stat u:object_r:dump_umfw_stat_exec:s0 -/vendor/bin/umfw_stat_tool u:object_r:vendor_umfw_stat_tool:s0 diff --git a/umfw_stat/umfw_stat.mk b/umfw_stat/umfw_stat.mk deleted file mode 100644 index 102e63f..0000000 --- a/umfw_stat/umfw_stat.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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. -# - -# -# UmfwStat product makefile. -# - -# Add UmfwStat product packages. -PRODUCT_PACKAGES += dump_umfw_stat -PRODUCT_PACKAGES += umfw_stat_tool - -# Add UmfwStat SELinx policy. -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/umfw_stat/sepolicy - diff --git a/vibrator/flags/Android.bp b/vibrator/flags/Android.bp deleted file mode 100644 index 69824cc..0000000 --- a/vibrator/flags/Android.bp +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (C) 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. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -aconfig_declarations { - name: "VibratorFlagsL26Private", - package: "vendor.vibrator.hal.flags", - container: "vendor", - exportable: true, - srcs: ["VibratorFlags.aconfig"], -} - -cc_aconfig_library { - name: "PixelVibratorFlagsL26Private", - aconfig_declarations: "VibratorFlagsL26Private", - vendor_available: true, - visibility: [ - "//vendor:__subpackages__", - "//device/google/felix:__subpackages__", - ], -} - -java_aconfig_library { - name: "PixelVibratorFlagsL26Private_java", - aconfig_declarations: "VibratorFlagsL26Private", - mode: "exported", - visibility: ["//vendor:__subpackages__"], -} diff --git a/vibrator/flags/VibratorFlags.aconfig b/vibrator/flags/VibratorFlags.aconfig deleted file mode 100644 index 3e0a6fd..0000000 --- a/vibrator/flags/VibratorFlags.aconfig +++ /dev/null @@ -1,18 +0,0 @@ -package: "vendor.vibrator.hal.flags" -container: "vendor" - -flag { - name: "remove_capo" - namespace: "vibrator" - is_exported: true - description: "This flag controls the removal of utilizing Capo at the HAL level" - bug: "290223630" -} - -flag { - name: "enable_pwle_v2" - namespace: "vibrator" - is_exported: true - description: "This flag enables the PWLE V2 APIs guarded by the CAP_COMPOSE_PWLE_EFFECTS_V2 compatability" - bug: "346570576" -} \ No newline at end of file diff --git a/vintf/framework_compatibility_matrix.xml b/vintf/framework_compatibility_matrix.xml deleted file mode 100644 index b498138..0000000 --- a/vintf/framework_compatibility_matrix.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - aocx - 1-2 - - IAocx - default - - - - com.google.flood - 1-2 - - IFloodService - default - - - - vendor.google.aam - 1-3 - - IAam - default - - - diff --git a/widevine/sepolicy/file.te b/widevine/sepolicy/file.te deleted file mode 100644 index a1e4e0e..0000000 --- a/widevine/sepolicy/file.te +++ /dev/null @@ -1,3 +0,0 @@ -# Widevine DRM -type mediadrm_vendor_data_file, file_type, data_file_type; - diff --git a/widevine/sepolicy/file_contexts b/widevine/sepolicy/file_contexts deleted file mode 100644 index 92aed3c..0000000 --- a/widevine/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/bin/hw/android\.hardware\.drm-service\.widevine u:object_r:hal_drm_widevine_exec:s0 -/vendor/bin/hw/android\.hardware\.drm-service\.clearkey u:object_r:hal_drm_clearkey_exec:s0 - -# Data -/data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0 diff --git a/widevine/sepolicy/hal_drm_clearkey.te b/widevine/sepolicy/hal_drm_clearkey.te deleted file mode 100644 index fff4f0d..0000000 --- a/widevine/sepolicy/hal_drm_clearkey.te +++ /dev/null @@ -1,6 +0,0 @@ -# sepolicy for DRM clearkey -type hal_drm_clearkey, domain; -type hal_drm_clearkey_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(hal_drm_clearkey) - -hal_server_domain(hal_drm_clearkey, hal_drm) diff --git a/widevine/sepolicy/hal_drm_widevine.te b/widevine/sepolicy/hal_drm_widevine.te deleted file mode 100644 index 98b49e6..0000000 --- a/widevine/sepolicy/hal_drm_widevine.te +++ /dev/null @@ -1,14 +0,0 @@ -# sepolicy for DRM widevine -type hal_drm_widevine, domain; -type hal_drm_widevine_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(hal_drm_widevine) - -hal_server_domain(hal_drm_widevine, hal_drm) - -# L3 -allow hal_drm_widevine mediadrm_vendor_data_file:file create_file_perms; -allow hal_drm_widevine mediadrm_vendor_data_file:dir create_dir_perms; - -#L1 -allow hal_drm_widevine dmabuf_system_heap_device:chr_file r_file_perms; - diff --git a/widevine/sepolicy/service_contexts b/widevine/sepolicy/service_contexts deleted file mode 100644 index 6989dde..0000000 --- a/widevine/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -android.hardware.drm.IDrmFactory/widevine u:object_r:hal_drm_service:s0 diff --git a/widevine/widevine.mk b/widevine/widevine.mk deleted file mode 100644 index 1e34c5a..0000000 --- a/widevine/widevine.mk +++ /dev/null @@ -1,2 +0,0 @@ -PRODUCT_PACKAGES += \ - android.hardware.drm-service.clearkey \ diff --git a/widevine/widevine_v2.mk b/widevine/widevine_v2.mk deleted file mode 100644 index 5cd914b..0000000 --- a/widevine/widevine_v2.mk +++ /dev/null @@ -1,2 +0,0 @@ -include device/google/gs-common/widevine/widevine.mk -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/widevine/sepolicy/ \ No newline at end of file diff --git a/wireless_charger/compatibility_matrix.xml b/wireless_charger/compatibility_matrix.xml deleted file mode 100644 index f1fe6ae..0000000 --- a/wireless_charger/compatibility_matrix.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - vendor.google.wireless_charger - 1-4 - - IWirelessCharger - default - - - - vendor.google.wireless_charger.service - 1-2 - - IWlcService - default - - - diff --git a/wireless_charger/sepolicy/dumpstate.te b/wireless_charger/sepolicy/dumpstate.te deleted file mode 100644 index 3c5fac3..0000000 --- a/wireless_charger/sepolicy/dumpstate.te +++ /dev/null @@ -1 +0,0 @@ -binder_call(dumpstate, hal_wlcservice) diff --git a/wireless_charger/sepolicy/file.te b/wireless_charger/sepolicy/file.te deleted file mode 100644 index 6dd54c8..0000000 --- a/wireless_charger/sepolicy/file.te +++ /dev/null @@ -1 +0,0 @@ -type vendor_wlc_file, file_type, data_file_type; diff --git a/wireless_charger/sepolicy/file_contexts b/wireless_charger/sepolicy/file_contexts deleted file mode 100644 index 98796a9..0000000 --- a/wireless_charger/sepolicy/file_contexts +++ /dev/null @@ -1,5 +0,0 @@ -/vendor/bin/hw/vendor\.google\.wireless_charger-default u:object_r:hal_wireless_charger_exec:s0 -/vendor/bin/hw/vendor\.google\.wireless_charger\.service-default u:object_r:hal_wlcservice_exec:s0 - -# Data -/data/vendor/wireless_charger(/.*)? u:object_r:vendor_wlc_file:s0 diff --git a/wireless_charger/sepolicy/hal_dumpstate_default.te b/wireless_charger/sepolicy/hal_dumpstate_default.te deleted file mode 100644 index 748345c..0000000 --- a/wireless_charger/sepolicy/hal_dumpstate_default.te +++ /dev/null @@ -1,3 +0,0 @@ -allow hal_dumpstate_default sysfs_wlc:dir search; -allow hal_dumpstate_default sysfs_wlc:dir r_dir_perms; -allow hal_dumpstate_default sysfs_wlc:file r_file_perms; diff --git a/wireless_charger/sepolicy/hal_googlebattery.te b/wireless_charger/sepolicy/hal_googlebattery.te deleted file mode 100644 index 6c9d3fb..0000000 --- a/wireless_charger/sepolicy/hal_googlebattery.te +++ /dev/null @@ -1,4 +0,0 @@ -# wlc permission for googlebattery -r_dir_file(hal_googlebattery, sysfs_wlc) -allow hal_googlebattery sysfs_wlc:file rw_file_perms; -set_prop(hal_googlebattery, vendor_wlcservice_prop) diff --git a/wireless_charger/sepolicy/hal_health_default.te b/wireless_charger/sepolicy/hal_health_default.te deleted file mode 100644 index 51ef352..0000000 --- a/wireless_charger/sepolicy/hal_health_default.te +++ /dev/null @@ -1 +0,0 @@ -allow hal_health_default sysfs_wlc:dir search; diff --git a/wireless_charger/sepolicy/hal_sensors_default.te b/wireless_charger/sepolicy/hal_sensors_default.te deleted file mode 100644 index ed0efd0..0000000 --- a/wireless_charger/sepolicy/hal_sensors_default.te +++ /dev/null @@ -1 +0,0 @@ -allow hal_sensors_default sysfs_wlc:dir r_dir_perms; diff --git a/wireless_charger/sepolicy/hal_wireless_charger.te b/wireless_charger/sepolicy/hal_wireless_charger.te deleted file mode 100644 index f17703e..0000000 --- a/wireless_charger/sepolicy/hal_wireless_charger.te +++ /dev/null @@ -1,21 +0,0 @@ -init_daemon_domain(hal_wireless_charger) - -r_dir_file(hal_wireless_charger, sysfs_batteryinfo) -r_dir_file(hal_wireless_charger, sysfs_wlc) - -allow hal_wireless_charger sysfs_batteryinfo:file rw_file_perms; -allow hal_wireless_charger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; -allow hal_wireless_charger sysfs_wlc:file rw_file_perms; - -set_prop(hal_wireless_charger, vendor_wlcservice_prop) - -binder_call(hal_wireless_charger, servicemanager) -add_service(hal_wireless_charger, hal_wireless_charger_service) - -userdebug_or_eng(` - domain_auto_trans(shell, hal_wireless_charger_exec, hal_wireless_charger) -') - -binder_call(hal_wireless_charger, platform_app) -binder_call(hal_wireless_charger, system_app) -binder_call(hal_wireless_charger, hal_wlcservice) diff --git a/wireless_charger/sepolicy/hal_wlcservice.te b/wireless_charger/sepolicy/hal_wlcservice.te deleted file mode 100644 index bcda19d..0000000 --- a/wireless_charger/sepolicy/hal_wlcservice.te +++ /dev/null @@ -1,21 +0,0 @@ -# wlcservice hal type and permission -type hal_wlcservice, domain; -type hal_wlcservice_exec, exec_type, vendor_file_type, file_type; - -init_daemon_domain(hal_wlcservice) - -allow hal_wlcservice vendor_wlc_file:dir create_dir_perms; -allow hal_wlcservice vendor_wlc_file:file create_file_perms; -allow hal_wlcservice hal_wireless_charger_service:service_manager find; -allow hal_wlcservice kmsg_device:chr_file { getattr w_file_perms }; - -set_prop(hal_wlcservice, vendor_wlcservice_prop) - -binder_call(hal_wlcservice, servicemanager) -add_service(hal_wlcservice, hal_wlcservice_service) - -userdebug_or_eng(` - domain_auto_trans(shell, hal_wlcservice_exec, hal_wlcservice) -') - -binder_call(hal_wlcservice, hal_wireless_charger) diff --git a/wireless_charger/sepolicy/pixelstats_vendor.te b/wireless_charger/sepolicy/pixelstats_vendor.te deleted file mode 100644 index cc2bd92..0000000 --- a/wireless_charger/sepolicy/pixelstats_vendor.te +++ /dev/null @@ -1,3 +0,0 @@ -# Wireless charge -allow pixelstats_vendor sysfs_wlc:dir search; -allow pixelstats_vendor sysfs_wlc:file rw_file_perms; diff --git a/wireless_charger/sepolicy/property.te b/wireless_charger/sepolicy/property.te deleted file mode 100644 index 7cf9903..0000000 --- a/wireless_charger/sepolicy/property.te +++ /dev/null @@ -1,2 +0,0 @@ -# wlcservice property -vendor_internal_prop(vendor_wlcservice_prop) diff --git a/wireless_charger/sepolicy/property_contexts b/wireless_charger/sepolicy/property_contexts deleted file mode 100644 index bcc93f1..0000000 --- a/wireless_charger/sepolicy/property_contexts +++ /dev/null @@ -1,3 +0,0 @@ -vendor.wlcservice.test.authentication u:object_r:vendor_wlcservice_prop:s0 exact bool -vendor.wlcservice.fwupdate.tx u:object_r:vendor_wlcservice_prop:s0 exact enum 0 1 2 3 -vendor.wlcservice.start u:object_r:vendor_wlcservice_prop:s0 exact bool diff --git a/wireless_charger/sepolicy/service.te b/wireless_charger/sepolicy/service.te deleted file mode 100644 index 8f8d87b..0000000 --- a/wireless_charger/sepolicy/service.te +++ /dev/null @@ -1 +0,0 @@ -type hal_wlcservice_service, hal_service_type, protected_service, service_manager_type; diff --git a/wireless_charger/sepolicy/service_contexts b/wireless_charger/sepolicy/service_contexts deleted file mode 100644 index ed2faba..0000000 --- a/wireless_charger/sepolicy/service_contexts +++ /dev/null @@ -1,2 +0,0 @@ -vendor.google.wireless_charger.IWirelessCharger/default u:object_r:hal_wireless_charger_service:s0 -vendor.google.wireless_charger.service.IWlcService/default u:object_r:hal_wlcservice_service:s0 diff --git a/wireless_charger/sepolicy/servicemanager.te b/wireless_charger/sepolicy/servicemanager.te deleted file mode 100644 index 74d7244..0000000 --- a/wireless_charger/sepolicy/servicemanager.te +++ /dev/null @@ -1 +0,0 @@ -binder_call(servicemanager, hal_wlcservice) diff --git a/wireless_charger/sepolicy/shell.te b/wireless_charger/sepolicy/shell.te deleted file mode 100644 index cd4fb18..0000000 --- a/wireless_charger/sepolicy/shell.te +++ /dev/null @@ -1,2 +0,0 @@ -# wlc -dontaudit shell sysfs_wlc:dir search; diff --git a/wireless_charger/wireless_charger.mk b/wireless_charger/wireless_charger.mk deleted file mode 100644 index 4a9b33a..0000000 --- a/wireless_charger/wireless_charger.mk +++ /dev/null @@ -1,5 +0,0 @@ -PRODUCT_PACKAGES += vendor.google.wireless_charger-default -PRODUCT_PACKAGES += vendor.google.wireless_charger.service-default -DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE += device/google/gs-common/wireless_charger/compatibility_matrix.xml - -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/wireless_charger/sepolicy diff --git a/wlan/dump.mk b/wlan/dump.mk deleted file mode 100644 index d0c8b53..0000000 --- a/wlan/dump.mk +++ /dev/null @@ -1 +0,0 @@ -BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/wlan/sepolicy/ diff --git a/wlan/sepolicy/dump_wlan.te b/wlan/sepolicy/dump_wlan.te deleted file mode 100644 index 983d71c..0000000 --- a/wlan/sepolicy/dump_wlan.te +++ /dev/null @@ -1,4 +0,0 @@ - -pixel_bugreport(dump_wlan) - - diff --git a/wlan/sepolicy/file_contexts b/wlan/sepolicy/file_contexts deleted file mode 100644 index 318a610..0000000 --- a/wlan/sepolicy/file_contexts +++ /dev/null @@ -1,3 +0,0 @@ - -/vendor/bin/dump/dump_wlan u:object_r:dump_wlan_exec:s0 -