Skip to content

Commit 9f98a49

Browse files
authored
Specify BGT updates for device-related actions (#7410)
Partially addresses #7330 I'm not sure if these are needed since I wasn't seeing the deprecation notice while using the device menu, but I looked through update activities in these classes and it seems safe to make all of these BGT. I think there is potentially a bug with emulator options: #7409
1 parent a77655f commit 9f98a49

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

flutter-idea/src/io/flutter/actions/DeviceSelectorAction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,5 +234,10 @@ public void actionPerformed(AnActionEvent e) {
234234
service.setSelectedDevice(device);
235235
}
236236
}
237+
238+
@Override
239+
public @NotNull ActionUpdateThread getActionUpdateThread() {
240+
return ActionUpdateThread.BGT;
241+
}
237242
}
238243
}

flutter-idea/src/io/flutter/actions/OpenEmulatorAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package io.flutter.actions;
77

8+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
89
import com.intellij.openapi.actionSystem.AnAction;
910
import com.intellij.openapi.actionSystem.AnActionEvent;
1011
import com.intellij.openapi.project.Project;
@@ -47,4 +48,9 @@ public OpenEmulatorAction(AndroidEmulator emulator) {
4748
public void actionPerformed(@NotNull AnActionEvent event) {
4849
emulator.startEmulator();
4950
}
51+
52+
@Override
53+
public @NotNull ActionUpdateThread getActionUpdateThread() {
54+
return ActionUpdateThread.BGT;
55+
}
5056
}

flutter-idea/src/io/flutter/actions/OpenSimulatorAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package io.flutter.actions;
77

8+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
89
import com.intellij.openapi.actionSystem.AnAction;
910
import com.intellij.openapi.actionSystem.AnActionEvent;
1011
import com.intellij.openapi.project.Project;
@@ -26,6 +27,11 @@ public void update(@NotNull AnActionEvent e) {
2627
e.getPresentation().setEnabled(enabled);
2728
}
2829

30+
@Override
31+
public @NotNull ActionUpdateThread getActionUpdateThread() {
32+
return ActionUpdateThread.BGT;
33+
}
34+
2935
@Override
3036
public void actionPerformed(@NotNull AnActionEvent event) {
3137
@Nullable final Project project = event.getProject();

flutter-idea/src/io/flutter/actions/RestartFlutterDaemonAction.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
*/
66
package io.flutter.actions;
77

8+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
89
import com.intellij.openapi.actionSystem.AnAction;
910
import com.intellij.openapi.actionSystem.AnActionEvent;
1011
import com.intellij.openapi.project.Project;
1112
import io.flutter.FlutterInitializer;
1213
import io.flutter.run.daemon.DeviceService;
14+
import org.jetbrains.annotations.NotNull;
1315

1416
public class RestartFlutterDaemonAction extends AnAction {
1517
public RestartFlutterDaemonAction() {
@@ -27,4 +29,9 @@ public void actionPerformed(AnActionEvent event) {
2729

2830
DeviceService.getInstance(project).restart();
2931
}
32+
33+
@Override
34+
public @NotNull ActionUpdateThread getActionUpdateThread() {
35+
return ActionUpdateThread.BGT;
36+
}
3037
}

0 commit comments

Comments
 (0)