FakeDataSource.java
7.43 KB
-
Use Handler callback instead of sleep() to catch InteruptedException. · f9661b53
The sleep used to simulate data load times is ignoring InterruptedExceptions. (This is intended and in line with SystemClock.sleep()). However, when a Loader cancels an ongoing load, it uses interrupts. To be able to catch these and to immediately return from the reading data source, a handler callback is used instead of the sleep() method which allows interuptable waiting. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168212652
tonihei committed