summaryrefslogtreecommitdiff
authorTellen Yu <tellen.yu@amlogic.com>2020-04-17 12:49:18 (GMT)
committer Robin Lee <rgl@google.com>2020-06-17 07:12:19 (GMT)
commit071641e365caa7b226a8f4e0682d34aea79b7245 (patch)
tree52a98d209b40bc8678a07484fedc41d1c1cb73b3
parent2e24dc8a02056c748eeefaa2e6477bfd60287c4f (diff)
downloadcommon-071641e365caa7b226a8f4e0682d34aea79b7245.zip
common-071641e365caa7b226a8f4e0682d34aea79b7245.tar.gz
common-071641e365caa7b226a8f4e0682d34aea79b7245.tar.bz2
bugreport: move dumpstate HIDL service to hardware [1/4]
PD#SWPL-24649 BUG=158808384 Problem: It's a HIDL service, we should not put it in device/amlogic/common. Solution: 1. move dumpstate HIDL service to hardware/amlogic 2. add sepolicy for hal_dumpstate_default process Verify: newton Merged-In: Ic10f56b9b86e130fcaad148ec09274a94bfa57ec Change-Id: Ic10f56b9b86e130fcaad148ec09274a94bfa57ec Signed-off-by: Tellen Yu <tellen.yu@amlogic.com>
Diffstat
-rw-r--r--dumpstate/Android.mk39
-rw-r--r--dumpstate/DumpstateDevice.cpp76
-rw-r--r--dumpstate/DumpstateDevice.h50
-rw-r--r--dumpstate/NOTICE190
-rw-r--r--dumpstate/android.hardware.dumpstate@1.0-service.droidlogic.rc4
-rw-r--r--dumpstate/service.cpp41
-rwxr-xr-xhidl_manifests/manifest_common.xml9
-rw-r--r--sepolicy/dumpstate.te1
-rwxr-xr-xsepolicy/file.te4
-rw-r--r--sepolicy/file_contexts56
-rw-r--r--sepolicy/hal_dumpstate_default.te13
11 files changed, 54 insertions, 429 deletions
diff --git a/dumpstate/Android.mk b/dumpstate/Android.mk
deleted file mode 100644
index 0e530e4..0000000
--- a/dumpstate/Android.mk
+++ b/dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.dumpstate@1.0-service.droidlogic
-LOCAL_INIT_RC := android.hardware.dumpstate@1.0-service.droidlogic.rc
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := \
- DumpstateDevice.cpp \
- service.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- android.hardware.dumpstate@1.0 \
- libbase \
- libcutils \
- libdumpstateutil \
- libhidlbase \
- libhidltransport \
- libhwbinder \
- liblog \
- libutils
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_PROPRIETARY_MODULE := true
-
-include $(BUILD_EXECUTABLE)
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
deleted file mode 100644
index 898861e..0000000
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 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"
-
-#include "DumpstateDevice.h"
-
-#include <log/log.h>
-
-#include "DumpstateUtil.h"
-
-using android::os::dumpstate::CommandOptions;
-using android::os::dumpstate::DumpFileToFd;
-using android::os::dumpstate::RunCommandToFd;
-
-namespace android {
-namespace hardware {
-namespace dumpstate {
-namespace V1_0 {
-namespace implementation {
-
-// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
-Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
- if (handle == nullptr || handle->numFds < 1) {
- ALOGE("no FDs\n");
- return Void();
- }
-
- int fd = handle->data[0];
- if (fd < 0) {
- ALOGE("invalid FD: %d\n", handle->data[0]);
- return Void();
- }
-
- DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts");
- DumpFileToFd(fd, "RPM Stats", "/d/rpm_stats");
- DumpFileToFd(fd, "Power Management Stats", "/d/rpm_master_stats");
- RunCommandToFd(fd, "SUBSYSTEM TOMBSTONES", {"ls", "-l", "/data/tombstones/ramdump"}, CommandOptions::AS_ROOT);
- DumpFileToFd(fd, "BAM DMUX Log", "/d/ipc_logging/bam_dmux/log");
- DumpFileToFd(fd, "SMD Log", "/d/ipc_logging/smd/log");
- DumpFileToFd(fd, "SMD PKT Log", "/d/ipc_logging/smd_pkt/log");
- DumpFileToFd(fd, "IPC Router Log", "/d/ipc_logging/ipc_router/log");
- DumpFileToFd(fd, "Enabled Clocks", "/d/clk/enabled_clocks");
- DumpFileToFd(fd, "wlan", "/sys/module/bcmdhd/parameters/info_string");
- RunCommandToFd(fd, "ION HEAPS", {"/system/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done"}, CommandOptions::AS_ROOT);
- RunCommandToFd(fd, "Temperatures", {"/system/bin/sh", "-c", "for f in die_temp emmc_therm msm_therm pa_therm1 quiet_therm ; do echo -n \"$f : \" ; cat /sys/class/hwmon/hwmon1/device/$f ; done ; for f in `ls /sys/class/thermal` ; do type=`cat /sys/class/thermal/$f/type` ; temp=`cat /sys/class/thermal/$f/temp` ; echo \"$type: $temp\" ; done"}, CommandOptions::AS_ROOT);
- DumpFileToFd(fd, "dmesg-ramoops-0", "/sys/fs/pstore/dmesg-ramoops-0");
- DumpFileToFd(fd, "dmesg-ramoops-1", "/sys/fs/pstore/dmesg-ramoops-1");
- DumpFileToFd(fd, "LITTLE cluster time-in-state", "/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state");
- RunCommandToFd(fd, "LITTLE cluster cpuidle", {"/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu0/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"}, CommandOptions::AS_ROOT);
- DumpFileToFd(fd, "big cluster time-in-state", "/sys/devices/system/cpu/cpu4/cpufreq/stats/time_in_state");
- RunCommandToFd(fd,"big cluster cpuidle", {"/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu4/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"}, CommandOptions::AS_ROOT);
- DumpFileToFd(fd, "Battery:", "/sys/class/power_supply/bms/uevent");
- RunCommandToFd(fd, "Battery:", {"/system/bin/sh", "-c", "for f in 1 2 3 4 5 6 7 8; do echo $f > /sys/class/power_supply/bms/cycle_count_id; echo \"$f: `cat /sys/class/power_supply/bms/cycle_count`\"; done"}, CommandOptions::AS_ROOT);
-
- return Void();
-}
-
-} // namespace implementation
-} // namespace V1_0
-} // namespace dumpstate
-} // namespace hardware
-} // namespace android
diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h
deleted file mode 100644
index f8585f5..0000000
--- a/dumpstate/DumpstateDevice.h
+++ b/dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 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.
- */
-#ifndef ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
-#define ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
-
-#include <android/hardware/dumpstate/1.0/IDumpstateDevice.h>
-#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
-
-namespace android {
-namespace hardware {
-namespace dumpstate {
-namespace V1_0 {
-namespace implementation {
-
-using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
-using ::android::hardware::hidl_array;
-using ::android::hardware::hidl_handle;
-using ::android::hardware::hidl_string;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::sp;
-
-struct DumpstateDevice : public IDumpstateDevice {
- // Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
- Return<void> dumpstateBoard(const hidl_handle& h) override;
-
-};
-
-} // namespace implementation
-} // namespace V1_0
-} // namespace dumpstate
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_DUMPSTATE_V1_0_DUMPSTATEDEVICE_H
diff --git a/dumpstate/NOTICE b/dumpstate/NOTICE
deleted file mode 100644
index e48dd6b..0000000
--- a/dumpstate/NOTICE
+++ b/dev/null
@@ -1,190 +0,0 @@
-
- Copyright (C) 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.
-
- 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.
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
diff --git a/dumpstate/android.hardware.dumpstate@1.0-service.droidlogic.rc b/dumpstate/android.hardware.dumpstate@1.0-service.droidlogic.rc
deleted file mode 100644
index 0ccb360..0000000
--- a/dumpstate/android.hardware.dumpstate@1.0-service.droidlogic.rc
+++ b/dev/null
@@ -1,4 +0,0 @@
-service dumpstate-1-0 /vendor/bin/hw/android.hardware.dumpstate@1.0-service.droidlogic
- class hal
- user system
- group system
diff --git a/dumpstate/service.cpp b/dumpstate/service.cpp
deleted file mode 100644
index 4afc868..0000000
--- a/dumpstate/service.cpp
+++ b/dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 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 "android.hardware.dumpstate@1.0-service.droidlogic"
-
-#include <hidl/HidlSupport.h>
-#include <hidl/HidlTransportSupport.h>
-
-#include "DumpstateDevice.h"
-
-using ::android::hardware::configureRpcThreadpool;
-using ::android::hardware::dumpstate::V1_0::IDumpstateDevice;
-using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice;
-using ::android::hardware::joinRpcThreadpool;
-using ::android::OK;
-using ::android::sp;
-
-int main(int /* argc */, char* /* argv */ []) {
- sp<IDumpstateDevice> dumpstate = new DumpstateDevice;
- configureRpcThreadpool(1, true /* will join */);
- if (dumpstate->registerAsService() != OK) {
- ALOGE("Could not register service.");
- return 1;
- }
- joinRpcThreadpool();
-
- ALOGE("Service exited!");
- return 1;
-}
diff --git a/hidl_manifests/manifest_common.xml b/hidl_manifests/manifest_common.xml
index 3ff4c7a..22fcb36 100755
--- a/hidl_manifests/manifest_common.xml
+++ b/hidl_manifests/manifest_common.xml
@@ -221,15 +221,6 @@
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.dumpstate</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IDumpstateDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl">
<name>android.hardware.soundtrigger</name>
<transport>hwbinder</transport>
<version>2.2</version>
diff --git a/sepolicy/dumpstate.te b/sepolicy/dumpstate.te
index 49cd63b..9f9773b 100644
--- a/sepolicy/dumpstate.te
+++ b/sepolicy/dumpstate.te
@@ -3,3 +3,4 @@ allow dumpstate incidentd:binder call;
allow dumpstate param_tv_file:dir { getattr search };
allow dumpstate tee_vendor_file:dir { getattr search };
allow dumpstate sysfs_module:file { read open getattr };
+allow dumpstate sysfs_reboot:file { read };
diff --git a/sepolicy/file.te b/sepolicy/file.te
index 795e6c3..b4bbaec 100755
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -88,3 +88,7 @@ type btmic_data_file, file_type, data_file_type;
type proc_vm_writable, fs_type, proc_type;
type sysfs_astream, fs_type, sysfs_type;
type sysfs_stb, fs_type, sysfs_type;
+
+type aml_debugfs, fs_type, debugfs_type;
+type sysfs_dmc, fs_type, sysfs_type;
+type sysfs_reboot, fs_type, sysfs_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 1ac746f..8fb8405 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -3,8 +3,8 @@
/data/log(/.*)? u:object_r:log_file:s0
/data/tee(/.*)? u:object_r:tee_droid_data_file:s0
/data/droidota(/.*)? u:object_r:update_data_file:s0
-/data/vendor/btmic(/.*)? u:object_r:btmic_data_file:s0
-/data/misc/hdcp u:object_r:hdcp_file:s0
+/data/vendor/btmic(/.*)? u:object_r:btmic_data_file:s0
+/data/misc/hdcp u:object_r:hdcp_file:s0
/dev/amaudio_.* u:object_r:audio_device:s0
/dev/amaudio2_out u:object_r:audio_device:s0
@@ -17,7 +17,7 @@
/dev/amvideo u:object_r:vendor_video_device:s0
/dev/amvideo_poll u:object_r:video_device:s0
/dev/ionvideo u:object_r:video_device:s0
-/dev/v4lvideo u:object_r:video_device:s0
+/dev/v4lvideo u:object_r:video_device:s0
/dev/video_composer.0 u:object_r:vendor_video_device:s0
/dev/video_composer.1 u:object_r:vendor_video_device:s0
/dev/amstream_.* u:object_r:codec_device:s0
@@ -26,10 +26,10 @@
/dev/avin_detect u:object_r:avin_device:s0
/dev/videosync u:object_r:video_device:s0
-/dev/unifykeys u:object_r:unify_device:s0
+/dev/unifykeys u:object_r:unify_device:s0
/dev/block/env u:object_r:env_device:s0
-/dev/block/logo u:object_r:logo_device:s0
+/dev/block/logo u:object_r:logo_device:s0
/dev/block/data u:object_r:userdata_block_device:s0
/dev/block/cache u:object_r:cache_block_device:s0
/dev/block/metadata u:object_r:metadata_block_device:s0
@@ -54,7 +54,7 @@
/dev/block/product u:object_r:product_block_device:s0
/dev/block/product_a u:object_r:product_block_device:s0
/dev/block/product_b u:object_r:product_block_device:s0
-/dev/block/dtbo u:object_r:dtbo_block_device:s0
+/dev/block/dtbo u:object_r:dtbo_block_device:s0
/dev/block/dtbo_a u:object_r:dtbo_block_device:s0
/dev/block/dtbo_b u:object_r:dtbo_block_device:s0
/dev/block/misc u:object_r:misc_block_device:s0
@@ -75,9 +75,9 @@
/dev/block/recovery_a u:object_r:recovery_block_device:s0
/dev/block/recovery_b u:object_r:recovery_block_device:s0
-/dev/block/super u:object_r:super_block_device:s0
-/dev/block/by-name/super u:object_r:super_block_device:s0
-/dev/block/by-name/dm-[0-9] u:object_r:super_block_device:s0
+/dev/block/super u:object_r:super_block_device:s0
+/dev/block/by-name/super u:object_r:super_block_device:s0
+/dev/block/by-name/dm-[0-9] u:object_r:super_block_device:s0
/dev/block/dm-[0-9] u:object_r:super_block_device:s0
/dev/block/platform/*.emmc/by-name/system u:object_r:system_block_device:s0
@@ -87,19 +87,19 @@
/dev/block/vbmeta_b u:object_r:vbmeta_block_device:s0
/dev/block/vbmeta u:object_r:vbmeta_block_device:s0
-/dev/block/mmcblk0boot0 u:object_r:bootloader_device:s0
-/dev/block/mmcblk0boot1 u:object_r:bootloader_device:s0
-/dev/block/bootloader u:object_r:bootloader_device:s0
+/dev/block/mmcblk0boot0 u:object_r:bootloader_device:s0
+/dev/block/mmcblk0boot1 u:object_r:bootloader_device:s0
+/dev/block/bootloader u:object_r:bootloader_device:s0
/dev/bootloader u:object_r:bootloader_device:s0
/dev/btusb0 u:object_r:hci_attach_dev:s0
-/dev/stpbt u:object_r:device_stpbt:s0
+/dev/stpbt u:object_r:device_stpbt:s0
/dev/cec u:object_r:cec_device:s0
/dev/defendkey u:object_r:defendkey_device:s0
/dev/display u:object_r:display_device:s0
/dev/dtb u:object_r:dtb_device:s0
/dev/dvb0.* u:object_r:dvb_device:s0
-/dev/v4l2_frontend u:object_r:frontend_device:s0
+/dev/v4l2_frontend u:object_r:frontend_device:s0
/dev/esm u:object_r:hdcptx_device:s0
/dev/esm_rx u:object_r:hdcprx_device:s0
/dev/ge2d u:object_r:ge2d_device:s0
@@ -137,6 +137,21 @@
/sys/devices/bt-dev.*/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0
/sys/devices/bt-dev.*/rfkill/rfkill0/type u:object_r:sysfs_bluetooth_writable:s0
+/sys/devices/platform/0.hdmirx/hdmirx/hdmirx0(/.*)? u:object_r:sysfs_cec:s0
+/sys/module/rdma_mgr/parameters(/.*)? u:object_r:sysfs_display:s0
+/sys/devices/platform/aml_reboot/reboot_reason u:object_r:sysfs_reboot:s0
+/sys/kernel/debug/aml_clkmsr/clkmsr u:object_r:aml_debugfs:s0
+/sys/kernel/debug/aml_reg/dump u:object_r:aml_debugfs:s0
+/sys/kernel/debug/aml_reg/paddr u:object_r:aml_debugfs:s0
+/sys/class/dmc_monitor(/.*)? u:object_r:sysfs_dmc:s0
+/sys/class/ppmgr(/.*)? u:object_r:sysfs_display:s0
+/sys/class/lcd/debug u:object_r:sysfs_display:s0
+/sys/class/aml_bl(/.*)? u:object_r:sysfs_display:s0
+/sys/class/ionvideo(/.*)? u:object_r:sysfs_video:s0
+/sys/devices/platform/vdin0/vdin/vdin0/attr u:object_r:sysfs_display:s0
+/sys/devices/platform/vdin1/vdin/vdin1/attr u:object_r:sysfs_display:s0
+/sys/devices/platform/vdin0/vdin/vdin0/vf_log u:object_r:sysfs_display:s0
+/sys/class/tvafe/tvafe0/reg u:object_r:sysfs_cec:s0
/sys/class/video/disable_video u:object_r:sysfs_video:s0
/sys/class/video/disable_videopip u:object_r:sysfs_video:s0
/sys/class/vfm/map u:object_r:sysfs_video:s0
@@ -144,15 +159,16 @@
/sys/class/video/axis_pip u:object_r:sysfs_video:s0
/sys/class/tsync/enable u:object_r:sysfs_video:s0
/sys/class/audiodsp/digital_raw u:object_r:sysfs_audio:s0
-/sys/class/audiodsp/codec_fatal_err u:object_r:sysfs_audio:s0
+/sys/class/audiodsp/codec_fatal_err u:object_r:sysfs_audio:s0
/sys/class/amaudio/debug u:object_r:sysfs_audio:s0
/sys/class/tsync/firstapts u:object_r:sysfs_xbmc:s0
/sys/class/tsync/pts_audio u:object_r:sysfs_xbmc:s0
-/sys/class/tsync/pts_video u:object_r:sysfs_xbmc:s0
+/sys/class/tsync/pts_video u:object_r:sysfs_xbmc:s0
/sys/class/tsync/event u:object_r:sysfs_xbmc:s0
/sys/class/tsync/pts_pcrscr u:object_r:sysfs_xbmc:s0
/sys/devices/virtual/amhdmitx/amhdmitx0(/.*)? u:object_r:sysfs_amhdmitx:s0
+/sys/devices/platform/multi-di/deinterlace/di0(/.*)? u:object_r:sysfs_di:s0
/sys/class/audiodsp/digital_codec u:object_r:sysfs_digital_codec:s0
/sys/class/audiodsp/audio_samesource u:object_r:sysfs_audio_samesource:s0
@@ -210,7 +226,7 @@
/sys/class/android_usb(/.*)? u:object_r:sysfs_usb:s0
/sys/class/dual_role_usb(/.*)? u:object_r:sysfs_usb:s0
/sys/power/boot_type u:object_r:sysfs_boottype:s0
-#/sys/class/thermal/thermal_zone0/temp u:object_r:sysfs_thermal:s0
+#/sys/class/thermal/thermal_zone0/temp u:object_r:sysfs_thermal:s0
/sys/devices/virtual/thermal/thermal_zone[0-1](/.*) u:object_r:sysfs_thermal:s0
/sys/devices/virtual/thermal/cooling_device[0-3](/.*) u:object_r:sysfs_thermal:s0
@@ -256,8 +272,8 @@
/sys/devices/platform/rtc/rtc/rtc0/hctosys u:object_r:sysfs_rtc:s0
-/sys/devices/platform/dummy-battery/power_supply/Battery(/.*) u:object_r:sysfs_power:s0
-/sys/devices/platform/dummy-charger/power_supply/usb(/.*) u:object_r:sysfs_power:s0
+/sys/devices/platform/dummy-battery/power_supply/Battery(/.*) u:object_r:sysfs_power:s0
+/sys/devices/platform/dummy-charger/power_supply/usb(/.*) u:object_r:sysfs_power:s0
/sys/class/amvecm(/.*)? u:object_r:sysfs_video:s0
/sys/class/video(/.*)? u:object_r:sysfs_video:s0
@@ -355,7 +371,7 @@
/dev/hidraw[0-9]* u:object_r:hidraw_audio_device:s0
#The final space is necessary. Please don't delete it.
-/vendor/lib/vendor\.amlogic\.hardware\.remotecontrol@1\.0\.so u:object_r:vendor_app_file:s0
+/vendor/lib/vendor\.amlogic\.hardware\.remotecontrol@1\.0\.so u:object_r:vendor_app_file:s0
/system/bin/ntfs-3g u:object_r:fsck_exec:s0
/system/bin/fsck.exfat u:object_r:fsck_exec:s0
/vendor/bin/hw/android\.hardware\.keymaster@4\.0-service.amlogic u:object_r:hal_keymaster_default_exec:s0
diff --git a/sepolicy/hal_dumpstate_default.te b/sepolicy/hal_dumpstate_default.te
new file mode 100644
index 0000000..6522155
--- a/dev/null
+++ b/sepolicy/hal_dumpstate_default.te
@@ -0,0 +1,13 @@
+allow hal_dumpstate_default { aml_debugfs }:dir r_dir_perms;
+allow hal_dumpstate_default { aml_debugfs }:file r_file_perms;
+allow hal_dumpstate_default { sysfs_reboot }:file r_file_perms;
+
+allow hal_dumpstate_default proc:file r_file_perms;
+
+allow hal_dumpstate_default { sysfs_video sysfs_display sysfs_amhdmitx sysfs_cec sysfs_am_vecm sysfs_di sysfs_dmc }:dir r_dir_perms;
+allow hal_dumpstate_default { sysfs_video sysfs_display sysfs_amhdmitx sysfs_cec sysfs_am_vecm sysfs_di sysfs_dmc }:file rw_file_perms;
+
+allow hal_dumpstate_default { mnt_vendor_file param_tv_file }:dir rw_dir_perms;
+
+allow hal_dumpstate_default vendor_shell_exec:file rx_file_perms;
+