Fixed
Status Update
Comments
ra...@google.com <ra...@google.com> #2
Yeah, this is a bug. Will fix for alpha03.
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 34ffd6332ec5a7b2a2f27fbc80f7d7f1065ccba6
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Sun Oct 13 11:38:51 2019
Removes an unnecessary call to WorkDatabase.setTransactionSuccessful()
Fixes: b/142580433
Test: Existing unit tests pass
Change-Id: I5532bb4ee9acc312402cddb98c911df503440f98
M work/workmanager/src/main/java/androidx/work/impl/utils/PreferenceUtils.java
https://android-review.googlesource.com/1141737
https://goto.google.com/android-sha1/34ffd6332ec5a7b2a2f27fbc80f7d7f1065ccba6
Branch: androidx-master-dev
commit 34ffd6332ec5a7b2a2f27fbc80f7d7f1065ccba6
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Sun Oct 13 11:38:51 2019
Removes an unnecessary call to WorkDatabase.setTransactionSuccessful()
Fixes:
Test: Existing unit tests pass
Change-Id: I5532bb4ee9acc312402cddb98c911df503440f98
M work/workmanager/src/main/java/androidx/work/impl/utils/PreferenceUtils.java
Description
Version used: WorkManager 2.2.0-alpha02, Room 2.2.0 stable
Devices/Android versions reproduced on: seen once in crash reporting on a OnePlus device running Android 10
It seems that PreferenceUtils.setNeedsReschedule() manually calls setTransactionSuccessful(), but where it is called from, ForceStopRunnable.run, doesn't have a transaction running so the app crashes.
Fatal Exception: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:917)
at android.database.sqlite.SQLiteSession.setTransactionSuccessful(SQLiteSession.java:373)
at android.database.sqlite.SQLiteDatabase.setTransactionSuccessful(SQLiteDatabase.java:618)
at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.setTransactionSuccessful(FrameworkSQLiteDatabase.java:95)
at androidx.room.RoomDatabase.setTransactionSuccessful(RoomDatabase.java:395)
at androidx.work.impl.utils.PreferenceUtils.setNeedsReschedule(PreferenceUtils.java:106)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:89)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)