Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Revert back to target API 21 #5338

Conversation

AenBleidd
Copy link
Member

In #3418 I changed the behavior of BOINC to run always in the foreground mode. This lead to the situation when notification was always shown, even when BOINC in not running, and thus making a lot of notification noise. 3 years ago I thought that this is good decision and a necessary evil. Unfortunately, I was wrong.
My main motivation of this was to be able to be on track, and have our application in the Play Store. But every new API increase the limitations from the Android side become stronger and stronger, and prevent us from doing what we want. For example, in the Android versions starting from Oreo, it is not possible to start a service from the background. And while we can leave with that fact, we received and issue with the notifications. I thought, that if we will have BOINC always running on the foreground, it will be possible to keep it always running and prevent it from being killed by the system. Unfortunately, this is not the case.
The system still kills the application, and the notification is still shown. And this is not the only problem.
Other problem is that starting from API 29, we are not able to start executables downloaded from the server. Since this is a core functionality, we are not able to target API 29 or higher. And since we are not able to target API 29 or higher, we are not able to put BOINC in the Play Store. And thus it makes no sense to target any API higher than 21 because it will just kill the functionality of the application. So, I decided to revert back to the API 21, and make the application work as it was before. But even in this case there is a chance that on the newer version of Android, some of the gard limitations will be applied, and it will prevent (again) BOINC from working. But at least currently application is working, and we can add necessary features to it. The only issue I see now is that the user will see a notification, that this application was developed for the older version of Android and thus might not work correctly, but I believe we can live with that.

This fixes: #4189, #4218 and #4190

In BOINC#3418 I changed the behavior of BOINC to run always in the foreground mode.
This lead to the situation when notification was always shown, even when BOINC in not running, and thus making a lot of notification noise.
3 years ago I thought that this is good decision and a necessary evil.
Unfortunately, I was wrong.
My main motivation of this was to be able to be on track, and have our application in the Play Store.
But every new API increase the limitations from the Android side become stronger and stronger, and prevent us from doing what we want.
For example, in the Android versions starting from Oreo, it is not possible to start a service from the background.
And while we can leave with that fact, we received and issue with the notifications.
I thought, that if we will have BOINC always running on the foreground, it will be possible to keep it always running and prevent it from being killed by the system.
Unfortunately, this is not the case.
The system still kills the application, and the notification is still shown.
And this is not the only problem.
Other problem is that starting from API 29, we are not able to start executables downloaded from the server.
Since this is a core functionality, we are not able to target API 29 or higher.
And since we are not able to target API 29 or higher, we are not able to put BOINC in the Play Store.
And thus it makes no sense to target any API higher than 21 because it will just kill the functionality of the application.
So, I decided to revert back to the API 21, and make the application work as it was before.
But even in this case there is a chance that on the newer version of Android, some of the gard limitations will be applied, and it will prevent (again) BOINC from working.
But at least currently application is working, and we can add necessary features to it.
The only issue I see now is that the user will see a notification, that this application was developed for the older version of Android and thus might not work correctly,
but I believe we can live with that.

This fixes: BOINC#4189, BOINC#4218 and BOINC#4190

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
@AenBleidd AenBleidd force-pushed the vko_android_try_to_rollback_to_the_older_sdk_version branch from f66c97d to 9dd7396 Compare August 19, 2023 21:29
@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

Merging #5338 (9dd7396) into master (640be40) will increase coverage by 0.02%.
Report is 2 commits behind head on master.
The diff coverage is 60.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5338      +/-   ##
============================================
+ Coverage     10.84%   10.87%   +0.02%     
- Complexity     1064     1068       +4     
============================================
  Files           279      279              
  Lines         36036    36058      +22     
  Branches       8331     8334       +3     
============================================
+ Hits           3909     3920      +11     
- Misses        31735    31744       +9     
- Partials        392      394       +2     
Files Changed Coverage Δ
...src/main/java/edu/berkeley/boinc/client/Monitor.kt 12.45% <0.00%> (-0.07%) ⬇️
...ain/java/edu/berkeley/boinc/client/MonitorAsync.kt 0.00% <0.00%> (ø)
...va/edu/berkeley/boinc/client/ClientNotification.kt 86.20% <71.42%> (-3.12%) ⬇️
...n/java/edu/berkeley/boinc/client/AppPreferences.kt 82.35% <100.00%> (+1.70%) ⬆️

@AenBleidd AenBleidd marked this pull request as ready for review August 19, 2023 22:59
@AenBleidd AenBleidd merged commit e6fd731 into BOINC:master Aug 19, 2023
46 checks passed
@AenBleidd AenBleidd deleted the vko_android_try_to_rollback_to_the_older_sdk_version branch August 19, 2023 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment