Status Update
Comments
ra...@google.com <ra...@google.com> #2
Tentatively, the annotation should be something use-case-specific like @OutlinedNewApi
that allows alternative build systems (e.g. not R8/D8) to make their own decisions. We'll provide a default Proguard configuration for R8, but it's not guaranteed this will work as intended -- outlining is automatic in newer versions, but it may be disabled.
ra...@google.com <ra...@google.com> #3
Just as an FYI, this was enabled in AGP 2 years ago (AGP 7.3 as far as I remember), ag/18426192, so for AGP users it might fine to just remove the rule for @DoNotInline
. I like the @OutlinedNewApi
to make it clear what this is for other consumers to handle it as they see fit.
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #4
Given the failure mode can include run-time crashes, that's not an acceptable level of usage.
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)