Skip to content

Commit

Permalink
i9300: libsensors: fix a couple of poll_delay derps
Browse files Browse the repository at this point in the history
Change-Id: I6a6e307588e1d9a0c56895d4dc6a1702066b6059
  • Loading branch information
fourkbomb committed Mar 5, 2016
1 parent 2e3a8c5 commit c6f16d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libsensors/AccelSensor.cpp
Expand Up @@ -107,7 +107,7 @@ int AccelSensor::setDelay(int32_t handle, int64_t ns)
ns = 10000000; // Minimum on stock
}

strcpy(&input_sysfs_path[input_sysfs_path_len], "acc_poll_delay");
strcpy(&input_sysfs_path[input_sysfs_path_len], "poll_delay");
fd = open(input_sysfs_path, O_RDWR);
if (fd >= 0) {
char buf[80];
Expand Down
14 changes: 2 additions & 12 deletions libsensors/ProximitySensor.cpp
Expand Up @@ -73,18 +73,8 @@ int ProximitySensor::setInitialState() {

int ProximitySensor::setDelay(int32_t handle, int64_t ns)
{
int fd;

strcpy(&input_sysfs_path[input_sysfs_path_len], "prox_poll_delay");
fd = open(input_sysfs_path, O_RDWR);
if (fd >= 0) {
char buf[80];
sprintf(buf, "%lld", ns);
write(fd, buf, strlen(buf)+1);
close(fd);
return 0;
}
return -1;
// unsupported
return 0;
}

int ProximitySensor::enable(int32_t handle, int en) {
Expand Down

0 comments on commit c6f16d5

Please sign in to comment.