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

Fix unchecked operation warnings in FlutterMain #9073

Merged
merged 1 commit into from
May 23, 2019
Merged
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
18 changes: 9 additions & 9 deletions shell/platform/android/io/flutter/view/FlutterMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,12 @@ private static void initConfig(@NonNull Context applicationContext) {
}

/**
* Extract the AOT blobs from the app's asset directory.
* Extract the AOT blobs from the app's asset directory.
* This is required by the Dart runtime, so it can read the blobs.
*/
private static void initResources(@NonNull Context applicationContext) {
// When the AOT blobs are contained in the native library directory,
// we don't need to extract them manually because they are
// When the AOT blobs are contained in the native library directory,
// we don't need to extract them manually because they are
// extracted by the Android Package Manager automatically.
if (!sSnapshotPath.equals(PathUtils.getDataDirectory(applicationContext))) {
return;
Expand Down Expand Up @@ -369,26 +369,26 @@ private static Set<String> listAssets(@NonNull Context applicationContext, @NonN
}

/**
* Returns a list of the file names at the root of the application's
* Returns a list of the file names at the root of the application's
* native library directory.
*/
@NonNull
private static Set<String> listLibs(@NonNull Context applicationContext) {
ApplicationInfo applicationInfo = getApplicationInfo(applicationContext);
File[] files = new File(applicationInfo.nativeLibraryDir).listFiles();
ImmutableSetBuilder builder = ImmutableSetBuilder.<String>newInstance();

ImmutableSetBuilder<String> builder = ImmutableSetBuilder.newInstance();
for (File file : files) {
builder.add(file.getName());
}
return builder.build();
}

/**
* Determines if the APK contains a shared library or AOT snapshots,
* Determines if the APK contains a shared library or AOT snapshots,
* the file name of the snapshots and the directory where they are contained.
*
* <p>The snapshots can be contained in the app's assets or in the native library
* <p>The snapshots can be contained in the app's assets or in the native library
* directory. The default names are:
*
* <ul>
Expand All @@ -402,7 +402,7 @@ private static Set<String> listLibs(@NonNull Context applicationContext) {
* <p>When the blobs are contained in the native library directory,
* the format <b>`lib_%s.so`</b> is applied to the file name.
*
* <p>Note: The name of the files can be customized in the app's metadata, but the
* <p>Note: The name of the files can be customized in the app's metadata, but the
* format is preserved.
*
* <p>The AOT snapshots and the shared library cannot exist at the same time in the APK.
Expand Down