diff options
| author | Tom Cherry <tomcherry@google.com> | 2017-04-06 14:41:30 -0700 |
|---|---|---|
| committer | Tom Cherry <tomcherry@google.com> | 2017-04-14 10:23:52 -0700 |
| commit | 1ab8f55344f1456aec8d6aa1c7450020acd2d0d6 (patch) | |
| tree | c0935c88d25b1cd5a40dc5378188bdd791e77ed0 /init/devices.h | |
| parent | e3e48214b718d5c6bb76d50c56344b222a23a234 (diff) | |
| download | system_core-1ab8f55344f1456aec8d6aa1c7450020acd2d0d6.tar.gz system_core-1ab8f55344f1456aec8d6aa1c7450020acd2d0d6.tar.bz2 system_core-1ab8f55344f1456aec8d6aa1c7450020acd2d0d6.zip | |
ueventd: convert platform_names from C list to std::vector
Also simplify this code a bit.
There's only one consumer that removes the /devices/platform prefix,
so have them handle it instead of storing two copies of the string.
Remove an unneeded search for '/' in get_character_device_symlinks()
as a / will always be the next character after a parent path, by
nature of FindPlatformDevice().
Test: boot bullhead
Test: init unit tests
Change-Id: I9d0482d137b1342ae7509ae993ff99198be814f0
Diffstat (limited to 'init/devices.h')
| -rw-r--r-- | init/devices.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/init/devices.h b/init/devices.h index c12ba9dfe..b8b039f0a 100644 --- a/init/devices.h +++ b/init/devices.h @@ -59,10 +59,11 @@ extern int add_dev_perms(const char *name, const char *attr, int get_device_fd(); // Exposed for testing -void add_platform_device(const char* path); -void remove_platform_device(const char* path); +extern std::vector<std::string> platform_devices; +bool find_platform_device(const std::string& path, std::string* out_path); std::vector<std::string> get_character_device_symlinks(uevent* uevent); std::vector<std::string> get_block_device_symlinks(uevent* uevent); void sanitize_partition_name(std::string* string); +void handle_platform_device_event(uevent* uevent); #endif /* _INIT_DEVICES_H */ |
