mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-27 01:22:33 -06:00
38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
package com.google.android.exoplayer2.util;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class LibraryLoader {
|
|
private static final String TAG = "LibraryLoader";
|
|
private boolean isAvailable;
|
|
private boolean loadAttempted;
|
|
private String[] nativeLibraries;
|
|
|
|
protected abstract void loadLibrary(String str);
|
|
|
|
public LibraryLoader(String... strArr) {
|
|
this.nativeLibraries = strArr;
|
|
}
|
|
|
|
public synchronized void setLibraries(String... strArr) {
|
|
Assertions.checkState(!this.loadAttempted, "Cannot set libraries after loading");
|
|
this.nativeLibraries = strArr;
|
|
}
|
|
|
|
public synchronized boolean isAvailable() {
|
|
if (this.loadAttempted) {
|
|
return this.isAvailable;
|
|
}
|
|
this.loadAttempted = true;
|
|
try {
|
|
for (String str : this.nativeLibraries) {
|
|
loadLibrary(str);
|
|
}
|
|
this.isAvailable = true;
|
|
} catch (UnsatisfiedLinkError unused) {
|
|
Log.w(TAG, "Failed to load " + Arrays.toString(this.nativeLibraries));
|
|
}
|
|
return this.isAvailable;
|
|
}
|
|
}
|