-
Notifications
You must be signed in to change notification settings - Fork 977
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
Bump SDK from 30 to 31 #1226
Bump SDK from 30 to 31 #1226
Conversation
490360d
to
a9577b5
Compare
Thanks, @hiqua!
|
@iSoron we can no longer close the notification panel when we snooze a habit. At least not with Since users can now snooze notifications (https://support.google.com/android/answer/9079661?hl=en#zippy=%2Csnooze-notifications), I suggest we just deprecate the |
Sounds good. We had disabled the snooze button back when notification snoozing was first introduced (in Android 8?), but eventually brought it back because it was very hard for users to discover that functionality. Android 12 made it more visible, so hopefully we are fine this time. |
Merged, thanks! |
I suggest that the snooze behavior is maintained for the following reasons:
|
@t214c how do you suggest we deal with the limitations mentioned in #1226 (comment)? |
@hiqua I don't know since I am not a developer. If I understand correctly, it is something the user can swipe manually. So, I think missing notifications (It happened to me and I only caught it while reviewing the habit calendar history that I found multiple days unchecked that I was sure I didn't tap "no" on) is more of an issue that not closing the panel Also, Foxy Droid seems to close the notification panel automatically when it is done checking for repo updates and finding nothing. Maybe this can help? |
If I read their config correctly, they're using an old API for which (I think) we haven't deprecated the snooze button yet. The problem is for newer versions of Android. Overall there are pros in having a more advanced snooze feature, I just don't think it's really worth spending efforts on if the OS actually has a basic version of it. Or let's say I won't volunteer to do that myself. |
Another app, KeyMapper targets API 32 and has multiple actions to manipulate the notification panel/status bar:
I am not sure if any/all of these require special permissions. You'd be able to tell.
I understand. Thanks for looking into it and your volunteer work on LHT. What I am suggesting is that the system snooze feature is just a lacking implementation and the absence of recreating notifications after startup has lead me to miss a weekly habit before. Tasks already does that recreation of unmanaged notification. Perhaps it could be modelled into LHT? Thanks |
It looks like KeyMapper uses accessibility services to perform some of these actions. As explained in Android docs, "accessibility services should only be used to assist users with disabilities in using Android devices and apps." I agree that we should not spend time/effort re-implementing existing OS functionality. |
@iSoron Since the feature already exists (the Later button), I was hoping that you would leave it for Android 12. I am a bit disappointed but I understand your decision. Thanks for the great app. |
@t214c We removed it because it stopped working correctly on Android 12, due to changes made by Google. The button is still there for users on Android 11 and lower. |
@iSoron I am confused. Isn't the change in API 31 about disallowing closing the notification panel or is the snooze function itself affected? |
@iSoron weird, I'm on Android 12 with uhabbits 2.0.3 and… the "Postpone" feature works brilliantly and even survives restarts. I actually value it A LOT: it offers way more options than system one (which is honestly "half-baked" to say the least) and allow easy personalization, widget to select the postpone time is big and easy to navigate and, as mentioned before - it survives restarts. I was kinda surprised when I saw changelog mentioning removal of this feature - why remove something that works and do it well (yes, I'm aware about API versioning and google forcing something but still - it works) |
@woj-tek Loop 2.0 targets Android 11 (API 30), so Android 12 (API 31) runs the app on compatibility mode and the feature works. From what I understand, when we increased the target to Android 12 in this PR, and in Loop 2.1, as required by Google Play, the feature stopped working correctly. Since this is already an OS feature, I don't think it's worth spending the time to fix it; but if someone is interested in fixing it, and the fix is trivial, I will consider the PR. |
Hmmm, so this is a requirement by Google Play store and not the Google/development itself (and also applies after "Starting in November 2022, app updates must target API level 31" )? So if anyone uses F-Droid that would be kinda moot (though, I understand that your main distribution point in Play Store)? Would it be still possible to have 2.1.x release with API Level 30 released before November? |
It would probably take way less effort to fix this feature on API 31 than to maintain a separate API 30 fork for F-Droid users. Also, I expect Loop 2.2.x to target API 33, so the fork would get progressively more divergent and harder to maintain. |
I have almost zero experience with Android development though just wanted to confirm - running snooze dialogue and actually postponing the notification works fine but closing the notification panel in https://github.com/hiqua/uhabits/blob/1c15e7742ec9722235e790e8a2ae661072cf56c7/uhabits-android/src/main/java/org/isoron/uhabits/receivers/ReminderController.kt#L72 via
Is this correct? (Just trying to sense if the path is right, and I should dig some more into it :-) ) |
@woj-tek that's my understanding, yes. |
/me is scratching his head. From the linked documentation uhabits/uhabits-android/src/main/java/org/isoron/uhabits/receivers/ReminderController.kt Lines 72 to 78 in 1c15e77
so the last line of the method should also close the notification drawer? If that doesn't work (i.e. notification panel is not closed) then it looks like a bug in Android? Though I'm not sure about this bit: "while a window is on top of the notification drawer" - how can a window be on top of the notification drawer...? |
I suggest you install Android Studio and play with the old code and the deprecated snoozing feature in an emulator to get a better understanding of what the problem is. It's unlikely I or @ iSoron will work on this anyway, so this is mostly not actionable. I don't have the exact details in mind anymore. |
Hmm, cloned the repo, opened it in Android Studio (master branch), it started the build and failed with:
Seems to be caused by f082842, reverting to previous I restored removed notification code and I'll play a bit with it, thanks :-) |
No description provided.