Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Can you give us the sample app or code that's exhibiting this problem?
jb...@google.com <jb...@google.com> #3
ma...@gmail.com <ma...@gmail.com> #4
Your examples have an initial delay + a flex time.
So the first instance will be closer to ~30 mins, because you want the periodic work to only be eligible at the end of initial delay + beginning of the flex window.
So the first instance will be closer to ~30 mins, because you want the periodic work to only be eligible at the end of initial delay + beginning of the flex window.
de...@atommobility.com <de...@atommobility.com> #5
No, when `useInitialDelayForPeriodic` is set to `true`, I'm not using a flexInterval... check the code.
jb...@google.com <jb...@google.com> #6
Sorry, i might have misread that part of the source code.
> BUT I'm not finding that. Let's say that "interval" of the periodic work is 15 mins, and I set an "initial delay" also of 15 mins, and I set this going when the user hits the button. I find that the immediate work is performed at 0 mins (triggered explicitly, not by WorkManager, so that's as expected), then at 15 mins NOTHING happens, and only at 30 mins does the first periodic work actually run.
What do you mean when you say - triggered work explicitly ? [ "I find that the immediate work is performed at 0 mins (triggered explicitly, not by WorkManager, so that's as expected)" ]
Which part of the source code are you referring to ?
> BUT I'm not finding that. Let's say that "interval" of the periodic work is 15 mins, and I set an "initial delay" also of 15 mins, and I set this going when the user hits the button. I find that the immediate work is performed at 0 mins (triggered explicitly, not by WorkManager, so that's as expected), then at 15 mins NOTHING happens, and only at 30 mins does the first periodic work actually run.
What do you mean when you say - triggered work explicitly ? [ "I find that the immediate work is performed at 0 mins (triggered explicitly, not by WorkManager, so that's as expected)" ]
Which part of the source code are you referring to ?
th...@gmail.com <th...@gmail.com> #7
MyWorker.java:
static void schedulePeriodicWork(Context context, int appWidgetId, String trigger) {
Log.d(TAG, "schedulePeriodicWork for " + appWidgetId);
// do an immediate update, with periodic work kicking in later (subject to Doze etc)
doSomeWork(context, appWidgetId);
^^^^^^
this bit is where I call doSomeWork() directly, when scheduling the periodic work, to get a guaranteed immediate execution of the first work.
static void schedulePeriodicWork(Context context, int appWidgetId, String trigger) {
Log.d(TAG, "schedulePeriodicWork for " + appWidgetId);
// do an immediate update, with periodic work kicking in later (subject to Doze etc)
doSomeWork(context, appWidgetId);
^^^^^^
this bit is where I call doSomeWork() directly, when scheduling the periodic work, to get a guaranteed immediate execution of the first work.
jb...@google.com <jb...@google.com> #8
Yeah.. I realized that's the part of the code that you were talking about. Your source code also had OneTimeWorkRequest's being created (but was not being called by anyone) - so was confused.
Description
When using Navigation SafeArgs
2.4.0-alpha01
+ with Kotlin versions before1.5.0
, you get the following:This is because the
titleCase
API was not added until Kotlin1.5.0
.In
2.4.0-alpha01
+, SafeArgs must be compatible with AGP4.2.0
and as a result Gradle6.7.0
, which is compatible with Kotlin versions prior to1.5.0
.We should avoid using
titlecase
in SafeArgs until we no longer need to support older Kotlin versions. As a workaround, you can update your gradle version to7.0
+.