diff --git a/init/devices.c b/init/devices.c index 189364201..af88c5f09 100644 --- a/init/devices.c +++ b/init/devices.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -830,6 +831,15 @@ void handle_device_fd() struct uevent uevent; parse_event(msg, &uevent); + if (sehandle && selinux_status_updated() > 0) { + struct selabel_handle *sehandle2; + sehandle2 = selinux_android_file_context_handle(); + if (sehandle2) { + selabel_close(sehandle); + sehandle = sehandle2; + } + } + handle_device_event(&uevent); handle_firmware_event(&uevent); } @@ -896,6 +906,7 @@ void device_init(void) sehandle = NULL; if (is_selinux_enabled() > 0) { sehandle = selinux_android_file_context_handle(); + selinux_status_open(true); } /* is 256K enough? udev uses 16MB! */ diff --git a/rootdir/init.rc b/rootdir/init.rc index 6140ba1ab..882f28fb5 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -412,10 +412,6 @@ service healthd-charger /sbin/healthd -n critical seclabel u:r:healthd:s0 -on property:selinux.reload_policy=1 - restart ueventd - restart installd - service console /system/bin/sh class core console