Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 213b864

Browse files
committed
Switch to override splitcompat
1 parent 917abe8 commit 213b864

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

runtime/runtime_controller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ class RuntimeController : public PlatformConfigurationClient {
501501
std::pair<bool, uint32_t> root_isolate_return_code_ = {false, 0};
502502
const fml::closure isolate_create_callback_;
503503
const fml::closure isolate_shutdown_callback_;
504-
fml::WeakPtrFactory<RuntimeController> weak_factory_;
505504
std::shared_ptr<const fml::Mapping> persistent_isolate_data_;
505+
fml::WeakPtrFactory<RuntimeController> weak_factory_;
506506

507507
PlatformConfiguration* GetPlatformConfigurationIfAvailable();
508508

shell/platform/android/io/flutter/app/FlutterApplication.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
package io.flutter.app;
66

77
import android.app.Activity;
8+
import android.content.Context;
89
import android.app.Application;
910
import androidx.annotation.CallSuper;
10-
import com.google.android.play.core.splitcompat.SplitCompatApplication;
11+
import com.google.android.play.core.splitcompat.SplitCompat;
1112
import io.flutter.FlutterInjector;
1213

1314
/**
@@ -17,7 +18,7 @@
1718
* <p>Using this {@link android.app.Application} is not required when using APIs in the package
1819
* {@code io.flutter.embedding.android} since they self-initialize on first use.
1920
*/
20-
public class FlutterApplication extends SplitCompatApplication {
21+
public class FlutterApplication extends Application {
2122
@Override
2223
@CallSuper
2324
public void onCreate() {
@@ -34,4 +35,12 @@ public Activity getCurrentActivity() {
3435
public void setCurrentActivity(Activity mCurrentActivity) {
3536
this.mCurrentActivity = mCurrentActivity;
3637
}
38+
39+
// This override allows split dynamic feature modules to work.
40+
@Override
41+
protected void attachBaseContext(Context base) {
42+
super.attachBaseContext(base);
43+
// Emulates installation of future on demand modules using SplitCompat.
44+
SplitCompat.install(this);
45+
}
3746
}

0 commit comments

Comments
 (0)