Fix hibernation job blocking
It is possible for getInitializedValue to suspend and never continue if the unused apps live data has no active observers. The default parameters of getInitializedValue are to block if the data is stale and wait for the value to be not stale. However, if the live data has no active observers, it never becomes not stale. Because this call is done as a "preload" there is a chance there are no active observers and the suspended function never continues. As a fix, we pass in a parameter that accepts that the value can be stale. We also move the suspending function onto a separate thread as it should not block the job finishing even if it suspends. Relnote: Fix issue with hibernation job blocking and not completing Bug: 288324294 Test: atest CtsHibernationTestCases Merged-In: I19d95fa5ae79d4e4ac5751dbed7ad3197d99c834 Change-Id: I19d95fa5ae79d4e4ac5751dbed7ad3197d99c834
Loading
Please register or sign in to comment