update_engine: Create cros vs. aosp boundary clear
Its time to make the boundary between Chrome OS and Android code more
clear. This CL moves all CrOS only code to "chromeos" directory and the
same for Android (in "android" directory). This way we would easily know
which code is uses in which project and can keep the code cleaner and
more maintainable.
One big remaining problem is download_action* files. It seems like
DownloadAction class does a lot of things that chrome OS needs and it
depends on a lot of Chrome OS stuff, but Android is also using thie
Action in a way that circumvent the Chrome OS stuff. For example Android
checks for SystemState to be nullptr to not do things. This is really
fragile and needs to change. Probably Android Team has to implement
their own DownloadAction of some sort and not re use the Chrome OS one
in a very fragile way.
Removed a few android files that have not been used anywhere.
Changed some clang-format and lint issues in order to pass preupload.
BUG=b:171829801
TEST=cros_workon_make --board reef --test update_engine
Change-Id: I3fff1d4a100a065a5c1484a845241b5521614d9f
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2508965
Tested-by: Amin Hassani <ahassani@chromium.org>
Auto-Submit: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Tianjie Xu <xunchang@google.com>
Reviewed-by: Kelvin Zhang <zhangkelvin@google.com>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
diff --git a/Android.bp b/Android.bp
index a8b5fc2..9cf7bd4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -143,6 +143,7 @@
recovery_available: true,
srcs: [
+ "aosp/platform_constants_android.cc",
"common/action_processor.cc",
"common/boot_control_stub.cc",
"common/clock.cc",
@@ -156,17 +157,16 @@
"common/http_fetcher.cc",
"common/hwid_override.cc",
"common/multi_range_http_fetcher.cc",
- "common/platform_constants_android.cc",
"common/prefs.cc",
"common/proxy_resolver.cc",
"common/subprocess.cc",
"common/terminator.cc",
"common/utils.cc",
+ "download_action.cc",
"payload_consumer/bzip_extent_writer.cc",
"payload_consumer/cached_file_descriptor.cc",
"payload_consumer/certificate_parser_android.cc",
"payload_consumer/delta_performer.cc",
- "payload_consumer/download_action.cc",
"payload_consumer/extent_reader.cc",
"payload_consumer/extent_writer.cc",
"payload_consumer/file_descriptor.cc",
@@ -240,10 +240,10 @@
recovery_available: true,
srcs: [
- "boot_control_android.cc",
- "cleanup_previous_update_action.cc",
- "dynamic_partition_control_android.cc",
- "dynamic_partition_utils.cc",
+ "aosp/boot_control_android.cc",
+ "aosp/cleanup_previous_update_action.cc",
+ "aosp/dynamic_partition_control_android.cc",
+ "aosp/dynamic_partition_utils.cc",
],
}
@@ -299,17 +299,17 @@
srcs: [
":libupdate_engine_aidl",
- "binder_service_android.cc",
- "binder_service_stable_android.cc",
+ "aosp/binder_service_android.cc",
+ "aosp/binder_service_stable_android.cc",
+ "aosp/daemon_android.cc",
+ "aosp/daemon_state_android.cc",
+ "aosp/hardware_android.cc",
+ "aosp/logging_android.cc",
+ "aosp/network_selector_android.cc",
+ "aosp/update_attempter_android.cc",
"certificate_checker.cc",
- "daemon_android.cc",
- "daemon_state_android.cc",
- "hardware_android.cc",
"libcurl_http_fetcher.cc",
- "logging_android.cc",
"metrics_utils.cc",
- "network_selector_android.cc",
- "update_attempter_android.cc",
"update_boot_flags_action.cc",
"update_status_utils.cc",
],
@@ -331,7 +331,7 @@
"otacerts",
],
- srcs: ["main.cc", "metrics_reporter_android.cc"],
+ srcs: ["main.cc", "aosp/metrics_reporter_android.cc"],
init_rc: ["update_engine.rc"],
}
@@ -356,13 +356,13 @@
include_dirs: ["external/cros/system_api/dbus"],
srcs: [
- "hardware_android.cc",
- "logging_android.cc",
- "metrics_reporter_stub.cc",
+ "aosp/hardware_android.cc",
+ "aosp/logging_android.cc",
+ "aosp/sideload_main.cc",
+ "aosp/update_attempter_android.cc",
+ "common/metrics_reporter_stub.cc",
+ "common/network_selector_stub.cc",
"metrics_utils.cc",
- "network_selector_stub.cc",
- "sideload_main.cc",
- "update_attempter_android.cc",
"update_boot_flags_action.cc",
"update_status_utils.cc",
],
@@ -432,8 +432,8 @@
srcs: [
":libupdate_engine_aidl",
+ "aosp/update_engine_client_android.cc",
"common/error_code_utils.cc",
- "update_engine_client_android.cc",
"update_status_utils.cc",
],
}
@@ -665,6 +665,8 @@
test_suites: ["device-tests"],
srcs: [
+ "aosp/dynamic_partition_control_android_unittest.cc",
+ "aosp/update_attempter_android_unittest.cc",
"certificate_checker_unittest.cc",
"common/action_pipe_unittest.cc",
"common/action_processor_unittest.cc",
@@ -675,6 +677,7 @@
"common/hash_calculator_unittest.cc",
"common/http_fetcher_unittest.cc",
"common/hwid_override_unittest.cc",
+ "common/metrics_reporter_stub.cc",
"common/mock_http_fetcher.cc",
"common/prefs_unittest.cc",
"common/proxy_resolver_unittest.cc",
@@ -682,15 +685,13 @@
"common/terminator_unittest.cc",
"common/test_utils.cc",
"common/utils_unittest.cc",
- "dynamic_partition_control_android_unittest.cc",
+ "download_action_android_unittest.cc",
"libcurl_http_fetcher_unittest.cc",
- "hardware_android_unittest.cc",
"payload_consumer/bzip_extent_writer_unittest.cc",
"payload_consumer/cached_file_descriptor_unittest.cc",
"payload_consumer/certificate_parser_android_unittest.cc",
"payload_consumer/delta_performer_integration_test.cc",
"payload_consumer/delta_performer_unittest.cc",
- "payload_consumer/download_action_android_unittest.cc",
"payload_consumer/extent_reader_unittest.cc",
"payload_consumer/extent_writer_unittest.cc",
"payload_consumer/fake_file_descriptor.cc",
@@ -722,9 +723,7 @@
"payload_generator/squashfs_filesystem_unittest.cc",
"payload_generator/zip_unittest.cc",
"testrunner.cc",
- "update_attempter_android_unittest.cc",
"update_status_utils_unittest.cc",
- "metrics_reporter_stub.cc",
],
}