From 8b7af4c0ee245c913ae00dbf052c85156fb1b68e Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 1 Jun 2018 11:58:54 +0900 Subject: [PATCH 1/8] Recovery image is self-contained Now recovery mode is self-contained, which means we don't need to mount system.img to run shell, etc. What is needed in recovery mode is all in the recovery ramdisk image. Since we no longer use /system as the mount point for the system.img, this allows us to have identical filesystem layout as the system.img. Executables and libs are installed to /system/bin and /system/lib. Right now, we only have adbd, sh, toybox in /system/bin but will move static executables from /sbin to /system/bin as soon as they are converted to dynamic executables. system.img is mounted to /mnt/system instead. Bug: 63673171 Test: `adb reboot recovery; adb devices` shows the device ID Test: `adb root && adb shell` and then $ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from the /lib directory. Change-Id: I801ebd18f3e0a112db3d9a11e4fbb4e49181652a --- etc/init.rc | 3 ++- fsck_unshare_blocks.cpp | 14 +++----------- recovery.cpp | 8 +++----- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/etc/init.rc b/etc/init.rc index 0fc6c4c1..96c37b11 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -22,6 +22,7 @@ on init mkdir /data mkdir /cache mkdir /sideload + mkdir /mnt/system mount tmpfs tmpfs /tmp chown root shell /tmp @@ -87,7 +88,7 @@ service charger /charger -r service recovery /sbin/recovery seclabel u:r:recovery:s0 -service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery +service adbd /system/bin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery disabled socket adbd stream 660 system system seclabel u:r:adbd:s0 diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp index a100368e..2e6b5b80 100644 --- a/fsck_unshare_blocks.cpp +++ b/fsck_unshare_blocks.cpp @@ -115,14 +115,6 @@ static bool run_e2fsck(const std::string& partition) { return true; } -static const char* get_system_root() { - if (android::base::GetBoolProperty("ro.build.system_root_image", false)) { - return "/system_root"; - } else { - return "/system"; - } -} - bool do_fsck_unshare_blocks() { // List of partitions we will try to e2fsck -E unshare_blocks. std::vector partitions = { "/odm", "/oem", "/product", "/vendor" }; @@ -130,10 +122,10 @@ bool do_fsck_unshare_blocks() { // Temporarily mount system so we can copy e2fsck_static. bool mounted = false; if (android::base::GetBoolProperty("ro.build.system_root_image", false)) { - mounted = ensure_path_mounted_at("/", "/system_root") != -1; + mounted = ensure_path_mounted_at("/", "/mnt/system") != -1; partitions.push_back("/"); } else { - mounted = ensure_path_mounted("/system") != -1; + mounted = ensure_path_mounted_at("/system", "/mnt/system") != -1; partitions.push_back("/system"); } if (!mounted) { @@ -144,7 +136,7 @@ bool do_fsck_unshare_blocks() { LOG(ERROR) << "Could not copy e2fsck to /tmp."; return false; } - if (umount(get_system_root()) < 0) { + if (umount("/mnt/system") < 0) { PLOG(ERROR) << "umount failed"; return false; } diff --git a/recovery.cpp b/recovery.cpp index 98cbfed2..fea65ae9 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -820,15 +820,13 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) { break; } case Device::MOUNT_SYSTEM: - // For a system image built with the root directory (i.e. system_root_image == "true"), we - // mount it to /system_root, and symlink /system to /system_root/system to make adb shell - // work (the symlink is created through the build system). (Bug: 22855115) + // the system partition is mounted at /mnt/system if (android::base::GetBoolProperty("ro.build.system_root_image", false)) { - if (ensure_path_mounted_at("/", "/system_root") != -1) { + if (ensure_path_mounted_at("/", "/mnt/system") != -1) { ui->Print("Mounted /system.\n"); } } else { - if (ensure_path_mounted("/system") != -1) { + if (ensure_path_mounted_at("/system", "/mnt/system") != -1) { ui->Print("Mounted /system.\n"); } } From 8c3af4aa8c35b9fdeb5c2b350098c20202fd3830 Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Wed, 13 Jun 2018 09:53:29 -0700 Subject: [PATCH 2/8] updater_sample: add proguard.flags Test: junit Change-Id: I0175271935fdd87dd49ad9936d0e1b550d164e05 Signed-off-by: Zhomart Mukhamejanov --- updater_sample/Android.mk | 5 ++--- updater_sample/proguard.flags | 23 +++++++++++++++++++++++ updater_sample/tests/Android.mk | 6 +++--- 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 updater_sample/proguard.flags diff --git a/updater_sample/Android.mk b/updater_sample/Android.mk index 7662111b..a5deee1c 100644 --- a/updater_sample/Android.mk +++ b/updater_sample/Android.mk @@ -20,9 +20,8 @@ include $(CLEAR_VARS) LOCAL_PACKAGE_NAME := SystemUpdaterSample LOCAL_MODULE_TAGS := samples LOCAL_SDK_VERSION := system_current - -# TODO: enable proguard and use proguard.flags file -LOCAL_PROGUARD_ENABLED := disabled +LOCAL_PRIVILEGED_MODULE := true +LOCAL_PROGUARD_FLAG_FILES := proguard.flags LOCAL_SRC_FILES := $(call all-java-files-under, src) diff --git a/updater_sample/proguard.flags b/updater_sample/proguard.flags new file mode 100644 index 00000000..5883608d --- /dev/null +++ b/updater_sample/proguard.flags @@ -0,0 +1,23 @@ +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Keep, used in tests. +-keep public class com.example.android.systemupdatersample.UpdateManager { + public int getUpdaterState(); +} + +# Keep, used in tests. +-keep public class com.example.android.systemupdatersample.UpdateConfig { + public (java.lang.String, java.lang.String, int); +} diff --git a/updater_sample/tests/Android.mk b/updater_sample/tests/Android.mk index 9aec372e..41576045 100644 --- a/updater_sample/tests/Android.mk +++ b/updater_sample/tests/Android.mk @@ -22,10 +22,10 @@ LOCAL_SDK_VERSION := system_current LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := \ android.test.base.stubs \ - android.test.runner.stubs \ - guava + android.test.runner.stubs LOCAL_STATIC_JAVA_LIBRARIES := android-support-test \ - mockito-target-minus-junit4 + mockito-target-minus-junit4 \ + guava LOCAL_INSTRUMENTATION_FOR := SystemUpdaterSample LOCAL_PROGUARD_ENABLED := disabled From 9f4263346bb93424efab2d69082c78b456f9db58 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 13 Jun 2018 10:39:44 -0700 Subject: [PATCH 3/8] minui: Add constness to GRSurface* in gr_get_{width,height}. Also free gr_font in gr_exit(), as it's owned by minui. Test: mmma -j bootable/recovery system/core/healthd Test: recovery_unit_test on marlin Test: Boot into recovery. Run graphics test. Change-Id: I00457bb97ed3dc95ef5aad493827fb5a62a258dc --- minui/graphics.cpp | 32 ++++++++++++++++++-------------- minui/include/minui/minui.h | 19 +++++++++++++------ 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/minui/graphics.cpp b/minui/graphics.cpp index c1aab412..cc02e9e8 100644 --- a/minui/graphics.cpp +++ b/minui/graphics.cpp @@ -28,7 +28,7 @@ #include "graphics_fbdev.h" #include "minui/minui.h" -static GRFont* gr_font = NULL; +static GRFont* gr_font = nullptr; static MinuiBackend* gr_backend = nullptr; static int overscan_percent = OVERSCAN_PERCENT; @@ -38,7 +38,8 @@ static int overscan_offset_y = 0; static uint32_t gr_current = ~0; static constexpr uint32_t alpha_mask = 0xff000000; -static GRSurface* gr_draw = NULL; +// gr_draw is owned by backends. +static const GRSurface* gr_draw = nullptr; static GRRotation rotation = ROTATION_NONE; static bool outside(int x, int y) { @@ -86,7 +87,7 @@ static inline uint32_t pixel_blend(uint8_t alpha, uint32_t pix) { return (out_r & 0xff) | (out_g & 0xff00) | (out_b & 0xff0000) | (gr_current & 0xff000000); } -// increments pixel pointer right, with current rotation. +// Increments pixel pointer right, with current rotation. static void incr_x(uint32_t** p, int row_pixels) { if (rotation % 2) { *p = *p + (rotation == 1 ? 1 : -1) * row_pixels; @@ -95,7 +96,7 @@ static void incr_x(uint32_t** p, int row_pixels) { } } -// increments pixel pointer down, with current rotation. +// Increments pixel pointer down, with current rotation. static void incr_y(uint32_t** p, int row_pixels) { if (rotation % 2) { *p = *p + (rotation == 1 ? -1 : 1); @@ -104,8 +105,8 @@ static void incr_y(uint32_t** p, int row_pixels) { } } -// returns pixel pointer at given coordinates with rotation adjustment. -static uint32_t* pixel_at(GRSurface* surf, int x, int y, int row_pixels) { +// Returns pixel pointer at given coordinates with rotation adjustment. +static uint32_t* pixel_at(const GRSurface* surf, int x, int y, int row_pixels) { switch (rotation) { case ROTATION_NONE: return reinterpret_cast(surf->data) + y * row_pixels + x; @@ -172,7 +173,7 @@ void gr_text(const GRFont* font, int x, int y, const char* s, bool bold) { } void gr_texticon(int x, int y, GRSurface* icon) { - if (icon == NULL) return; + if (icon == nullptr) return; if (icon->pixel_bytes != 1) { printf("gr_texticon: source has wrong format\n"); @@ -243,7 +244,7 @@ void gr_fill(int x1, int y1, int x2, int y2) { } void gr_blit(GRSurface* source, int sx, int sy, int w, int h, int dx, int dy) { - if (source == NULL) return; + if (source == nullptr) return; if (gr_draw->pixel_bytes != source->pixel_bytes) { printf("gr_blit: source has wrong format\n"); @@ -275,8 +276,7 @@ void gr_blit(GRSurface* source, int sx, int sy, int w, int h, int dx, int dy) { unsigned char* src_p = source->data + sy * source->row_bytes + sx * source->pixel_bytes; unsigned char* dst_p = gr_draw->data + dy * gr_draw->row_bytes + dx * gr_draw->pixel_bytes; - int i; - for (i = 0; i < h; ++i) { + for (int i = 0; i < h; ++i) { memcpy(dst_p, src_p, w * source->pixel_bytes); src_p += source->row_bytes; dst_p += gr_draw->row_bytes; @@ -284,15 +284,15 @@ void gr_blit(GRSurface* source, int sx, int sy, int w, int h, int dx, int dy) { } } -unsigned int gr_get_width(GRSurface* surface) { - if (surface == NULL) { +unsigned int gr_get_width(const GRSurface* surface) { + if (surface == nullptr) { return 0; } return surface->width; } -unsigned int gr_get_height(GRSurface* surface) { - if (surface == NULL) { +unsigned int gr_get_height(const GRSurface* surface) { + if (surface == nullptr) { return 0; } return surface->height; @@ -372,6 +372,10 @@ int gr_init() { void gr_exit() { delete gr_backend; + gr_backend = nullptr; + + delete gr_font; + gr_font = nullptr; } int gr_fb_width() { diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h index e96b7ae0..ef4abe25 100644 --- a/minui/include/minui/minui.h +++ b/minui/include/minui/minui.h @@ -48,7 +48,13 @@ enum GRRotation { ROTATION_LEFT = 3, }; +// Initializes the graphics backend and loads font file. Returns 0 on success, or -1 on error. Note +// that the font initialization failure would be non-fatal, as caller may not need to draw any text +// at all. Caller can check the font initialization result via gr_sys_font() as needed. int gr_init(); + +// Frees the allocated resources. The function is idempotent, and safe to be called if gr_init() +// didn't finish successfully. void gr_exit(); int gr_fb_width(); @@ -57,7 +63,8 @@ int gr_fb_height(); void gr_flip(); void gr_fb_blank(bool blank); -void gr_clear(); // clear entire surface to current color +// Clears entire surface to current color. +void gr_clear(); void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a); void gr_fill(int x1, int y1, int x2, int y2); @@ -66,16 +73,16 @@ void gr_texticon(int x, int y, GRSurface* icon); const GRFont* gr_sys_font(); int gr_init_font(const char* name, GRFont** dest); void gr_text(const GRFont* font, int x, int y, const char* s, bool bold); -// Return -1 if font is nullptr. +// Returns -1 if font is nullptr. int gr_measure(const GRFont* font, const char* s); -// Return -1 if font is nullptr. +// Returns -1 if font is nullptr. int gr_font_size(const GRFont* font, int* x, int* y); void gr_blit(GRSurface* source, int sx, int sy, int w, int h, int dx, int dy); -unsigned int gr_get_width(GRSurface* surface); -unsigned int gr_get_height(GRSurface* surface); +unsigned int gr_get_width(const GRSurface* surface); +unsigned int gr_get_height(const GRSurface* surface); -// Set rotation, flips gr_fb_width/height if 90 degree rotation difference +// Sets rotation, flips gr_fb_width/height if 90 degree rotation difference void gr_rotate(GRRotation rotation); // From 60ac622245a04e83302db866cf9244f1b71b62dd Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 13 Jun 2018 14:33:51 -0700 Subject: [PATCH 4/8] screen_ui: Call gr_exit() from dtor. ScreenRecoveryUI calls gr_init() during Init(), and should release any allocated resource upon destructing. It's a no-op to call gr_exit() if gr_init() was not called or didn't finish successfully. Test: recovery_unit_test on marlin. Test: Boot into recovery. Run graphics test. Change-Id: Ib9632170174cdacd51d382f23c8daf6a9bc59f7a --- screen_ui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/screen_ui.cpp b/screen_ui.cpp index b4ef054c..e8444b6c 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -176,6 +176,8 @@ ScreenRecoveryUI::~ScreenRecoveryUI() { if (progress_thread_.joinable()) { progress_thread_.join(); } + // No-op if gr_init() (via Init()) was not called or had failed. + gr_exit(); } GRSurface* ScreenRecoveryUI::GetCurrentFrame() const { From ebee98df6fd152a66e200fdd02b1ed37f547c494 Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Wed, 13 Jun 2018 16:18:38 -0700 Subject: [PATCH 5/8] updater_sample: add metadata mismatch error code Update util/UpdateEngineErrorCodes.java Test: n/a Change-Id: I7250b1198b1d5ff0e38b7d4effe61eebd114a44f Signed-off-by: Zhomart Mukhamejanov --- .../android/systemupdatersample/util/UpdateEngineErrorCodes.java | 1 + 1 file changed, 1 insertion(+) diff --git a/updater_sample/src/com/example/android/systemupdatersample/util/UpdateEngineErrorCodes.java b/updater_sample/src/com/example/android/systemupdatersample/util/UpdateEngineErrorCodes.java index 7d55ff8f..13df88b1 100644 --- a/updater_sample/src/com/example/android/systemupdatersample/util/UpdateEngineErrorCodes.java +++ b/updater_sample/src/com/example/android/systemupdatersample/util/UpdateEngineErrorCodes.java @@ -54,6 +54,7 @@ public final class UpdateEngineErrorCodes { CODE_TO_NAME_MAP.put(12, "DOWNLOAD_PAYLOAD_VERIFICATION_ERROR"); CODE_TO_NAME_MAP.put(15, "NEW_ROOTFS_VERIFICATION_ERROR"); CODE_TO_NAME_MAP.put(20, "DOWNLOAD_STATE_INITIALIZATION_ERROR"); + CODE_TO_NAME_MAP.put(26, "DOWNLOAD_METADATA_SIGNATURE_MISMATCH"); CODE_TO_NAME_MAP.put(48, "USER_CANCELLED"); CODE_TO_NAME_MAP.put(52, "UPDATED_BUT_NOT_ACTIVE"); } From ba4edb3e82d383a274cea979c9cacfd2e7f62568 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 13 Jun 2018 11:22:50 -0700 Subject: [PATCH 6/8] screen_ui: Move the call to gr_init() into Init(). gr_init() does general initialization works, in addition to loading font file. InitTextParams() handles text related works. Also check the font initialization result before using, as gr_init() would ignore font initialization failures. Test: recovery_unit_test on marlin. Test: Boot into recovery. Run graphics test. Change-Id: I12da22dfe8d13448cfbc83dbc51cd96f23c2deee --- screen_ui.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/screen_ui.cpp b/screen_ui.cpp index e8444b6c..f9c4a06c 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -702,10 +702,10 @@ void ScreenRecoveryUI::SetSystemUpdateText(bool security_update) { } bool ScreenRecoveryUI::InitTextParams() { - if (gr_init() < 0) { + // gr_init() would return successfully on font initialization failure. + if (gr_sys_font() == nullptr) { return false; } - gr_font_size(gr_sys_font(), &char_width_, &char_height_); text_rows_ = (ScreenHeight() - kMarginHeight * 2) / char_height_; text_cols_ = (ScreenWidth() - kMarginWidth * 2) / char_width_; @@ -715,6 +715,10 @@ bool ScreenRecoveryUI::InitTextParams() { bool ScreenRecoveryUI::Init(const std::string& locale) { RecoveryUI::Init(locale); + if (gr_init() == -1) { + return false; + } + if (!InitTextParams()) { return false; } From 51f16ec76d00dd121e4b8f0611acebc02a27a4a9 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 4 Jun 2018 11:40:20 -0700 Subject: [PATCH 7/8] tests: Skip ScreenRecoveryUITest on gr_init failure. It addresses the ScreenRecoveryUITest failures on gce targets which don't have any graphics backend. Probing for all backend devices in tests could work, but would duplicate codes. This CL relies on the result of gr_init(). As a side effect, it may give false negatives if gr_init() is supposed to work but silently broken. But such issues are beyond ScreenRecoveryUITest's concern, which should be captured by the tests for minui or graphics backends instead. Fixes: 79616356 Test: Run recovery_unit_test on marlin. Test: Run recovery_unit_test on gce. Change-Id: I121aacc61c8a614447509506057ecfd8d86163e4 --- tests/unit/screen_ui_test.cpp | 39 ++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tests/unit/screen_ui_test.cpp b/tests/unit/screen_ui_test.cpp index a3dd2add..2f4b7b09 100644 --- a/tests/unit/screen_ui_test.cpp +++ b/tests/unit/screen_ui_test.cpp @@ -30,6 +30,7 @@ #include "common/test_constants.h" #include "device.h" +#include "minui/minui.h" #include "otautil/paths.h" #include "private/resources.h" #include "screen_ui.h" @@ -274,18 +275,34 @@ class ScreenRecoveryUITest : public ::testing::Test { const std::string kTestRtlLocaleWithSuffix = "ar-EG"; void SetUp() override { - ui_ = std::make_unique(); + has_graphics_ = gr_init() == 0; + gr_exit(); + + if (has_graphics_) { + ui_ = std::make_unique(); + } testdata_dir_ = from_testdata_base(""); Paths::Get().set_resource_dir(testdata_dir_); res_set_resource_dir(testdata_dir_); } + bool has_graphics_; std::unique_ptr ui_; std::string testdata_dir_; }; +#define RETURN_IF_NO_GRAPHICS \ + do { \ + if (!has_graphics_) { \ + GTEST_LOG_(INFO) << "Test skipped due to no available graphics device"; \ + return; \ + } \ + } while (false) + TEST_F(ScreenRecoveryUITest, Init) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); ASSERT_EQ(kTestLocale, ui_->GetLocale()); ASSERT_FALSE(ui_->GetRtlLocale()); @@ -299,6 +316,8 @@ TEST_F(ScreenRecoveryUITest, dtor_NotCallingInit) { } TEST_F(ScreenRecoveryUITest, ShowText) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); ASSERT_FALSE(ui_->IsTextVisible()); ui_->ShowText(true); @@ -311,16 +330,22 @@ TEST_F(ScreenRecoveryUITest, ShowText) { } TEST_F(ScreenRecoveryUITest, RtlLocale) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestRtlLocale)); ASSERT_TRUE(ui_->GetRtlLocale()); } TEST_F(ScreenRecoveryUITest, RtlLocaleWithSuffix) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestRtlLocaleWithSuffix)); ASSERT_TRUE(ui_->GetRtlLocale()); } TEST_F(ScreenRecoveryUITest, ShowMenu) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); ui_->SetKeyBuffer({ KeyCode::UP, @@ -347,6 +372,8 @@ TEST_F(ScreenRecoveryUITest, ShowMenu) { } TEST_F(ScreenRecoveryUITest, ShowMenu_NotMenuOnly) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); ui_->SetKeyBuffer({ KeyCode::MAGIC, @@ -358,6 +385,8 @@ TEST_F(ScreenRecoveryUITest, ShowMenu_NotMenuOnly) { } TEST_F(ScreenRecoveryUITest, ShowMenu_TimedOut) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); ui_->SetKeyBuffer({ KeyCode::TIMEOUT, @@ -366,6 +395,8 @@ TEST_F(ScreenRecoveryUITest, ShowMenu_TimedOut) { } TEST_F(ScreenRecoveryUITest, ShowMenu_TimedOut_TextWasEverVisible) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); ui_->ShowText(true); ui_->ShowText(false); @@ -382,6 +413,8 @@ TEST_F(ScreenRecoveryUITest, ShowMenu_TimedOut_TextWasEverVisible) { } TEST_F(ScreenRecoveryUITest, LoadAnimation) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); // Make a few copies of loop00000.png from testdata. std::string image_data; @@ -410,6 +443,8 @@ TEST_F(ScreenRecoveryUITest, LoadAnimation) { } TEST_F(ScreenRecoveryUITest, LoadAnimation_MissingAnimation) { + RETURN_IF_NO_GRAPHICS; + ASSERT_TRUE(ui_->Init(kTestLocale)); TemporaryDir resource_dir; Paths::Get().set_resource_dir(resource_dir.path); @@ -417,3 +452,5 @@ TEST_F(ScreenRecoveryUITest, LoadAnimation_MissingAnimation) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(ui_->RunLoadAnimation(), ::testing::KilledBySignal(SIGABRT), ""); } + +#undef RETURN_IF_NO_GRAPHICS From c02fb99e1db264a461ee2bdc05ab0ff1bef101fd Mon Sep 17 00:00:00 2001 From: Ian Pedowitz Date: Thu, 14 Jun 2018 06:35:18 +0000 Subject: [PATCH 8/8] Revert "updater_sample: add proguard.flags" This reverts commit 8c3af4aa8c35b9fdeb5c2b350098c20202fd3830. Reason for revert: Broke Master Change-Id: I37bceeea630fb7db39efa25d03ababe3d84cdfbf --- updater_sample/Android.mk | 5 +++-- updater_sample/proguard.flags | 23 ----------------------- updater_sample/tests/Android.mk | 6 +++--- 3 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 updater_sample/proguard.flags diff --git a/updater_sample/Android.mk b/updater_sample/Android.mk index a5deee1c..7662111b 100644 --- a/updater_sample/Android.mk +++ b/updater_sample/Android.mk @@ -20,8 +20,9 @@ include $(CLEAR_VARS) LOCAL_PACKAGE_NAME := SystemUpdaterSample LOCAL_MODULE_TAGS := samples LOCAL_SDK_VERSION := system_current -LOCAL_PRIVILEGED_MODULE := true -LOCAL_PROGUARD_FLAG_FILES := proguard.flags + +# TODO: enable proguard and use proguard.flags file +LOCAL_PROGUARD_ENABLED := disabled LOCAL_SRC_FILES := $(call all-java-files-under, src) diff --git a/updater_sample/proguard.flags b/updater_sample/proguard.flags deleted file mode 100644 index 5883608d..00000000 --- a/updater_sample/proguard.flags +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2018 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Keep, used in tests. --keep public class com.example.android.systemupdatersample.UpdateManager { - public int getUpdaterState(); -} - -# Keep, used in tests. --keep public class com.example.android.systemupdatersample.UpdateConfig { - public (java.lang.String, java.lang.String, int); -} diff --git a/updater_sample/tests/Android.mk b/updater_sample/tests/Android.mk index 41576045..9aec372e 100644 --- a/updater_sample/tests/Android.mk +++ b/updater_sample/tests/Android.mk @@ -22,10 +22,10 @@ LOCAL_SDK_VERSION := system_current LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := \ android.test.base.stubs \ - android.test.runner.stubs -LOCAL_STATIC_JAVA_LIBRARIES := android-support-test \ - mockito-target-minus-junit4 \ + android.test.runner.stubs \ guava +LOCAL_STATIC_JAVA_LIBRARIES := android-support-test \ + mockito-target-minus-junit4 LOCAL_INSTRUMENTATION_FOR := SystemUpdaterSample LOCAL_PROGUARD_ENABLED := disabled