Skip to content

Commit 0bb6a1f

Browse files
fix(android_alarm_manager_plus): Remove references to v1 embedding (#2864)
1 parent 51879f3 commit 0bb6a1f

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

packages/android_alarm_manager_plus/android/src/main/java/dev/fluttercommunity/plus/androidalarmmanager/FlutterBackgroundExecutor.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
import io.flutter.embedding.engine.FlutterEngine;
1515
import io.flutter.embedding.engine.dart.DartExecutor;
1616
import io.flutter.embedding.engine.dart.DartExecutor.DartCallback;
17-
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
1817
import io.flutter.plugin.common.BinaryMessenger;
1918
import io.flutter.plugin.common.JSONMethodCodec;
2019
import io.flutter.plugin.common.MethodCall;
2120
import io.flutter.plugin.common.MethodChannel;
2221
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
2322
import io.flutter.plugin.common.MethodChannel.Result;
24-
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
2523
import io.flutter.view.FlutterCallbackInformation;
2624
import java.util.concurrent.CountDownLatch;
2725
import java.util.concurrent.atomic.AtomicBoolean;
@@ -35,7 +33,6 @@
3533
public class FlutterBackgroundExecutor implements MethodCallHandler {
3634
private static final String TAG = "FlutterBackgroundExecutor";
3735
private static final String CALLBACK_HANDLE_KEY = "callback_handle";
38-
private static PluginRegistrantCallback pluginRegistrantCallback;
3936

4037
/**
4138
* The {@link MethodChannel} that connects the Android side of this plugin with the background
@@ -47,18 +44,6 @@ public class FlutterBackgroundExecutor implements MethodCallHandler {
4744

4845
private final AtomicBoolean isCallbackDispatcherReady = new AtomicBoolean(false);
4946

50-
/**
51-
* Sets the {@code PluginRegistrantCallback} used to register plugins with the newly spawned
52-
* isolate.
53-
*
54-
* <p>Note: this is only necessary for applications using the V1 engine embedding API as plugins
55-
* are automatically registered via reflection in the V2 engine embedding API. If not set, alarm
56-
* callbacks will not be able to utilize functionality from other plugins.
57-
*/
58-
public static void setPluginRegistrant(PluginRegistrantCallback callback) {
59-
pluginRegistrantCallback = callback;
60-
}
61-
6247
/**
6348
* Sets the Dart callback handle for the Dart method that is responsible for initializing the
6449
* background Dart isolate, preparing it to receive Dart callback tasks requests.
@@ -116,8 +101,6 @@ public void onMethodCall(MethodCall call, Result result) {
116101
* <ul>
117102
* <li>The given callback must correspond to a registered Dart callback. If the handle does not
118103
* resolve to a Dart callback then this method does nothing.
119-
* <li>A static {@link #pluginRegistrantCallback} must exist, otherwise a {@link
120-
* PluginRegistrantException} will be thrown.
121104
* </ul>
122105
*/
123106
public void startBackgroundIsolate(Context context) {
@@ -144,8 +127,6 @@ public void startBackgroundIsolate(Context context) {
144127
* <ul>
145128
* <li>The given {@code callbackHandle} must correspond to a registered Dart callback. If the
146129
* handle does not resolve to a Dart callback then this method does nothing.
147-
* <li>A static {@link #pluginRegistrantCallback} must exist, otherwise a {@link
148-
* PluginRegistrantException} will be thrown.
149130
* </ul>
150131
*/
151132
public void startBackgroundIsolate(Context context, long callbackHandle) {
@@ -176,12 +157,6 @@ public void startBackgroundIsolate(Context context, long callbackHandle) {
176157
DartCallback dartCallback = new DartCallback(assets, appBundlePath, flutterCallback);
177158

178159
executor.executeDartCallback(dartCallback);
179-
180-
// The pluginRegistrantCallback should only be set in the V1 embedding as
181-
// plugin registration is done via reflection in the V2 embedding.
182-
if (pluginRegistrantCallback != null) {
183-
pluginRegistrantCallback.registerWith(new ShimPluginRegistry(backgroundFlutterEngine));
184-
}
185160
}
186161
}
187162

0 commit comments

Comments
 (0)