Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

For #4113. Add extension method for creating service PendingIntent. #4329

Merged
merged 2 commits into from
Sep 9, 2019

Conversation

dector
Copy link
Contributor

@dector dector commented Sep 5, 2019


Moved pending intent creation for crash service to support-utils.

Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry or does not need one
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

After merge

  • Milestone: Make sure issues closed by this pull request are added to the milestone of the version currently in development.
  • Breaking Changes: If this is a breaking change, please push a draft PR on Reference Browser to address the breaking issues.

@dector dector requested a review from a team as a code owner September 5, 2019 19:14
* @param context an [Intent] to start a service.
*/
@JvmName("createPendingIntentForLaunchService")
fun Intent.asPendingIntentForLaunchService(context: Context): PendingIntent =
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think the name should mention that it is a foreground service!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Naming ideas are welcomed. I don't think that we can use "foreground" here because it's decieving for older android versions. Technically this is just a service-that-can-start-activities-from-background.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think using foreground makes still sense here. It will gracefully downgrade on services before Q - similar to ContextCompat.startForegroundService().

Copy link
Contributor

@rocketsroger rocketsroger Sep 9, 2019

Choose a reason for hiding this comment

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

This is a tough one. Both makes sense. I would lean towards adding "foreground" because most users of this extension function will be supporting O+ devices and would need to be aware that this will start a foreground service.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deal. I'll change the name, thanks. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️ Done.

@pocmo pocmo requested a review from rocketsroger September 6, 2019 09:29
@pocmo pocmo added the 🕵️‍♀️ needs review PRs that need to be reviewed label Sep 6, 2019
@dector dector changed the title For #4113. Add extension method for creating service PendingIntent. For #4113. Add extension method for creating service PendingIntent. Sep 9, 2019
@codecov
Copy link

codecov bot commented Sep 9, 2019

Codecov Report

Merging #4329 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4329      +/-   ##
============================================
- Coverage     81.26%   81.26%   -0.01%     
+ Complexity     3993     3992       -1     
============================================
  Files           521      522       +1     
  Lines         17713    17715       +2     
  Branches       2607     2607              
============================================
+ Hits          14395    14396       +1     
- Misses         2250     2252       +2     
+ Partials       1068     1067       -1
Impacted Files Coverage Δ Complexity Δ
...n/java/mozilla/components/support/utils/intents.kt 0% <0%> (ø) 0 <0> (?)
...onents/lib/crash/notification/CrashNotification.kt 93.93% <100%> (+8.22%) 2 <0> (ø) ⬇️
...s/lib/push/firebase/AbstractFirebasePushService.kt 70.37% <0%> (-3.71%) 8% <0%> (ø)
...nts/browser/storage/sync/PlacesBookmarksStorage.kt 60% <0%> (-0.61%) 12% <0%> (-1%)
...nts/service/glean/histogram/FunctionalHistogram.kt 80.32% <0%> (-0.38%) 12% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1fdc7a...b363aad. Read the comment docs.

Copy link
Contributor

@rocketsroger rocketsroger left a comment

Choose a reason for hiding this comment

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

Looks good. 🚢

@rocketsroger
Copy link
Contributor

bors r+

bors bot pushed a commit that referenced this pull request Sep 9, 2019
4329:  For #4113. Add extension method for creating service `PendingIntent`.  r=rocketsroger a=dector



Co-authored-by: Denys M <dector9@gmail.com>
@bors
Copy link

bors bot commented Sep 9, 2019

Build succeeded

@bors bors bot merged commit b363aad into mozilla-mobile:master Sep 9, 2019
@rocketsroger rocketsroger removed the 🕵️‍♀️ needs review PRs that need to be reviewed label Sep 9, 2019
@rocketsroger rocketsroger modified the milestone: 🍉 12.0.0 Sep 9, 2019
@dector dector deleted the 4113-pending-intent-builder branch September 10, 2019 18:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants