Skip to content

Commit 996c83b

Browse files
authored
Merge pull request #1 from zachberger/flutter-3.29-compat
Remove registerWith which has been long deprecated.
2 parents 89c9e6d + d435b4f commit 996c83b

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

android/src/main/java/in/jvapps/disable_battery_optimization/DisableBatteryOptimizationPlugin.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,6 @@ public class DisableBatteryOptimizationPlugin implements FlutterPlugin, Activity
4444
private String manBatteryMessage;
4545

4646

47-
// This static function is optional and equivalent to onAttachedToEngine. It supports the old
48-
// pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
49-
// plugin registration via this function while apps migrate to use the new Android APIs
50-
// post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
51-
//
52-
// It is encouraged to share logic between onAttachedToEngine and registerWith to keep
53-
// them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
54-
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
55-
// in the same class.
56-
public static void registerWith(PluginRegistry.Registrar registrar) {
57-
final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL_NAME);
58-
channel.setMethodCallHandler(new DisableBatteryOptimizationPlugin(registrar.activity(), registrar.activeContext()));
59-
}
60-
6147
private DisableBatteryOptimizationPlugin(Activity activity, Context context) {
6248
if (activity != null)
6349
mActivity = activity;

0 commit comments

Comments
 (0)