-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8264786: [macos] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched #3707
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
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked it on 10.15.7
.
before the fix - permission request appears immediately.
after the fix - permission request appears after using TrayIcon
.
@mrserb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 148 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@prsadhuk please review |
Please confirm if it is working in 10.14 and in multiscreen environment. Also, I guess a testcase can be written to see if notification center is coming up for normal awt non-trayicon app(obscuring normal awt window or not) BTW, I see from https://developer.apple.com/documentation/foundation/nsusernotificationcenter?language=objc I think we should use https://developer.apple.com/documentation/usernotifications?language=objc "UNUserNotificationCenter" instead which is the favoured way since Mohave, it seems. |
I cannot confirm that it works on 10.14 since I do not have such a system, this is why in the description of this PR I requested to check the fix by someone on 10.14/10.15. Thanks to Alexander who confirm it on 10.15. To test this functionality the user will need to enable the notification center, which should be disabled by default for the execution of our tests, then checks that the "Do not disturb" is not set for the current time, remove the java from the allow/disallow list. And then the user should return all that back. If some step will be skipped it will affect the tests executed after. I prefer do not to request that.
I know, this information is already in the jbs. When we will move further from the macOS10.14 in our JDK trains we probably should migrate to the new API. |
/integrate |
@mrserb Since your change was applied there have been 163 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 020236c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The fix for the JDK-8187639 reimplemented the tray icon messages using the standard notification center, it worked fine on macOS 10.9. But on the new macOS, the usage of that API requests permission from the user. Since the code was added to the NSApplicationAWT this request is always shown even if the app does not use tray icons. This fix moves the code to the tray icon itself. I have tested this on macOS 11.2. It will be good if someone can check macOS 10.14 or macOS 10.15.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3707/head:pull/3707
$ git checkout pull/3707
Update a local copy of the PR:
$ git checkout pull/3707
$ git pull https://git.openjdk.java.net/jdk pull/3707/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3707
View PR using the GUI difftool:
$ git pr show -t 3707
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3707.diff