-
Bug
-
Resolution: Fixed
-
P3
-
10, 11, 13, 15, 16, 17
-
- 11-bp
- CPU21_07-critical-SQE-OK
- CPU21_07-critical-approved
- azul-interest
- dcsnr
- dcspn
- jdk11u-fix-request
- jdk11u-fix-yes
- jdk13u-fix-request
- jdk13u-fix-yes
- jdk15u-fix-request
- jdk15u-fix-yes
- jdk16u-fix-SQE-ok
- jdk16u-fix-request
- jdk16u-fix-yes
- macos
- noreg-other
- regression
- reproducer-yes
- sn_90
- sn_92
- webbug
-
b21
-
x86_64
-
os_x
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8268412 | 16u-cpu | Christoph Langer | P3 | Resolved | Fixed | master |
JDK-8268247 | 16.0.2 | Christoph Langer | P3 | Resolved | Fixed | b07 |
JDK-8266484 | 15.0.4 | Vladimir Kempik | P3 | Resolved | Fixed | b02 |
JDK-8266488 | 13.0.8 | Vladimir Kempik | P3 | Resolved | Fixed | b02 |
JDK-8266533 | 11.0.13-oracle | Sergey Bylokhov | P3 | Resolved | Fixed | b01 |
JDK-8269324 | 11.0.12.0.1-oracle | Sergey Bylokhov | P3 | Resolved | Fixed | b01 |
JDK-8267032 | 11.0.12-oracle | Sergey Bylokhov | P3 | Resolved | Fixed | b04 |
JDK-8266597 | 11.0.12 | Vladimir Kempik | P3 | Resolved | Fixed | b02 |
MacOS 10.15.7
OpenJDK 11.0.9 and 16.0.0 (but not on 9.0.7.1).
A DESCRIPTION OF THE PROBLEM :
After the implementation of
"java" Notifications
Notifications may include alerts, sounds, and icon badges.
Don't Allow/Allow?
The prompt confuses/annoys users, since our app should not be causing any notifications to happen.
The bug appears to have been introduced with
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
I managed to cause a similar permission popup to appear from a standalone Objective-C app that just performs the call above. So this seems likely to be the cause.
The suggested fix is to only call NSUserNotificationCenter.setDelegate if the TrayIcon facility is actually used, i.e. in src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m instead of always when the native Toolkit is being initialized.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Open "System Preferences" and then the "Notifications" pane. If there is any entry or entries for "java" in the panel to the left, select each entry and press the Delete key (Fn+Backspace) to reset the notification prompt, to ensure that it pops up in the next step.
2) Run the attached trivial AWT app, which just calls Toolkit.getDefaultToolkit(). Any Swing or AWT action would work.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The app should exit uneventfully, with no user-visible permission popup.
ACTUAL -
An OS-level prompt pops up, asking the user to permit notifications from "java".
---------- BEGIN SOURCE ----------
import java.awt.Toolkit;
public class SpuriousNotificationExhibit {
public static final void main(String args[]) throws Exception {
// Any Swing or AWT action which would cause the toolkit to be initialized would work here.
Toolkit.getDefaultToolkit();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No workaround exists. Though obviously the user can click away the popup.
FREQUENCY : always
- backported by
-
JDK-8266484 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8266488 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8266533 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8266597 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8267032 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8268247 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8268412 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
-
JDK-8269324 [macOS] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
- Resolved
- relates to
-
JDK-8187639 TrayIcon is not properly supported on macOS in multi-screen environment
- Resolved
- links to
-
Commit openjdk/jdk13u-dev/61803a99
-
Commit openjdk/jdk15u-dev/acf2eea2
-
Commit openjdk/jdk16u/375be171
-
Commit openjdk/jdk/020236cb
-
Review openjdk/jdk13u-dev/196
-
Review openjdk/jdk15u-dev/42
-
Review openjdk/jdk16u/122
-
Review openjdk/jdk/3707