Skip to content

Commit e3c694d

Browse files
authored
[CQ] migrate off to-be-removed Notification APIs (#8075)
Migrates from unsafe slated-for-removal `Notification` constructors. See: #7718 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent b4e4989 commit e3c694d

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

flutter-idea/src/io/flutter/FlutterMessages.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static void showWarning(String title, String message, @Nullable Project p
3737
FLUTTER_NOTIFICATION_GROUP_ID,
3838
title,
3939
message,
40-
NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER), project);
40+
NotificationType.WARNING).setListener(NotificationListener.URL_OPENING_LISTENER), project);
4141
}
4242

4343
public static void showInfo(String title, String message, @Nullable Project project) {

flutter-idea/src/io/flutter/ProjectOpenActivity.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ private static class PackagesOutOfDateNotification extends Notification {
122122
@NotNull private final PubRoot myRoot;
123123

124124
public PackagesOutOfDateNotification(@NotNull Project project, @NotNull PubRoot root) {
125-
super("Flutter Packages", FlutterIcons.Flutter, "Flutter pub get.",
126-
null, "The pubspec.yaml file has been modified since " +
127-
"the last time 'flutter pub get' was run.",
128-
NotificationType.INFORMATION, null);
129-
125+
super("Flutter Packages", "The pubspec.yaml file has been modified since " +
126+
"the last time 'flutter pub get' was run.", NotificationType.INFORMATION);
127+
setIcon(FlutterIcons.Flutter);
128+
130129
myProject = project;
131130
myRoot = root;
132131

flutter-idea/src/io/flutter/survey/FlutterSurveyNotifications.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,8 @@ private void checkForDisplaySurvey() {
8888
if (properties.getBoolean(survey.uniqueId)) return;
8989

9090
final Notification notification = new Notification(
91-
FlutterMessages.FLUTTER_NOTIFICATION_GROUP_ID,
92-
FlutterIcons.Flutter,
93-
survey.title,
94-
null,
95-
null,
96-
NotificationType.INFORMATION,
97-
null
98-
);
91+
FlutterMessages.FLUTTER_NOTIFICATION_GROUP_ID, survey.title, "", NotificationType.INFORMATION
92+
).setIcon(FlutterIcons.Flutter);
9993

10094
notification.addAction(new AnAction(SURVEY_ACTION_TEXT) {
10195
@Override

0 commit comments

Comments
 (0)