Install ssl provider asynchronously
This commit is contained in:
parent
d7cfa07c44
commit
0d02943866
@ -28,6 +28,7 @@ import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.adapter.FeedItemlistDescriptionAdapter;
|
||||
import de.danoeh.antennapod.core.ClientConfig;
|
||||
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
|
||||
import de.danoeh.antennapod.core.event.DownloadEvent;
|
||||
import de.danoeh.antennapod.core.event.FeedListUpdateEvent;
|
||||
@ -238,6 +239,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
|
||||
|
||||
download = Observable.fromCallable(() -> {
|
||||
feeds = DBReader.getFeedList();
|
||||
ClientConfig.installSslProvider(this);
|
||||
downloader = new HttpDownloader(request);
|
||||
downloader.call();
|
||||
return downloader.getResult();
|
||||
|
@ -53,4 +53,7 @@ public class ClientConfig {
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
public static void installSslProvider(Context context) {
|
||||
// ProviderInstaller is a closed-source Google library
|
||||
}
|
||||
}
|
||||
|
@ -474,6 +474,7 @@ public class DownloadService extends Service {
|
||||
@NonNull List<? extends FeedItem> itemsEnqueued) {
|
||||
writeFileUrl(request);
|
||||
|
||||
ClientConfig.installSslProvider(this);
|
||||
Downloader downloader = downloaderFactory.create(request);
|
||||
if (downloader != null) {
|
||||
numberOfDownloads.incrementAndGet();
|
||||
|
@ -64,7 +64,6 @@ public class ClientConfig {
|
||||
} else {
|
||||
Log.v(TAG, "Cast is disabled. All Cast-related initialization will be skipped.");
|
||||
}
|
||||
installSslProvider(context);
|
||||
AntennapodHttpClient.setCacheDirectory(new File(context.getCacheDir(), "okhttp"));
|
||||
SleepTimerPreferences.init(context);
|
||||
RxJavaErrorHandlerSetup.setupRxJavaErrorHandler();
|
||||
@ -72,7 +71,7 @@ public class ClientConfig {
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
private static void installSslProvider(Context context) {
|
||||
public static void installSslProvider(Context context) {
|
||||
try {
|
||||
ProviderInstaller.installIfNeeded(context);
|
||||
} catch (GooglePlayServicesRepairableException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user