Skip to content

Commit

Permalink
accelerometer: Fix TryScheduleInitialize bug
Browse files Browse the repository at this point in the history
Fixes <2079112a1017>: accelerometer: Refactor AccelerometerFileReader

TryScheduleInitialize should be run in |ui_task_runner_| instead of
|blocking_task_runner_|.

BUG=chromium:1164449
TEST=unit tests

Change-Id: If242c2ba3e20f88db5f94261621d671629a786ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617414
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Cheng-Hao Yang <chenghaoyang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841789}
  • Loading branch information
HarveyCHYang authored and Chromium LUCI CQ committed Jan 9, 2021
1 parent 014272d commit ed3b775
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ash/accelerometer/accelerometer_file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void AccelerometerFileReader::SetStatesWithInitializationResult(
// If we haven't yet passed the timeout cutoff, try this again. This will
// be scheduled at the same rate as reading.
if (base::TimeTicks::Now() < initialization_timeout_) {
blocking_task_runner_->PostDelayedTask(
ui_task_runner_->PostDelayedTask(
FROM_HERE,
base::BindOnce(&AccelerometerFileReader::TryScheduleInitialize,
this),
Expand Down

0 comments on commit ed3b775

Please sign in to comment.