From ac27a7a98733ea2444eedacfd2d8dd4a384726f6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 28 Sep 2017 17:43:53 -0700 Subject: otafault: Clean up header inclusion. Remove unneeded #includes. Also remove unneeded dependency on libz and libselinux. Test: mmma bootable/recovery Change-Id: Ic8f7f46f4b89762dee384921504489de75320ac0 --- otafault/Android.mk | 2 -- otafault/config.cpp | 6 ++---- otafault/config.h | 20 +++++++++----------- otafault/ota_io.cpp | 4 +++- otafault/ota_io.h | 3 ++- otafault/test.cpp | 3 ++- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/otafault/Android.mk b/otafault/Android.mk index 4784d56ef..383717612 100644 --- a/otafault/Android.mk +++ b/otafault/Android.mk @@ -18,8 +18,6 @@ include $(CLEAR_VARS) otafault_static_libs := \ libziparchive \ - libz \ - libselinux \ libbase \ liblog diff --git a/otafault/config.cpp b/otafault/config.cpp index b94e429c6..c11f77452 100644 --- a/otafault/config.cpp +++ b/otafault/config.cpp @@ -14,16 +14,14 @@ * limitations under the License. */ +#include "config.h" + #include #include -#include -#include - #include #include -#include "config.h" #include "ota_io.h" #define OTAIO_MAX_FNAME_SIZE 128 diff --git a/otafault/config.h b/otafault/config.h index 4adbdd121..cc4bfd2ad 100644 --- a/otafault/config.h +++ b/otafault/config.h @@ -15,13 +15,13 @@ */ /* - * Read configuration files in the OTA package to determine which files, if any, will trigger errors. + * Read configuration files in the OTA package to determine which files, if any, will trigger + * errors. * - * OTA packages can be modified to trigger errors by adding a top-level - * directory called .libotafault, which may optionally contain up to three - * files called READ, WRITE, and FSYNC. Each one of these optional files - * contains the name of a single file on the device disk which will cause - * an IO error on the first call of the appropriate I/O action to that file. + * OTA packages can be modified to trigger errors by adding a top-level directory called + * .libotafault, which may optionally contain up to three files called READ, WRITE, and FSYNC. + * Each one of these optional files contains the name of a single file on the device disk which + * will cause an IO error on the first call of the appropriate I/O action to that file. * * Example: * ota.zip @@ -29,9 +29,9 @@ * .libotafault * WRITE * - * If the contents of the file WRITE were /system/build.prop, the first write - * action to /system/build.prop would fail with EIO. Note that READ and - * FSYNC files are absent, so these actions will not cause an error. + * If the contents of the file WRITE were /system/build.prop, the first write action to + * /system/build.prop would fail with EIO. Note that READ and FSYNC files are absent, so these + * actions will not cause an error. */ #ifndef _UPDATER_OTA_IO_CFG_H_ @@ -39,8 +39,6 @@ #include -#include - #include #define OTAIO_BASE_DIR ".libotafault" diff --git a/otafault/ota_io.cpp b/otafault/ota_io.cpp index faae5275d..a82a7ee59 100644 --- a/otafault/ota_io.cpp +++ b/otafault/ota_io.cpp @@ -18,15 +18,17 @@ #include #include +#include #include #include +#include #include #include -#include #include #include + #include "config.h" static std::mutex filename_mutex; diff --git a/otafault/ota_io.h b/otafault/ota_io.h index 9428f1b1f..45e481a62 100644 --- a/otafault/ota_io.h +++ b/otafault/ota_io.h @@ -23,8 +23,9 @@ #ifndef _UPDATER_OTA_IO_H_ #define _UPDATER_OTA_IO_H_ +#include #include -#include +#include // mode_t #include diff --git a/otafault/test.cpp b/otafault/test.cpp index 6514782bf..60c40e099 100644 --- a/otafault/test.cpp +++ b/otafault/test.cpp @@ -14,9 +14,10 @@ * limitations under the License. */ -#include #include #include +#include +#include #include #include "ota_io.h" -- cgit v1.2.3