From 1fa61a296b21057269aba1b3c25b404d801e4fa0 Mon Sep 17 00:00:00 2001 From: Jacksgong Date: Sun, 8 Apr 2018 23:54:43 +0800 Subject: [PATCH] chore: add logs to create default components --- .../main/java/com/liulishuo/okdownload/OkDownload.java | 2 ++ .../src/main/java/com/liulishuo/okdownload/core/Util.java | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/okdownload/src/main/java/com/liulishuo/okdownload/OkDownload.java b/okdownload/src/main/java/com/liulishuo/okdownload/OkDownload.java index 09545679..48ecf39a 100644 --- a/okdownload/src/main/java/com/liulishuo/okdownload/OkDownload.java +++ b/okdownload/src/main/java/com/liulishuo/okdownload/OkDownload.java @@ -206,6 +206,8 @@ public OkDownload build() { okDownload.setMonitor(monitor); + Util.d("OkDownload", "downloadStore[" + downloadStore + "] connectionFactory[" + + connectionFactory); return okDownload; } } diff --git a/okdownload/src/main/java/com/liulishuo/okdownload/core/Util.java b/okdownload/src/main/java/com/liulishuo/okdownload/core/Util.java index 03aae656..067f5c08 100644 --- a/okdownload/src/main/java/com/liulishuo/okdownload/core/Util.java +++ b/okdownload/src/main/java/com/liulishuo/okdownload/core/Util.java @@ -251,17 +251,19 @@ public static String humanReadableBytes(long bytes, boolean si) { return new BreakpointStoreOnCache(); } - public static @NonNull DownloadStore createRemitDatabase(DownloadStore originStore) { + public static @NonNull DownloadStore createRemitDatabase(@NonNull DownloadStore originStore) { + DownloadStore finalStore = originStore; try { final Method createRemitSelf = originStore.getClass() .getMethod("createRemitSelf"); - return (DownloadStore) createRemitSelf.invoke(originStore); + finalStore = (DownloadStore) createRemitSelf.invoke(originStore); } catch (IllegalAccessException ignored) { } catch (NoSuchMethodException ignored) { } catch (InvocationTargetException ignored) { } - return originStore; + Util.d("Util", "Get final download store is " + finalStore); + return finalStore; } public static @NonNull DownloadConnection.Factory createDefaultConnectionFactory() {