/*
 * Copyright 2000-2019 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.openapi.startup;

import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

/**
 * Runs an activity on project open.
 * <p>
 * If the activity implements {@link com.intellij.openapi.project.DumbAware} it will be started in a pooled thread under 'Loading Project' dialog,
 * otherwise it will be started in the dispatch thread after the initialization.
 *
 * @author Dmitry Avdeev
 */
public interface StartupActivity {

  ExtensionPointName<StartupActivity> POST_STARTUP_ACTIVITY = ExtensionPointName.create("com.intellij.postStartupActivity");

  /**
   * Executed some time after startup on a background thread with no progress indicator. Such activities may produce notifications
   * but should not be used for any work that needs to be otherwise visible to users. Such activities are run regardless
   * of the current indexing mode and should not be used for any work that requires access to indices.
   */
  ExtensionPointName<StartupActivity> BACKGROUND_POST_STARTUP_ACTIVITY = ExtensionPointName.create("com.intellij.backgroundPostStartupActivity");

  void runActivity(@NotNull Project project);
}

@@ -1325,16 +1325,24 @@
 with no 
+visible 
 progress
@@ -1380,16 +1380,21 @@
  produce
+%0A   *
  notific
@@ -1399,21 +1399,16 @@
 ications
-%0A   *
  but sho
@@ -1479,17 +1479,100 @@
 to users
-.
+ (including work that consumes%0A   * CPU over a noticeable period of time).%0A   *%0A   *
  Such ac
@@ -1598,21 +1598,16 @@
 gardless
-%0A   *
  of the 
@@ -1684,16 +1684,21 @@
 s access
+%0A   *
  to indi
@@ -1701,16 +1701,329 @@
 indices.
+ The current project may get disposed while the activity is running, and the activity may not be interrupted%0A   * immediately when this happens, so if you need to access other components, you're responsible for doing this in a%0A   * thread-safe way (e.g. by taking a read action to collect all the state you need).
 %0A   */%0A 

Extend javadoc for <backgroundPostStartupActivity> (IDEA-CR-48118)