Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flutter-hms-push/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:3.6.0"
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;

import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -44,11 +42,6 @@ private synchronized void setBackgroundRunner(FlutterBackgroundRunner bgRunner)
BackgroundMessagingService.backgroundRunner = bgRunner;
}

// For Backwards Compatibility with V1 Plugin registration.
public static void setPluginRegistrantCallback(final PluginRegistrantCallback callback) {
FlutterBackgroundRunner.setPluginRegistrantCallback(callback);
}

public static void setUserCallback(final Context context, final long userCallback) {
FlutterBackgroundRunner.setUserCallback(context, userCallback);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@
import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.embedding.engine.dart.DartExecutor.DartCallback;
import io.flutter.embedding.engine.loader.FlutterLoader;
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
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.PluginRegistrantCallback;
import io.flutter.view.FlutterCallbackInformation;

import java.util.Arrays;
Expand All @@ -60,9 +58,6 @@ public class FlutterBackgroundRunner implements MethodCallHandler {

public static final String USER_CALLBACK_KEY = "push_background_message_callback";

// Deprecated, Support for backwards compatibility with V1 embedding.
private static PluginRegistrantCallback pluginRegistrantCallback;

private final AtomicBoolean isCallbackDispatcherReady = new AtomicBoolean(false);

private MethodChannel bgMethodChannel;
Expand All @@ -71,11 +66,6 @@ public class FlutterBackgroundRunner implements MethodCallHandler {

private long bgMessagingCallback;

// For Backwards Compatibility with V1 Plugin registration.
public static void setPluginRegistrantCallback(final PluginRegistrantCallback callback) {
pluginRegistrantCallback = callback;
}

public static void setCallBackDispatcher(final Context context, final long callbackHandle) {
final SharedPreferences prefs = context.getSharedPreferences(Core.PREFERENCE_NAME, Context.MODE_PRIVATE);
prefs.edit().putLong(CALLBACK_DISPATCHER_KEY, callbackHandle).apply();
Expand Down Expand Up @@ -123,17 +113,11 @@ public void startBgIsolate(final Context context, final long callbackHandle) {
flutterEngine = new FlutterEngine(context);

final FlutterCallbackInformation flutterCallbackInfo
= FlutterCallbackInformation.lookupCallbackInformation(callbackHandle);
= FlutterCallbackInformation.lookupCallbackInformation(callbackHandle);
final DartExecutor executor = flutterEngine.getDartExecutor();
initializeMethodChannel(executor);
final DartCallback dartCallback = new DartCallback(assets, appBundlePath, flutterCallbackInfo);
executor.executeDartCallback(dartCallback);

// For V1 Embedding
if (pluginRegistrantCallback != null) {
pluginRegistrantCallback.registerWith(new ShimPluginRegistry(flutterEngine));
}

}
});
};
Expand Down Expand Up @@ -168,7 +152,7 @@ public void onMethodCall(@NonNull final MethodCall call, @NonNull final Result r
public void executeDartCallbackInBgIsolate(final Intent intent, final CountDownLatch latch) {
if (flutterEngine == null) {
Log.i(TAG,
"A background message could not be handled in Dart as no onBackgroundLocation handler has been registered");
"A background message could not be handled in Dart as no onBackgroundLocation handler has been registered");
return;
}
Result result = null;
Expand Down