Created
January 19, 2017 22:43
-
-
Save brendan-fahy/ad1eeb7e6cb1b1e82e1b4a444f8bd8c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isCharging || isUnknown) { | |
jobScheduler.schedule(jobInfo(context)) | |
} else if (hasBeenDisconnected) { | |
jobScheduler.cancelAll() | |
// FIXME this is a pretty hacky way of getting the job done :( | |
(context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager) | |
.cancel(NOTIFICATION_ID) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment