Use more specific option to set dark mode am: 06ff813fcc

am: f5a27ac6f4

Change-Id: I8aedb2ee6a11aa4e0bc121bced6b95bbc8c603a0
This commit is contained in:
Tianjie Xu
2019-11-13 14:38:24 -08:00
committed by android-build-merger
4 changed files with 13 additions and 14 deletions

View File

@@ -91,7 +91,6 @@ TARGET_RECOVERY_UI_MARGIN_HEIGHT := 105
TARGET_RECOVERY_UI_LIB := \ TARGET_RECOVERY_UI_LIB := \
librecovery_ui_taimen \ librecovery_ui_taimen \
libbootloader_message \
libfstab libfstab
# VTS DTBO Verification. This kernel cmdline parameter should be added by the bootloader # VTS DTBO Verification. This kernel cmdline parameter should be added by the bootloader

View File

@@ -53,15 +53,13 @@ on late-init && property:ro.boot.revision=rev_a
on late-init && property:ro.boot.revision=rev_b on late-init && property:ro.boot.revision=rev_b
setprop vendor.thermal.config thermal_info_config_evt.json setprop vendor.thermal.config thermal_info_config_evt.json
# Write the dark theme magic (`theme-dark`, or 0x7468656d652d6461726b in hex string) to /misc # Write the dark theme magic to /misc partition.
# partition. Offset 0 in vendor space is effectively offset 2048 in /misc partition. service vendor.theme_set /vendor/bin/misc_writer --set-dark-theme
service vendor.theme_set /vendor/bin/misc_writer --vendor-space-offset 0 --hex-string 0x7468656d652d6461726b
disabled disabled
oneshot oneshot
# Clear the 10-byte dark theme magic in /misc partition. Offset 0 in vendor space is effectively # Clear the dark theme magic in /misc partition.
# offset 2048 in /misc partition. service vendor.theme_clear /vendor/bin/misc_writer --clear-dark-theme
service vendor.theme_clear /vendor/bin/misc_writer --vendor-space-offset 0 --hex-string 0x00000000000000000000
disabled disabled
oneshot oneshot

View File

@@ -27,7 +27,8 @@ cc_library_static {
"recovery_ui.cpp", "recovery_ui.cpp",
], ],
static_libs: [ whole_static_libs: [
"libmisc_writer",
"libbootloader_message", "libbootloader_message",
], ],

View File

@@ -18,17 +18,18 @@
#include <android-base/logging.h> #include <android-base/logging.h>
#include <bootloader_message/bootloader_message.h> #include <bootloader_message/bootloader_message.h>
#include <misc_writer/misc_writer.h>
#include <recovery_ui/device.h> #include <recovery_ui/device.h>
#include <recovery_ui/screen_ui.h> #include <recovery_ui/screen_ui.h>
using android::hardware::google::pixel::MiscWriter;
using android::hardware::google::pixel::MiscWriterActions;
// Wipes the provisioned flag as part of data wipe. // Wipes the provisioned flag as part of data wipe.
static bool WipeProvisionedFlag() { static bool WipeProvisionedFlag() {
// Must be consistent with the one in init.hardware.rc (10-byte `theme-dark`). MiscWriter misc_writer(MiscWriterActions::kClearDarkThemeFlag);
const std::string wipe_str(10, '\x00'); if (!misc_writer.PerformAction()) {
constexpr size_t kProvisionedFlagOffsetInVendorSpace = 0; LOG(ERROR) << "Failed to clear the dark theme flag";
if (std::string err; !WriteMiscPartitionVendorSpace(
wipe_str.data(), wipe_str.size(), kProvisionedFlagOffsetInVendorSpace, &err)) {
LOG(ERROR) << "Failed to write wipe string: " << err;
return false; return false;
} }
LOG(INFO) << "Provisioned flag wiped successful"; LOG(INFO) << "Provisioned flag wiped successful";