mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
@@ -424,7 +424,7 @@ void InputHub::ScanInputDevices(const std::string& dirName)
|
||||
DHLOGI("ScanInputDevices enter, dirName %s.", dirName.c_str());
|
||||
std::vector<std::string> vecInputDevPath;
|
||||
ScanInputDevicesPath(dirName, vecInputDevPath);
|
||||
for (auto &tempPath: vecInputDevPath) {
|
||||
for (const auto &tempPath: vecInputDevPath) {
|
||||
OpenInputDeviceLocked(tempPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ std::string Sha256(const std::string& string);
|
||||
void CloseFd(int& fd);
|
||||
int BitIsSet(const unsigned long *array, int bit);
|
||||
void StringSplitToVector(const std::string& str, const char split, std::vector<std::string>& vecStr);
|
||||
int OpenInputDeviceFdByPath(std::string devicePath);
|
||||
int OpenInputDeviceFdByPath(const std::string &devicePath);
|
||||
std::string ConvertErrNo();
|
||||
void ScanInputDevicesPath(std::string dirName, std::vector<std::string>& vecInputDevPath);
|
||||
void ScanInputDevicesPath(const std::string &dirName, std::vector<std::string>& vecInputDevPath);
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -324,7 +324,7 @@ void StringSplitToVector(const std::string& str, const char split, std::vector<s
|
||||
}
|
||||
}
|
||||
|
||||
int OpenInputDeviceFdByPath(std::string devicePath)
|
||||
int OpenInputDeviceFdByPath(const std::string &devicePath)
|
||||
{
|
||||
chmod(devicePath.c_str(), S_IWRITE | S_IREAD);
|
||||
char canonicalDevicePath[PATH_MAX] = {0x00};
|
||||
@@ -362,7 +362,7 @@ std::string ConvertErrNo()
|
||||
return errNoMsg;
|
||||
}
|
||||
|
||||
void ScanInputDevicesPath(std::string dirName, std::vector<std::string>& vecInputDevPath)
|
||||
void ScanInputDevicesPath(const std::string &dirName, std::vector<std::string>& vecInputDevPath)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
|
||||
Reference in New Issue
Block a user