Fix deprecation warnings in the Android embedding (flutter/engine#10424)

This commit is contained in:
Jason Simmons
2019-08-01 18:13:27 -07:00
committed by GitHub
parent e82c565e47
commit 1bc372a594
3 changed files with 8 additions and 7 deletions

View File

@@ -160,7 +160,7 @@ public final class FlutterActivityDelegate
return;
}
String appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext());
String appBundlePath = FlutterMain.findAppBundlePath();
if (appBundlePath != null) {
runBundle(appBundlePath);
}
@@ -340,7 +340,7 @@ public final class FlutterActivityDelegate
String appBundlePath = intent.getDataString();
if (appBundlePath == null) {
// Fall back to the installation path if no bundle path was specified.
appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext());
appBundlePath = FlutterMain.findAppBundlePath();
}
if (route != null) {
flutterView.setInitialRoute(route);

View File

@@ -345,6 +345,7 @@ public class FlutterActivity extends Activity
* manifest file.
*/
@Nullable
@SuppressWarnings("deprecation")
private Drawable getSplashScreenFromManifest() {
try {
ActivityInfo activityInfo = getPackageManager().getActivityInfo(
@@ -599,7 +600,7 @@ public class FlutterActivity extends Activity
* When this {@code FlutterActivity} is run by Flutter tooling and a data String is included
* in the launching {@code Intent}, that data String is interpreted as an app bundle path.
* <p>
* By default, the app bundle path is obtained from {@link FlutterMain#findAppBundlePath(Context)}.
* By default, the app bundle path is obtained from {@link FlutterMain#findAppBundlePath()}.
* <p>
* Subclasses may override this method to return a custom app bundle path.
*/
@@ -617,7 +618,7 @@ public class FlutterActivity extends Activity
// Return the default app bundle path.
// TODO(mattcarroll): move app bundle resolution into an appropriately named class.
return FlutterMain.findAppBundlePath(getApplicationContext());
return FlutterMain.findAppBundlePath();
}
/**

View File

@@ -178,7 +178,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
/**
* The path to the app bundle which contains the Dart app to execute, defaults
* to {@link FlutterMain#findAppBundlePath(Context)}
* to {@link FlutterMain#findAppBundlePath()}
*/
@NonNull
public Builder appBundlePath(@NonNull String appBundlePath) {
@@ -511,14 +511,14 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
/**
* Returns the file path to the desired Flutter app's bundle of code.
* <p>
* Defaults to {@link FlutterMain#findAppBundlePath(Context)}.
* Defaults to {@link FlutterMain#findAppBundlePath()}.
* <p>
* Used by this {@code FlutterFragment}'s {@link FlutterActivityAndFragmentDelegate.Host}
*/
@Override
@NonNull
public String getAppBundlePath() {
return getArguments().getString(ARG_APP_BUNDLE_PATH, FlutterMain.findAppBundlePath(getContextCompat()));
return getArguments().getString(ARG_APP_BUNDLE_PATH, FlutterMain.findAppBundlePath());
}
/**