android N 串口打不开,请问如何配置
ailiving@ailiving-desktop:/mnt/data/ailiving/Workfolder/carl/aili/d/d-4/sc60_android7.1.2_ailiving/device$ git diff qcom/common/rootdir/etc/init.qcom.rc
diff --git a/device/qcom/common/rootdir/etc/init.qcom.rc b/device/qcom/common/rootdir/etc/init.qcom.rc
index 8714587ca3..1b04022f0f 100755
--- a/device/qcom/common/rootdir/etc/init.qcom.rc
+++ b/device/qcom/common/rootdir/etc/init.qcom.rc
@@ -83,6 +83,19 @@ on boot
chmod 0777 /dev/ttyHSL2
chmod 0777 /dev/ttyHSL1
chmod 0777 /dev/ttyHSL3
ailiving@ailiving-desktop:/mnt/data/ailiving/Workfolder/carl/aili/d/d-4/sc60_android7.1.2_ailiving/device$ git diff qcom/common/rootdir/etc/ueventd.qcom.rc
diff --git a/device/qcom/common/rootdir/etc/ueventd.qcom.rc b/device/qcom/common/rootdir/etc/ueventd.qcom.rc
index e1a4deaffb..26011316d5 100755
--- a/device/qcom/common/rootdir/etc/ueventd.qcom.rc
+++ b/device/qcom/common/rootdir/etc/ueventd.qcom.rc
@@ -177,6 +177,19 @@
/dev/smd2 0660 bluetooth net_bt_stack
/dev/ttyHSL1 0660 system system
/dev/ttyHS1 0660 system system
+/dev/ttyHSL3 0660 system system
ailiving@ailiving-desktop:/mnt/data/ailiving/Workfolder/carl/aili/d/d-4/sc60_android7.1.2_ailiving/device$ git diff qcom/sepolicy/common/device.te
diff --git a/device/qcom/sepolicy/common/device.te b/device/qcom/sepolicy/common/device.te
index fc358fb7c3..f60d212253 100644
--- a/device/qcom/sepolicy/common/device.te
+++ b/device/qcom/sepolicy/common/device.te
@@ -141,3 +141,4 @@ type at_device, dev_type;
#define Bluetooth device
type bt_device, dev_type;
+type ailving_uart_file, dev_type, file_type, mlstrustedobject;
ailiving@ailiving-desktop:/mnt/data/ailiving/Workfolder/carl/aili/d/d-4/sc60_android7.1.2_ailiving/device$ git diff qcom/sepolicy/msm8953/file_contexts
diff --git a/device/qcom/sepolicy/msm8953/file_contexts b/device/qcom/sepolicy/msm8953/file_contexts
index a0d9171c83..a93a84079b 100644
--- a/device/qcom/sepolicy/msm8953/file_contexts
+++ b/device/qcom/sepolicy/msm8953/file_contexts
@@ -53,3 +53,4 @@
/sys/kernel/dload/emmc_dload u:object_r:sysfs_emmc_dload:s0
/data/ailiving(/.*)? u:object_r:download_data_file:s0
/sys/kernel/ailiving_sata(/.*)? u:object_r:ailiving_power_file:s0
+/dev/ttyHSL3 u:object_r:ailving_uart_file:s0
ailiving@ailiving-desktop:/mnt/data/ailiving/Workfolder/carl/aili/d/d-4/sc60_android7.1.2_ailiving/device$ git diff qcom/sepolicy/msm8953/system_app.te
diff --git a/device/qcom/sepolicy/msm8953/system_app.te b/device/qcom/sepolicy/msm8953/system_app.te
index e9e19b0fd8..9cec234968 100644
--- a/device/qcom/sepolicy/msm8953/system_app.te
+++ b/device/qcom/sepolicy/msm8953/system_app.te
@@ -32,3 +32,8 @@ allow system_app download_data_file:file { create read write open getattr unlink
allow system_app ailiving_power_file:file { create read write open getattr unlink rename };
allow system_app sysfs:file write;
allow system_app persist_file:file { create read write open getattr unlink rename };
+allow system_app ailving_uart_file:dir { write open read ioctl getattr};
+allow system_app ailving_uart_file:chr_file { read write open ioctl };
+allow system_app ailving_uart_file:file { create read write open getattr unlink rename };
我使用的是android N 也就是android 7.1的版本
userdebug下,编译烧录,是没有问题的
问题是:
user版本,编译就提示 android 打不开
01-02 11:36:39.909 3183 3183 E AndroidRuntime: FATAL EXCEPTION: main
01-02 11:36:39.909 3183 3183 E AndroidRuntime: Process: com.ailiving.car.device, PID: 3183
01-02 11:36:39.909 3183 3183 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.ailiving.car.device.main.MyApplication: java.lang.SecurityException
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5408)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.app.ActivityThread.-wrap2(ActivityThread.java)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6121)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: Caused by: java.lang.SecurityException
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android_serialport_api.SerialPort.<init>(SerialPort.java:37)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at com.ailiving.car.device.uart.SerialPortUtils.openSerialPort(SerialPortUtils.java:51)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at com.ailiving.car.device.main.MyApplication.onCreate(MyApplication.java:275)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5405)
01-02 11:36:39.909 3183 3183 E AndroidRuntime: ... 8 more
01-02 11:36:39.913 1445 3164 I ActivityManager: Start proc 10168:com.qualcomm.qti.carrierconfigure/1000 for restart com.qualcomm.qti.carrierconfigure
01-02 11:36:39.915 1445 1693 W ActivityManager: Force finishing activity com.ailiving.car.device/.liming.Main2Activity