Status Update
Comments
vi...@gmail.com <vi...@gmail.com> #3
since it is already marked as deprecated, we can probably do it by now.
vi...@gmail.com <vi...@gmail.com> #4
Opening diff shortly
su...@google.com <su...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/61 .
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
https://android-review.googlesource.com/1396827
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request from
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
ra...@google.com <ra...@google.com> #6
This is expected. We migrated your JobScheduler jobs in alpha04. This caused all your old jobs (In JobScheduler) to get cancelled, and rescheduled to create new replacements.
We are the source of truth for Workers, so this is not a problem. Your jobs will still run ~once every 24 hours.
On API 23, we double scheduler Workers to work around an issue in JobScheduler. There will be cases where you will see 2 jobs, but we will internally de-dupe them and only 1 will every execute.
This is also expected.
Is there something else which is unexpected that's going on ?
We are the source of truth for Workers, so this is not a problem. Your jobs will still run ~once every 24 hours.
On API 23, we double scheduler Workers to work around an issue in JobScheduler. There will be cases where you will see 2 jobs, but we will internally de-dupe them and only 1 will every execute.
This is also expected.
Is there something else which is unexpected that's going on ?
vi...@gmail.com <vi...@gmail.com> #7
Yes, I noted two issues in API 23:
1. doWork() method call instantly after creating new PeriodicWorkRequest.
2. doWork() method call if I restart the device and open my application from device menu again.
In API <23 and >23 it is not calling doWork() method in above scenario. doWork() executes only after the time mentioned in PeriodicWorkRequest and working fine as expected.
You can refer GitHub code:https://github.com/patelviraj/WorkManagerDayCounter for a better idea.
1. doWork() method call instantly after creating new PeriodicWorkRequest.
2. doWork() method call if I restart the device and open my application from device menu again.
In API <23 and >23 it is not calling doWork() method in above scenario. doWork() executes only after the time mentioned in PeriodicWorkRequest and working fine as expected.
You can refer GitHub code:
ni...@gmail.com <ni...@gmail.com> #8
I got also an issue in alpha04 with PeriodicTask, I schedule PeriodicTask1 which should execute once a day with internet constraint.
The app contains a button which will try to schedule PeriodicTask2, which should execute once a day with internet constraint. I check if already schedule and if it does I do nothing.
Well this seems to "wakeup" the workmanager and it start PeriodicTask1 everytime. I'll do a sample and send it in another bug issue.
The app contains a button which will try to schedule PeriodicTask2, which should execute once a day with internet constraint. I check if already schedule and if it does I do nothing.
Well this seems to "wakeup" the workmanager and it start PeriodicTask1 everytime. I'll do a sample and send it in another bug issue.
su...@google.com <su...@google.com> #9
Re: #8, could you please file a separate bug so we can look at your exact issue?
ra...@google.com <ra...@google.com> #10
I just tried creating PeriodicWorkRequests on API 22, 27 & 28.
On all API levels the first instance of the PeriodicWorkRequest runs immediately. The second instance of them runs per schedule.
For (2): doWork() will be called when you do a reboot, as upon reboot Jobs are rescheduled.
So this is also WAI.
If you would like to provide us with more info, then I can reopen this bug.
On all API levels the first instance of the PeriodicWorkRequest runs immediately. The second instance of them runs per schedule.
For (2): doWork() will be called when you do a reboot, as upon reboot Jobs are rescheduled.
So this is also WAI.
If you would like to provide us with more info, then I can reopen this bug.
ra...@google.com <ra...@google.com> #11
I also checked API 23.
vi...@gmail.com <vi...@gmail.com> #12
Please find additional info as follow:
I have attached two images of Logcat which I get in API 26 and API 23.
doWork() code in file DayIncrementWorker.java:https://drive.google.com/file/d/1K5A97BLp4gZPUY1ZursE3xwKiSSFt8mD/view
PeriodicWorkRequest code in DayIncrementViewModel.java:https://drive.google.com/file/d/13u2RgoZZ8aOU_D7us0F4NEntespwcm0V/view
Full Source Code:https://drive.google.com/drive/folders/1Vy1tIUbKtp2AhDd6j8uJD89R__QMaEa6
The problem occurs only in API 23. In rest of the API levels, it is working fine.
I have attached two images of Logcat which I get in API 26 and API 23.
doWork() code in file DayIncrementWorker.java:
PeriodicWorkRequest code in DayIncrementViewModel.java:
Full Source Code:
The problem occurs only in API 23. In rest of the API levels, it is working fine.
ni...@gmail.com <ni...@gmail.com> #13
#9 / su , I found that my issue is linked to https://issuetracker.google.com/issues/111195153
It seems that if we have a periodicworker scheduled, scheduling another worker (a onetime this time) will run the periodicworker each time.
I have a button that schedule a onetimeworker, and by debugging I saw that the getEligibleWorkForScheduling in the schedule method of Schedulers class will return my periodic worker, then be called again, this time it return the onetime worker, and then the last time it returns an empty list.
It seems that if we have a periodicworker scheduled, scheduling another worker (a onetime this time) will run the periodicworker each time.
I have a button that schedule a onetimeworker, and by debugging I saw that the getEligibleWorkForScheduling in the schedule method of Schedulers class will return my periodic worker, then be called again, this time it return the onetime worker, and then the last time it returns an empty list.
Description
Version used: 1.0.0-alpha03
Devices/Android versions reproduced on: API 23 (Emulator as well as Real Device)
- Screen recording is attached here
Also, I have created a demo project on GitHub:
The issue is also reported here: