This fixes:
W android.ui: type=1400 audit(0.0:37): avc: denied { read } for name="name" dev="sysfs" ino=60802 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,usb-pdphy@1700/extcon/extcon4/cable.1/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: java.io.FileNotFoundException: /sys/class/extcon/extcon4/cable.1/name: open failed: EACCES (Permission denied)
W ExtconUEventObserver: at libcore.io.IoBridge.open(IoBridge.java:574)
W ExtconUEventObserver: at java.io.FileInputStream.<init>(FileInputStream.java:160)
W ExtconUEventObserver: at android.os.FileUtils.readTextFile(FileUtils.java:637)
W ExtconUEventObserver: at com.android.server.ExtconUEventObserver$ExtconInfo.<init>(ExtconUEventObserver.java:222)
W ExtconUEventObserver: at com.android.server.ExtconUEventObserver$ExtconInfo.initExtconInfos(ExtconUEventObserver.java:173)
W ExtconUEventObserver: at com.android.server.ExtconUEventObserver$ExtconInfo.getExtconInfoForTypes(ExtconUEventObserver.java:185)
W ExtconUEventObserver: at com.android.server.policy.PhoneWindowManager.initializeHdmiStateInternal(PhoneWindowManager.java:3709)
W ExtconUEventObserver: at com.android.server.policy.PhoneWindowManager.initializeHdmiState(PhoneWindowManager.java:3672)
W ExtconUEventObserver: at com.android.server.policy.PhoneWindowManager.init(PhoneWindowManager.java:2121)
W ExtconUEventObserver: at com.android.server.wm.WindowManagerService$5.run(WindowManagerService.java:1186)
W ExtconUEventObserver: at android.os.Handler$BlockingRunnable.run(Handler.java:965)
W ExtconUEventObserver: at android.os.Handler.handleCallback(Handler.java:942)
W ExtconUEventObserver: at android.os.Handler.dispatchMessage(Handler.java:99)
W ExtconUEventObserver: at android.os.Looper.loopOnce(Looper.java:201)
W ExtconUEventObserver: at android.os.Looper.loop(Looper.java:288)
W ExtconUEventObserver: at android.os.HandlerThread.run(HandlerThread.java:67)
W ExtconUEventObserver: at com.android.server.ServiceThread.run(ServiceThread.java:44)
W ExtconUEventObserver: at com.android.server.UiThread.run(UiThread.java:45)
W ExtconUEventObserver: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
W ExtconUEventObserver: at libcore.io.Linux.open(Native Method)
W ExtconUEventObserver: at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W ExtconUEventObserver: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
W ExtconUEventObserver: at libcore.io.IoBridge.open(IoBridge.java:560)
W ExtconUEventObserver: ... 17 more
Similarily
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/88e0000.qcom,msm-eud/extcon/extcon2/cable.1/name. This probably means the selinux policies need to be changed.
W ExtconUEventObserver: Unable to read /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,qpnp-smb5/extcon/extcon3/cable.1/name. This probably means the selinux policies need to be changed.
Test: Label these sysfs and boot into system
We are going to enforce that each property has an explicit owner, such
as system, vendor, or product. This attaches vendor_property_type to
properties defined under vendor sepolicy directories.
Bug: 159097992
Test: m selinux_policy && boot device
Change-Id: I33c40ca345365d8f01f43d3ce7f1f3434b1edfd5
The list of folders for genfscon was generated using following script:
for f in `adb shell "find /sys/devices -name wakeup -type d"`; do
adb shell "ls -Z '$f' | grep -qv u:object_r:sysfs:s0 || echo '$f'"
done
While list for regular file_contexts was just a simple grep "wakeup[0-9]".
Signed-off-by: xSylla <syllamodder@gmail.com>