From 32fdc0eaf53901a05d005c0a6e12fae5657cd724 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 22 Oct 2020 00:07:07 +0200 Subject: [PATCH] [platform] no bumping for "last checked at" on displaying Snap update notifications GitOrigin-RevId: 0d61ba58e20d992da6a7946b388a15fd1ce88b83 --- .../updateSettings/impl/UpdateCheckerComponent.java | 4 ++-- .../openapi/updateSettings/impl/UpdateSettings.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateCheckerComponent.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateCheckerComponent.java index af8e7b3c9904..1236f562242e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateCheckerComponent.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateCheckerComponent.java @@ -200,7 +200,7 @@ final class UpdateCheckerComponent { BuildNumber lastBuildChecked = BuildNumber.fromString(settings.getLastBuildChecked()); if (lastBuildChecked == null) { // first IDE start, just save info about build - UpdateSettings.getInstance().saveLastCheckedInfo(); + UpdateSettings.getInstance().saveLastCheckedInfo(true); return; } @@ -239,7 +239,7 @@ final class UpdateCheckerComponent { UpdateChecker.getNotificationGroup().createNotification( title, message, NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER, "ide.updated.by.snap").notify(null); - UpdateSettings.getInstance().saveLastCheckedInfo(); + UpdateSettings.getInstance().saveLastCheckedInfo(true); } private static void showUpdatedPluginsNotification(@NotNull Project project) { diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java index bcec00ad90e7..4b5715c5f644 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java @@ -137,8 +137,14 @@ public class UpdateSettings implements PersistentStateComponent { } public void saveLastCheckedInfo() { - myState.setLastTimeChecked(System.currentTimeMillis()); + saveLastCheckedInfo(false); + } + + public void saveLastCheckedInfo(boolean onlyBuild) { myState.setLastBuildChecked(ApplicationInfo.getInstance().getBuild().asString()); + if (!onlyBuild) { + myState.setLastTimeChecked(System.currentTimeMillis()); + } } public boolean isThirdPartyPluginsAllowed() { @@ -148,4 +154,4 @@ public class UpdateSettings implements PersistentStateComponent { public void setThirdPartyPluginsAllowed(boolean value) { myState.setThirdPartyPluginsAllowed(value); } -} \ No newline at end of file +}