Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Can you please send us a test app which can reproduce this ?
da...@google.com <da...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 5975b62cd1f3f170bb82e9761efca40e5e5bfb16
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Wed Jul 24 12:24:17 2019
TaskExecutor's background executor is now SerialExecutor.
* This gives us visibility into the number of pending tasks which will
be important in the next CL.
There is a race condition between the SerialExecutor draining its queue
of pending tasks and SystemAlarmDispatcher's onAllCommandsCompleted() callback.
This is because SystemAlarmDispatcher thinks there are no more things to be
done even though there are pending runnables in the SerialExecutor.
This CL makes this information available. In the next CL, CommandHandler
will check for pending runnables in the SerialExecutor queue.
( b/138238197 )
* Fixed TestWorkManagerImpl to use Configuration#getTaskExecutor().
* Updated unit tests.
Test: Updated unit tests.
Change-Id: I5f32f1e1ef2563d4598934aed3b61d62a6d6167c
M work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcherTest.kt
M work/workmanager-ktx/src/androidTest/java/androidx/work/CoroutineWorkerTest.kt
M work/workmanager-rxjava2/src/test/java/androidx/work/RxWorkerTest.kt
M work/workmanager-testing/src/androidTest/java/androidx/work/testing/WorkManagerInitHelperTest.java
M work/workmanager-testing/src/main/java/androidx/work/testing/InstantWorkTaskExecutor.java
M work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkManagerImpl.java
M work/workmanager-testing/src/main/java/androidx/work/testing/WorkManagerTestInitHelper.java
M work/workmanager/src/androidTest/java/androidx/work/impl/utils/taskexecutor/InstantWorkTaskExecutor.java
M work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
M work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/TaskExecutor.java
M work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/WorkManagerTaskExecutor.java
https://android-review.googlesource.com/1090749
https://goto.google.com/android-sha1/5975b62cd1f3f170bb82e9761efca40e5e5bfb16
Branch: androidx-master-dev
commit 5975b62cd1f3f170bb82e9761efca40e5e5bfb16
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Wed Jul 24 12:24:17 2019
TaskExecutor's background executor is now SerialExecutor.
* This gives us visibility into the number of pending tasks which will
be important in the next CL.
There is a race condition between the SerialExecutor draining its queue
of pending tasks and SystemAlarmDispatcher's onAllCommandsCompleted() callback.
This is because SystemAlarmDispatcher thinks there are no more things to be
done even though there are pending runnables in the SerialExecutor.
This CL makes this information available. In the next CL, CommandHandler
will check for pending runnables in the SerialExecutor queue.
(
* Fixed TestWorkManagerImpl to use Configuration#getTaskExecutor().
* Updated unit tests.
Test: Updated unit tests.
Change-Id: I5f32f1e1ef2563d4598934aed3b61d62a6d6167c
M work/workmanager-gcm/src/androidTest/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcherTest.kt
M work/workmanager-ktx/src/androidTest/java/androidx/work/CoroutineWorkerTest.kt
M work/workmanager-rxjava2/src/test/java/androidx/work/RxWorkerTest.kt
M work/workmanager-testing/src/androidTest/java/androidx/work/testing/WorkManagerInitHelperTest.java
M work/workmanager-testing/src/main/java/androidx/work/testing/InstantWorkTaskExecutor.java
M work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkManagerImpl.java
M work/workmanager-testing/src/main/java/androidx/work/testing/WorkManagerTestInitHelper.java
M work/workmanager/src/androidTest/java/androidx/work/impl/utils/taskexecutor/InstantWorkTaskExecutor.java
M work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
M work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/TaskExecutor.java
M work/workmanager/src/main/java/androidx/work/impl/utils/taskexecutor/WorkManagerTaskExecutor.java
sk...@gmail.com <sk...@gmail.com> #4
There is a 2nd change that fixes the problem.
yb...@google.com <yb...@google.com>
da...@google.com <da...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 7db27318ea09ae3857a7baebe8dd4e6fa9d16fdc
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Wed Jul 24 12:50:34 2019
Ensure SerialExecutor has no more pending tasks.
* We need to ensure this is the case because we might shutdown
SystemAlarmService without actually completing all the tasks.
Test: Existing unit tests pass. Ran integration tests.
Fixes: b/138238197
Change-Id: I72fe2ddb1607995721eae320ce41accad93fee8f
M work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
M work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
https://android-review.googlesource.com/1090758
https://goto.google.com/android-sha1/7db27318ea09ae3857a7baebe8dd4e6fa9d16fdc
Branch: androidx-master-dev
commit 7db27318ea09ae3857a7baebe8dd4e6fa9d16fdc
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Wed Jul 24 12:50:34 2019
Ensure SerialExecutor has no more pending tasks.
* We need to ensure this is the case because we might shutdown
SystemAlarmService without actually completing all the tasks.
Test: Existing unit tests pass. Ran integration tests.
Fixes:
Change-Id: I72fe2ddb1607995721eae320ce41accad93fee8f
M work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher.java
M work/workmanager/src/main/java/androidx/work/impl/utils/SerialExecutor.java
Description
Version used: 2.1.0-alpha03
Devices/Android versions reproduced on: compilation error
When using suspend SELECT method with TypeConverter parameter, room-compiler generate incorrect method code with return type java.lang.Object.
Compilation exceptions:
• The query returns some columns [...] which are not used by java.lang.Object. You can use @ColumnInfo annotation on the fields to specify the mapping. You can suppress this warning by annotating the method with @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH).
• Not sure how to convert a Cursor to this method's return type (java.lang.Object).
• Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
But when I remove suspend modifier all is ok.