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

Convert NoticeNotification to Kotlin #4977

Merged
merged 6 commits into from
Oct 17, 2022
Merged

Convert NoticeNotification to Kotlin #4977

merged 6 commits into from
Oct 17, 2022

Conversation

pAkalpa
Copy link
Contributor

@pAkalpa pAkalpa commented Oct 15, 2022

Fixes #4414

Description of the Change

Convert NoticeNotification.java to NoticeNotification.kt

Alternate Designs

nil

Release Notes

@codecov
Copy link

codecov bot commented Oct 15, 2022

Codecov Report

Attention: Patch coverage is 57.69231% with 44 lines in your changes missing coverage. Please review.

Project coverage is 10.83%. Comparing base (66b52b5) to head (c3f5e79).
Report is 1336 commits behind head on master.

Files with missing lines Patch % Lines
...va/edu/berkeley/boinc/client/NoticeNotification.kt 57.69% 38 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4977      +/-   ##
============================================
+ Coverage     10.68%   10.83%   +0.15%     
- Complexity     1055     1064       +9     
============================================
  Files           278      278              
  Lines         35991    35996       +5     
  Branches       8126     8127       +1     
============================================
+ Hits           3844     3899      +55     
+ Misses        31765    31708      -57     
- Partials        382      389       +7     
Files with missing lines Coverage Δ
...va/edu/berkeley/boinc/client/NoticeNotification.kt 57.69% <57.69%> (ø)

... and 3 files with indirect coverage changes

@pAkalpa pAkalpa changed the title Remove NoticeNotification.java Convert NoticeNotification to Kotlin Oct 15, 2022
@AenBleidd AenBleidd self-requested a review October 15, 2022 20:36
@AenBleidd AenBleidd self-assigned this Oct 15, 2022
@AenBleidd AenBleidd added this to the Client 7.22.0 milestone Oct 15, 2022
Copy link
Member

@AenBleidd AenBleidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nice to fix this two hints:

  • Missing PendingIntent mutability flag (Line 67)
  • Missing PendingIntent mutability flag (Line 132)

import javax.inject.Inject
import javax.inject.Singleton

@RequiresApi(VERSION_CODES.M)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We support Android versions starting from Android 4.1 (API level 16).
If this set, this will not work for any that is older than Android 6.0 (API level 23).
So you should either find a way to fix that warning without increasing making ANdroid 6.0 as a minimal supported version or just rollback and leave it as-is (the first in preferred).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add the below code, but a deprecated warning won't go away
contentIntent = if (VERSION.SDK_INT >= VERSION_CODES.M) { PendingIntent.getActivity(context, 0, intent,PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT) } else { PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT) }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then just rollback your last commit and it should be ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And add this annotation at the top of this class:

@SuppressLint("UnspecifiedImmutableFlag")

@AenBleidd AenBleidd merged commit 1f95459 into BOINC:master Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

[Android] Convert left *.java files to Kotlin
2 participants