Loading init/ueventd.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include "ueventd.h" #include <android/api-level.h> #include <ctype.h> #include <dirent.h> #include <fcntl.h> Loading Loading @@ -266,6 +267,17 @@ void ColdBoot::Run() { LOG(INFO) << "Coldboot took " << cold_boot_timer.duration().count() / 1000.0f << " seconds"; } static UeventdConfiguration GetConfiguration() { // TODO: Remove these legacy paths once Android S is no longer supported. if (android::base::GetIntProperty("ro.product.first_api_level", 10000) <= __ANDROID_API_S__) { auto hardware = android::base::GetProperty("ro.hardware", ""); return ParseConfig({"/system/etc/ueventd.rc", "/vendor/ueventd.rc", "/odm/ueventd.rc", "/ueventd." + hardware + ".rc"}); } return ParseConfig({"/system/etc/ueventd.rc"}); } int ueventd_main(int argc, char** argv) { /* * init sets the umask to 077 for forked processes. We need to Loading @@ -283,7 +295,7 @@ int ueventd_main(int argc, char** argv) { std::vector<std::unique_ptr<UeventHandler>> uevent_handlers; auto ueventd_configuration = ParseConfig("/system/etc/ueventd.rc"); auto ueventd_configuration = GetConfiguration(); uevent_handlers.emplace_back(std::make_unique<DeviceHandler>( std::move(ueventd_configuration.dev_permissions), Loading init/ueventd_parser.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ Result<void> SubsystemParser::EndSection() { return {}; } UeventdConfiguration ParseConfig(const std::string& config) { UeventdConfiguration ParseConfig(const std::vector<std::string>& configs) { Parser parser; UeventdConfiguration ueventd_configuration; Loading Loading @@ -260,7 +260,9 @@ UeventdConfiguration ParseConfig(const std::string& config) { std::bind(ParseEnabledDisabledLine, _1, &ueventd_configuration.enable_parallel_restorecon)); for (const auto& config : configs) { parser.ParseConfig(config); } return ueventd_configuration; } Loading init/ueventd_parser.h +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ struct UeventdConfiguration { bool enable_parallel_restorecon = false; }; UeventdConfiguration ParseConfig(const std::string& config); UeventdConfiguration ParseConfig(const std::vector<std::string>& configs); } // namespace init } // namespace android rootdir/ueventd.rc +2 −3 Original line number Diff line number Diff line import /vendor/ueventd.rc import /odm/ueventd.rc import /ueventd.${ro.hardware}.rc import /vendor/etc/ueventd.rc import /odm/etc/ueventd.rc firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ uevent_socket_rcvbuf_size 16M Loading Loading
init/ueventd.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include "ueventd.h" #include <android/api-level.h> #include <ctype.h> #include <dirent.h> #include <fcntl.h> Loading Loading @@ -266,6 +267,17 @@ void ColdBoot::Run() { LOG(INFO) << "Coldboot took " << cold_boot_timer.duration().count() / 1000.0f << " seconds"; } static UeventdConfiguration GetConfiguration() { // TODO: Remove these legacy paths once Android S is no longer supported. if (android::base::GetIntProperty("ro.product.first_api_level", 10000) <= __ANDROID_API_S__) { auto hardware = android::base::GetProperty("ro.hardware", ""); return ParseConfig({"/system/etc/ueventd.rc", "/vendor/ueventd.rc", "/odm/ueventd.rc", "/ueventd." + hardware + ".rc"}); } return ParseConfig({"/system/etc/ueventd.rc"}); } int ueventd_main(int argc, char** argv) { /* * init sets the umask to 077 for forked processes. We need to Loading @@ -283,7 +295,7 @@ int ueventd_main(int argc, char** argv) { std::vector<std::unique_ptr<UeventHandler>> uevent_handlers; auto ueventd_configuration = ParseConfig("/system/etc/ueventd.rc"); auto ueventd_configuration = GetConfiguration(); uevent_handlers.emplace_back(std::make_unique<DeviceHandler>( std::move(ueventd_configuration.dev_permissions), Loading
init/ueventd_parser.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ Result<void> SubsystemParser::EndSection() { return {}; } UeventdConfiguration ParseConfig(const std::string& config) { UeventdConfiguration ParseConfig(const std::vector<std::string>& configs) { Parser parser; UeventdConfiguration ueventd_configuration; Loading Loading @@ -260,7 +260,9 @@ UeventdConfiguration ParseConfig(const std::string& config) { std::bind(ParseEnabledDisabledLine, _1, &ueventd_configuration.enable_parallel_restorecon)); for (const auto& config : configs) { parser.ParseConfig(config); } return ueventd_configuration; } Loading
init/ueventd_parser.h +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ struct UeventdConfiguration { bool enable_parallel_restorecon = false; }; UeventdConfiguration ParseConfig(const std::string& config); UeventdConfiguration ParseConfig(const std::vector<std::string>& configs); } // namespace init } // namespace android
rootdir/ueventd.rc +2 −3 Original line number Diff line number Diff line import /vendor/ueventd.rc import /odm/ueventd.rc import /ueventd.${ro.hardware}.rc import /vendor/etc/ueventd.rc import /odm/etc/ueventd.rc firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ uevent_socket_rcvbuf_size 16M Loading