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

DND Code Review changes #449

Merged
merged 2 commits into from
Feb 24, 2024
Merged

DND Code Review changes #449

merged 2 commits into from
Feb 24, 2024

Conversation

masonhfisher
Copy link
Contributor

I implemented all (if not most of) the suggestions you made in the code review at pull request #448

By the way sorry about the fact there are no tests, I'm mostly a beginner with Android development and don't have much experience with testing in general as well. But hopefully these changes find you well!

@vmiklos
Copy link
Owner

vmiklos commented Feb 23, 2024

Could you rebase this on top of master? Looks like this PR contains both your old & new work, while it should only contain your new work. :-) Thanks.

@vmiklos
Copy link
Owner

vmiklos commented Feb 23, 2024

Ah, I just realized it's a single commit, I just did it for you.

@vmiklos
Copy link
Owner

vmiklos commented Feb 23, 2024

By the way sorry about the fact there are no tests, I'm mostly a beginner with Android development and don't have much experience with testing in general as well.

I like to believe I'm quite good at testing (I have python/rust/go projects where test coverage is almost complete) and Android testing is quite hard. :-) So no problem, I just tried my luck.

Copy link
Owner

@vmiklos vmiklos left a comment

Choose a reason for hiding this comment

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

Care to rework to not warn in the default config? After that iteration this should be fine, I think. Thanks!

val filterAll = NotificationManager.INTERRUPTION_FILTER_ALL
dndManager.setInterruptionFilter(preferences.getInt("current_dnd", filterAll))
if (dndManager.isNotificationPolicyAccessGranted) {
if (dndEnabled) {
Copy link
Owner

Choose a reason for hiding this comment

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

I think you got the order wrong here: my suggestion was:

if (enabled) {
  if (havePermission) {
    ...
  } else {
   ... warn ...
  }
}

@@ -30,76 +20,6 @@ class Preferences : PreferenceFragmentCompat() {
it.summary = path
}
}

override fun onPreferenceTreeClick(preference: Preference): Boolean {
Copy link
Owner

Choose a reason for hiding this comment

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

But this one looks quite nice, good to get rid of this.

Don't warn in default config
@masonhfisher
Copy link
Contributor Author

Ah, I just realized it's a single commit, I just did it for you.

Yeah sorry about that, I thought it would of done that automatically.

Care to rework to not warn in the default config? After that iteration this should be fine, I think. Thanks!

If I'm correct you mean to remove the log.w methods and so I removed them in commit a1562e0

@vmiklos vmiklos merged commit bd4b5d6 into vmiklos:master Feb 24, 2024
1 check passed
@vmiklos
Copy link
Owner

vmiklos commented Feb 24, 2024

The warnings are gone in the default config, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants