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

Issue/5530 basic notification channels android o #7593

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Apr 4, 2018

Fixes #5530

Note: Please note this PR only creates the needed Notification Channels for Android O, but does not care for the other new restrictions on the platform.(# and #) These will be addressed in other PRs.

This PR creates the Notification Channels as required in Android Oreo, and updates all of the instances of NotificationCompat.Builder constructor calls to pass the channel ID.

This PR creates 2 notification channels (named "Important" and "General"), because the 2fa auth notification should have a maximum priority and now the priorities cannot be set on the Notifications themselves but rather belong to the Channels these notifications belong to on Android O+ devices.

To test:
On Android 8+

  1. Run the app
  2. Now go to the device's Settings screen -> Apps & notifications -> WordPress
  3. Tap on "App Notifications"
  4. You should see the 2 new channels created under the section labelled "Categories":
    a. Important
    b. General

screenshot_20180404-141901

On Android N and lower:

  • Nothing should change.

cc @nbradbury

@nbradbury nbradbury self-assigned this Apr 4, 2018
@@ -128,6 +131,7 @@ static Notification progress(Context context, int progress, @StringRes int title

static Notification success(Context context) {
return AutoForegroundNotification.success(context,
NotificationsUtils.GENERAL_NORMAL_CHANNEL_ID,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering whether we should use GENERAL_IMPORTANT_CHANNEL_ID for both site creation success and failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could! Just a general comment: this PR does not change the logic we already had in place (i.e. the same importance is kept normal for notifications that were already using the normal priority, and only high for notifications that were already using the high priority).
That said, I don't mind changing it to GENERAL_IMPORTANT_CHANNEL_ID if you feel strongly about it 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, no strong feelings about that. I'm ready to merge but looks like there are some checkstyle issues causing Travis to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops - just fixed that in b55658d and restarted Travis 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Travis is still failing, but I'm not sure why.

…Compat.Builder(context, channelID) constructor, and made changes to make sure the Notifications Channel IDs used in the hosting app are available to the library seamlessly
@mzorz
Copy link
Contributor Author

mzorz commented Apr 4, 2018

@aforcier has thrown some light - what was happening is that the login library was not updated. Updated with his enormous help now. Highlights:

  • method signature should not be an issue now, as it's been updated
  • the new channel ids need be the same as per the hosting application, so here we're using a trick Alex suggested, by having the same declaration of a strings.xml resource entry that is named equally both in the library and the hosting app. The actual value is replaced at compile time by the one in the hosting app notification_channel_normal_id and notification_channel_important_id.
  • a new version of the libs/utils library has been pushed to bintray (also Alex did everything here) with version 1.20.2-beta1. This should get back to 1.20.2 when all proves to be working alright.

🤞 and waiting for Travis now

@mzorz
Copy link
Contributor Author

mzorz commented Apr 4, 2018

There's a funny behavior I'm still trying to check @nbradbury:

  • when uploading a Post with media in it, each progress update produces the notification sound
  • I can change that manually as a user and turn the sound off, but what I really wanted is to keep things as they were, that is, sounds would only be made when the app was in the background (at least that's my perception of how I've been using it).

Let me check a bit and decide whether we should set the sound off for the NORMAL channel

@nbradbury
Copy link
Contributor

Using setAlertOnlyOnce(true) fixed it, and Travis is finally happy - let's :shipit:

@nbradbury nbradbury merged commit e11c972 into issue/7505-api-26-and-multiwindow Apr 4, 2018
@nbradbury nbradbury deleted the issue/5530-basic-notification-channels-android-o branch April 4, 2018 23:03
aforcier added a commit that referenced this pull request Apr 17, 2018
3d1d5e57f6 Merge commit '8d78020e2eebd3ad8e7e73a8dd5f43e40ec74b38' into merge-login
5232ef761b bumped WordPressUtils library version to 1.20.2
92bcc3cd87 Merge branch 'develop' into issue/7505-api-26-and-multiwindow
b5599ef220 Merge pull request #7593 from wordpress-mobile/issue/5530-basic-notification-channels-android-o
9cf1982111 updated the WordPressLoginFlow library to use the latest NofiticationCompat.Builder(context, channelID) constructor, and made changes to make sure the Notifications Channel IDs used in the hosting app are available to the library seamlessly
24b88ce2ec bumped play services lib version
43e4bd4570 Update to latest utils library
6a2db9ca70 Add new format of code style IDEA files to version control
0b51337233 Merge pull request #7561 from wordpress-mobile/update/gradle-4.4
78f1219459 Bump Glide version to 4.6.1 (build fix)
20317d0605 Update Travis build tools in all subtrees to v27
987e683410 Update Gradle wrapper in all subtrees to 4.4
5e2cebb0e5 Update Android Gradle plugin to 3.1
6e71648415 Fixed sign up/in text row centering.
a593bd345c Merge branch 'release/9.6' into develop
9b1ed77c48 changed google api client ID so it's unique to that fragment
c52029827b Merge branch 'develop' into issue/7368-update-dialog-style
5bb44aa53a Update Login Flow support lib modules to 27.1.0
7017a13594 Merge pull request #7522 from wordpress-mobile/feature/awesome-accessibility
b12608c798 Merge pull request #7516 from wordpress-mobile/issue/7515-update-authentication-analytics
04e60abbec Fix few lint issues
6042e53bc4 Merge branch 'develop' into feature/awesome-accessibility
ea7c8eb387 Update progress dialog dismiss method name and null check
1e9d35cf04 Add dismissal of progress dialog from signup Google fragment on detach
73613ec03c Add progress dialog to background of Google signup process
82bd5dac54 Update login autofill credentials filled tracking to use login analytics listener
2ab6fd28be Update login social two-factor authentication needed tracking to use login analytics listener
45466324f0 Update login forgot password clicked tracking to use login analytics listener
6b81b90105 Update login magic link exited tracking to use login analytics listener
e80d492541 Update login magic link open email tracking to use login analytics listener
0f57b41bb6 Update login social success tracking to use login analytics listener
482011a69d Update login autofill credentials updated tracking to use login analytics listener
2ee6a00cb3 Update login accessed tracking to use login analytics listener
c6cf529763 Update login magic link succeeded tracking to use login analytics listener
e4f4801230 Update login magic link opened tracking to use login analytics listener
84659abea1 Targeting API 26 for future version of chrome os support
4c67a15448 Update tracking when signup magic link sent
ca950711ec Add signup magic link sent tracking to login analytics listener interface
407e148216 Merge branch 'develop' into issue/update-created-account
c4be26c70f Merge branch 'release/9.6' into develop
6e2a25afbe Add signup created account tracking to login analytics listener interface
d6397c01a3 Merge branch 'release/9.6' into develop
b3e45aa8ca Fix accessibility issue - sign in/up screen titles
0348d1de8a Merge branch 'develop' into issue/7368-update-dialog-style
27bd459452 Move injector call before attach super statement in signup Google fragment
9853483f44 Move injector call from create to attach in signup Google fragment
5b6c1790e5 Update tracking statement from sign-in to email-to-login in signup email fragment
0df4a45210 Update login library version to 1.1(2)
fca94d2f2d Update signup magic link text views from WordPress to standard widget
2d04536e14 Move signup magic link fragment to login library
e1224e8359 Add sign magic link fragment to login fragment module
5ca549591b Add signup magic link tracking to login analytics listener interface
dca7f334b3 Move signup Google fragment to login library
b2b4ffb0b9 Add sign email fragment to login fragment module
1a5e71ad9c Add signup Google tracking to login analytics listener interface
4b932f3489 Update deprecated show keyboard method in signup email fragment
136902e266 Move signup email fragment to login library
063a64cb0d Add sign email fragment to login fragment module
742a9b1375 Add signup email tracking to login analytics listener interface
9ee9bf31a4 Move signup bottom sheet dialog to login library
582ebe395a Move WordPress bottom sheet dialog to login library
4b90835684 Merge branch 'develop' into issue/7368-update-dialog-style
d8da0b3b6b Merge pull request #7440 from wordpress-mobile/issue/7437-email-availability-error
a1fdfb6c5f Handle IsAvailableErrorType.INVALID and show a dialog for network errors
354e6baffe Drop include/exclude rules from checkstyle task
6f5204e888 Use non-beta version of utils in login library
c5df92a7e0 Merge pull request #7421 from wordpress-mobile/feature/lint_issues
68bee0321a Changed onAvailabilityChecked to show generic error when response is an error
9cf7831198 Add login style as theme to site address help dialog
d62d5d3c3c Add Calypso style as theme to login HTTP authentication dialog
3454caadd5 Update login lib style config files from style-config-android
20e7b8ef39 Import fetchstyle plugin in login library
3c2aebc663 Fix style violations for @Inject annotations
86832842f3 Remove space in front of noinspection comments
4aecb80d99 Merge branch 'develop' into feature/lint_issues
45c058efdd fixed merge conflicts
3560075ad2 Fix checkstyle issues
5aa39999f2 Merge branch 'develop' into feature/lint_issues
89517c1080 Fix style violations in the login subtree
fd297cbb07 Fix inconsistent layouts lint issue
92d37fa0c0 Fix layout inflation without a parent lint issue
8568d161cd Merge pull request #7391 from wordpress-mobile/issue/7389-signin-site-link-hidden
ab7fea8445 Always use ActivityUtils.hideKeyboardForced
3f28c32d95 Removed unused import
45a61d4777 Revert some newlines after annotated return types
947fb6422e When email isn't registered, hide the keyboard to ensure the link to login using the site address is visible
0f49e5981d Fix login input row in accessibility mode
055136cd3b Fix copy/paste error
e7a49a81fc Merge branch 'feature/awesome-accessibility' into 'feature/awesome-accessibility-login-me-sections'
fa77115041 Merge branch 'develop' of github.com:wordpress-mobile/WordPress-Android into feature/awesome-accesibility-merge-dev-fixes
859d7639bf Fix cut off text on the login with email screen
8e28a4142d Fix accessibility issues in login and sign up screens
d6855f4097 Fix inputLoginRow in accessibility mode (TalkBack)
175b4c1e16 Fixed various lint issues.
a9f703e4fe Merge branch 'develop' of github.com:wordpress-mobile/WordPress-Android into feature/rtl-audit-merge-dev-fixes-pt2
893cb17a27 Fix TalkBack support in Login flow
3cbc3e2853 Fix TalkBack support in My site section
a6b0c0dcec Added bintray dependency to submodules.
ef3e6466be Don't promote to foreground if null state
2657d917d2 Temporarily commented out dependencies.
70829630b1 Merge branch 'feature/awesome-accessibility' into 'feature/awesome-accessibility-login-me-sections'
4e9c60ff10 Merge branch 'develop' into 'feature/awesome-accessibility'
d6c90c859c Fix TalkBack support
80ac0bb810 Merge pull request #7264 from wordpress-mobile/issue/7241-update-site-button
8064c077cd Add contentDescription to image views
49e534bc72 Update email login logic for site address and username buttons
9a9b72d894 Update email login layout with site address and username buttons
0a2b80a38a Add vector drawable resources for site address and username login buttons
08217b86d6 Update string resources for site address and username login buttons
86cc0be82c Added lint check to modules.
02b45a33da Merge branch 'feature/new-signup' into feature/site-creation-theme-retry-when-connectivity
f000a1f0bf Merge branch 'develop' into feature/new-signup
68d728578f Merge branch 'develop' into 'feature/rtl-audit'
0eebc9fb17 Fix ltr layouts with rtl locale on sdk 17
687f6512f3 Offer a "Close" button on failure after creation
20c1955d15 Fix homeAsUp arrow direction in RtL mode - login flow
d6bd91d73a Merge branch 'develop' into feature/new-signup
00ff43a435 Remove deprecated and unneeded publishNonDefault
339d7aa76b Update library gradle wrappers to version 4.1
896a9f6689 Fix padding in the rtl mode
c31842a5df Bump Gradle plugin to 3.0.1
5d33aa81c6 Use new dependency configurations
3a0cb5cc23 Bump build tools to 26.0.2
64f4416d4c Add gradle plugin to project-level gradle file
6ec8035db2 Bump gradle plugin to 3.0.0
04ffd3de3a Rename "phase" to "step", single ServiceState interface
8dd351e294 Fix toolbar search padding in rtl mode
0b285ab6ca Fix toolbar search padding in rtl mode
e8b481dbff Pass a StateClass instance up/down to AutoForeground
522991b070 Bump utils version to 1.20.0-beta4
9012a7a27d Stop managing google api client even if it's not connected.
b52f49095d Use 1.20.0-beta3. Fixes AutoForeground.clearServiceState()
ffaa5238da Fix email label alignment in rtl mode
97ee7abd20 Revert "Clear login service state right before entering screen"
4c7f912b68 Clear login service state right before entering screen
aabdda5b5a Remove unused import in WpLoginInputRow and Fix email textAlignment on login screen
31482cf715 Add signup magic link fragment help method to login listener interface
6d653296f3 Add signup magic link fragment to login listener interface
642ee2da53 Fix lint error (missing super call) in WpLoginInputRow
5383611d58 Fix rtl layouts in login flow
4611398c35 Fix login input in rtl mode
81fad6d95f Add signup email fragment help method to login listener interface
25d175aebd Merge pull request #7077 from wordpress-mobile/feature/login-library-shared-fluxc-hash
99c603a4ad Add missing endProgress()
00d50ddc50 Dismiss progress dialog both on success and failure
3e6e3b80b4 Use host project's FluxC hash in login lib if defined
de85db5e87 Merge branch 'feature/new-signup' into issue/6851-add-epilogue-social
8395c1b03c Login, SiteCreation notification classes
1f46255094 Use utils' AutoForegroundNotification in login library
40a74c6481 Use beta utils lib build in login library
0d2b947c45 Merge branch 'develop' into feature/merge-loginlib-into-signup
827529a618 Merge branch 'develop' into feature/extract-login-flow
bffa750eb4 Merge branch 'develop' into feature/extract-login-flow
077f225248 Delegate service starting to onLoginFinished()
6c63048155 Merge branch 'develop' into feature/extract-login-flow
4d6932def8 Merge branch 'develop' into feature/extract-login-flow
15bb80db9e Merge branch 'develop' into feature/extract-login-flow
a70c4b86bd Replace LoginListener tracking with LoginAnalyticsListener
67fd3db86c Add LoginAnalyticsListener with tracking methods
b8a100aa2e Delegate login service startup to concrete fragments
99538cc23f s/showGoogleLoginScreen/addGoogleLoginFragment/
9e4b312bd0 s/saveCredentials/saveCredentialsInSmartLock/
b84cd9f6a6 Use a valid request code for EMAIL_CREDENTIALS
af299cafb3 Fix Checkstyle issues
f4724f9329 Merge branch 'develop' into feature/extract-login-flow
6a0691db36 Update FluxC hash
9f1dbf5c02 Correct log message
01c9f7e70e Update LoginListener nullability annotations
0c1b7fa2a4 Separate login fragments and service into separate modules
cb3f5b8ec3 Update annotation for fields that are actually Nullable
b88efd4f92 Upgrade Glide to 4.1.1
2daadf52c0 Use fully qualified imports
40e07b78a5 Add placeholder value for google login's default_web_client_id
d4f05a35ff Move LoginGoogleFragment to login library
3dbff988c9 Restore static versions for sdk, tools, and support library
8b06303961 Retain official Volley instead of mcxiaoke
88102359e5 Delete now-unused ActivityUtils
c1b25c40fe Merge commit '6c8db25d6759bd8ce0ebdeee85fb8fbdd58ee139' into feature/extract-login-flow
bb43e1d671 Inject FluxC components into LoginWpcomService via the application
fe5717390d Offload post-login actions to OnLoginStateUpdated handler
1fd600e9e6 Merge branch 'develop' into feature/extract-login-flow
2bfd93de41 Update utils version

git-subtree-dir: libs/login
git-subtree-split: 3d1d5e57f6e44ca52bd71829c3ad1af77f5b53f6
wzieba pushed a commit that referenced this pull request Sep 27, 2024
…ication-channels-android-o

Issue/5530 basic notification channels android o
wzieba pushed a commit that referenced this pull request Oct 21, 2024
…ication-channels-android-o

Issue/5530 basic notification channels android o
wzieba pushed a commit that referenced this pull request Oct 21, 2024
…ication-channels-android-o

Issue/5530 basic notification channels android o
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