Flutter Engine
The Flutter Engine
Classes | Package Functions | Static Package Functions | List of all members
io.flutter.embedding.engine.loader.ResourceExtractor Class Reference

Package Functions

 ResourceExtractor ( @NonNull String dataDirPath, @NonNull String packageName, @NonNull PackageManager packageManager, @NonNull AssetManager assetManager)
 
ResourceExtractor addResource (@NonNull String resource)
 
ResourceExtractor addResources (@NonNull Collection< String > resources)
 
ResourceExtractor start ()
 
void waitForCompletion ()
 

Static Package Functions

static long getVersionCode (@NonNull PackageInfo packageInfo)
 

Detailed Description

A class to initialize the native code.

Definition at line 25 of file ResourceExtractor.java.

Constructor & Destructor Documentation

◆ ResourceExtractor()

io.flutter.embedding.engine.loader.ResourceExtractor.ResourceExtractor ( @NonNull String  dataDirPath,
@NonNull String  packageName,
@NonNull PackageManager  packageManager,
@NonNull AssetManager  assetManager 
)
inlinepackage

Definition at line 129 of file ResourceExtractor.java.

133 {
134 mDataDirPath = dataDirPath;
135 mPackageName = packageName;
136 mPackageManager = packageManager;
137 mAssetManager = assetManager;
138 mResources = new HashSet<>();
139 }

Member Function Documentation

◆ addResource()

ResourceExtractor io.flutter.embedding.engine.loader.ResourceExtractor.addResource ( @NonNull String  resource)
inlinepackage

Definition at line 141 of file ResourceExtractor.java.

141 {
142 mResources.add(resource);
143 return this;
144 }
static SkString resource(SkPDFResourceType type, int index)

◆ addResources()

ResourceExtractor io.flutter.embedding.engine.loader.ResourceExtractor.addResources ( @NonNull Collection< String >  resources)
inlinepackage

Definition at line 146 of file ResourceExtractor.java.

146 {
147 mResources.addAll(resources);
148 return this;
149 }

◆ getVersionCode()

static long io.flutter.embedding.engine.loader.ResourceExtractor.getVersionCode ( @NonNull PackageInfo  packageInfo)
inlinestaticpackage

Definition at line 31 of file ResourceExtractor.java.

31 {
32 // Linter needs P (28) hardcoded or else it will fail these lines.
33 if (Build.VERSION.SDK_INT >= API_LEVELS.API_28) {
34 return packageInfo.getLongVersionCode();
35 } else {
36 return packageInfo.versionCode;
37 }
38 }
def Build(configs, env, options)
Definition: build.py:232

◆ start()

ResourceExtractor io.flutter.embedding.engine.loader.ResourceExtractor.start ( )
inlinepackage

Definition at line 151 of file ResourceExtractor.java.

151 {
152 if (BuildConfig.DEBUG && mExtractTask != null) {
153 Log.e(
154 TAG, "Attempted to start resource extraction while another extraction was in progress.");
155 }
156 mExtractTask =
157 new ExtractTask(mDataDirPath, mResources, mPackageName, mPackageManager, mAssetManager);
158 mExtractTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
159 return this;
160 }
void Log(const char *format,...) SK_PRINTF_LIKE(1
Definition: TestRunner.cpp:137

◆ waitForCompletion()

void io.flutter.embedding.engine.loader.ResourceExtractor.waitForCompletion ( )
inlinepackage

Definition at line 162 of file ResourceExtractor.java.

162 {
163 if (mExtractTask == null) {
164 return;
165 }
166
167 try {
168 mExtractTask.get();
169 } catch (CancellationException | ExecutionException | InterruptedException e) {
170 deleteFiles(mDataDirPath, mResources);
171 }
172 }

The documentation for this class was generated from the following file: