Skip to content

Commit

Permalink
(#6) Remove deprecated usage of PluginRegistry.Registrar
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Huang committed Apr 30, 2024
1 parent af771cd commit 8673249
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Context;
import android.util.Log;

import androidx.annotation.NonNull;

import com.polidea.flutter_ble_lib.constant.ArgumentKey;
import com.polidea.flutter_ble_lib.constant.ChannelName;
import com.polidea.flutter_ble_lib.constant.MethodName;
Expand All @@ -13,8 +15,8 @@
import com.polidea.flutter_ble_lib.delegate.DescriptorsDelegate;
import com.polidea.flutter_ble_lib.delegate.DeviceConnectionDelegate;
import com.polidea.flutter_ble_lib.delegate.DevicesDelegate;
import com.polidea.flutter_ble_lib.delegate.LogLevelDelegate;
import com.polidea.flutter_ble_lib.delegate.DiscoveryDelegate;
import com.polidea.flutter_ble_lib.delegate.LogLevelDelegate;
import com.polidea.flutter_ble_lib.delegate.MtuDelegate;
import com.polidea.flutter_ble_lib.delegate.RssiDelegate;
import com.polidea.flutter_ble_lib.event.AdapterStateStreamHandler;
Expand All @@ -32,7 +34,6 @@
import java.util.LinkedList;
import java.util.List;

import androidx.annotation.NonNull;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
Expand All @@ -42,7 +43,6 @@
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;

public class FlutterBleLibPlugin implements MethodCallHandler, FlutterPlugin, ActivityAware {

Expand Down Expand Up @@ -94,10 +94,6 @@ private static void init(Context context, BinaryMessenger messenger, Activity ac
characteristicMonitorChannel.setStreamHandler(plugin.characteristicsMonitorStreamHandler);
}

public static void registerWith(Registrar registrar) {
init(registrar.context(), registrar.messenger(), registrar.activity());
}

private void setupAdapter(Context context) {
bleAdapter = BleAdapterFactory.getNewAdapter(context);
delegates.add(new DeviceConnectionDelegate(bleAdapter, connectionStateStreamHandler));
Expand Down

0 comments on commit 8673249

Please sign in to comment.