Fetch local files asynchronously.
This patch implements a new fetcher that only handles local files.
While libcurl supports file:// urls, the stream can't be suspended when
accessing local files.
This new FileFetcher is based on the brillo::FileStream class which
properly handles the asynchronous reads from regular files.
Bug: 28866512
TEST=Added unittest. Deployed an update from a file:// URL.
(cherry picked from commit 2c131bbf81d8c02ade163b939c96e44aa93765e9)
Change-Id: I9949a0f214de992c2fd86c1d73aca1c1792f0de0
diff --git a/Android.mk b/Android.mk
index c334d45..e7cd431 100644
--- a/Android.mk
+++ b/Android.mk
@@ -161,6 +161,7 @@
common/hash_calculator.cc \
common/http_common.cc \
common/http_fetcher.cc \
+ common/file_fetcher.cc \
common/hwid_override.cc \
common/libcurl_http_fetcher.cc \
common/multi_range_http_fetcher.cc \
@@ -830,6 +831,7 @@
common/certificate_checker_unittest.cc \
common/cpu_limiter_unittest.cc \
common/fake_prefs.cc \
+ common/file_fetcher_unittest.cc \
common/hash_calculator_unittest.cc \
common/http_fetcher_unittest.cc \
common/hwid_override_unittest.cc \