Adding const decorator to class constructor to ensure Flashing Plan
isn't modified during task construction
Bug: 194686221
Test: tested Flashall on raven
Change-Id: I99b71b2b756beaf871a31a1a035545d754d128e8
Updating old clean up slot logic change. Some devices don't know current
slot so we can't always just call get_current_slot()
Test: tested flashall on raven
Change-Id: Id655f1c1ee0b1ff09331f0d91d77412836d0af8d
This test requires root to run. Skip if not root.
Bug: 270052268
Test: CtsInitTestCases init#StartConsole
Change-Id: I8b54acf97cda4bc2cfa15d0e34c678ec2b13f83e
liblog can drop data when debuggerd is overloaded, which leads to
truncated tombstones. by adding the count separately, automation can
easily see whether it is dealing with a truncated tombstone or not.
Bug: 269537146
Change-Id: Ia991537efc0d6b57cbff23ee45af6521467aa20d
This change adds a missing pointer dereference to the InterceptResponse
when checking for a size mismatch.
Test: build
Bug: N/A
Change-Id: I88afed6f1c0f33fe237d337b0fb8fc0a0c0e3bac
libselinux log messages usually end with a new line character. Android
log system does not require the new line character and will include the
character as-is in the log buffer.
This trimming was already implemented when the message is typed as
SELINUX_AVC (see SelinuxAvcLog). Move the truncation one level up so it
is occurring for all types of logs.
Test: boot & adb logcat & inspect SELinux logs
Change-Id: I360359c1b178ef24d555dd41f8d4a18b293a175c
Modifying fastboot-info.txt to directly call reboot fastboot instead of
reboot userspace -> so no longer need "userspace" in reboot task. Also
moving skip_reboot check to task since in old code we can have
skip_reboot be true and still reboot to bootloader, fastboot, or
recovery
Test: tested reboot commands on Raven
Change-Id: I98ba51747bf7229a88ba737540c81d20b42e5981
Doesn't look like we actually need current_slot, since we can always
just call function get_current_slot
Test: tested flashall on raven
Change-Id: Icba64bc9fdd08f36d44965e32558a73d0beab0e1
Changed so if we call wipe on a partition that doesn't exist we'll get
some helpful error messages.
Test: tested wipe test
Bug: 194686221
Change-Id: I19dc0396a7a98d0b2be7859edbffeb8acdc9850a
is_logical shouldn't work in bootloader for some devices, so we also need to check
using should_flash_in_userspace to see if partition is dynamic
Test: tested to flash {partition} on raven and checked to see avb
footers are not copied from dynamic partitions
Change-Id: Iabb3ea535fa80b26cf1c08040beb3d4ea5e8c2ae
Cuttlefish tooling need libmodprobe to determine if a kernel module is
signed.
Bug: 273752147
Test: th
Change-Id: Icea49802d032b27bd89ed8f0bee1bc4814298774
Based on a new system property. This won't change any behavior if that
new system property isn't set.
Ignore-AOSP-First: WearOS specific change
Upstreaming from Wear: b/272526799
Bug: 199404658
Test: set the property, check that off-mode-charging automatically
reboots
(cherry picked from commit 332b3686290af70c73a464ce35b0c1124b2ce831)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:82d8011f170d5b1c936d117f4fb74836333714b6)
Merged-In: I98f37a840a43cb5216319457027b76fc493e3f62
Change-Id: I98f37a840a43cb5216319457027b76fc493e3f62
NOTE FOR REVIEWERS - original patch and result patch are not identical.
PLEASE REVIEW CAREFULLY.
Diffs between the patches:
0,6 +620,18 @@
kick_animation(&batt_anim_);
}
health_info_ = health_info;
+
+ if (property_get_bool("ro.charger_mode_autoboot", false)) {
+ if (health_info_.battery_level >= boot_min_cap_) {
+ if (property_get_bool("ro.enable_boot_charger_mode", false)) {
+ LOGW("booting from charger mode\n");
+ property_set("sys.boot_from_charger_mode", "1");
+ } else {
+ LOGW("Battery SOC = %d%%, Automatically rebooting\n", health_info_.battery_level);
+ reboot(RB_AUTOBOOT);
+ }
+ }
+ }
}
int Charger::OnPrepareToWait(void) {
Original patch:
From 82d8011f170d5b1c936d117f4fb74836333714b6 Mon Sep 17 00:00:00 2001
From: Alice Sheng <alicesheng@google.com>
Date: Fri, 18 Mar 2022 10:25:31 -0700
Subject: [PATCH] Add ability to automatically bootup
Based on a new system property. This won't change any behavior if that
new system property isn't set.
Ignore-AOSP-First: WearOS specific change
Bug: 199404658
Test: set the property, check that off-mode-charging automatically
reboots
Change-Id: I98f37a840a43cb5216319457027b76fc493e3f62
(cherry picked from commit 332b3686290af70c73a464ce35b0c1124b2ce831)
---
Due to https://r.android.com/1310496, sparse_file_write() splits all
blocks larger than 64 MiB. However, the code that splits file-backed
blocks copies the pointer to the filename without duplicating the
underlying memory, causing a double free in backed_block_destroy()
later. Fix this by using strdup(). Also, as long as that is being
fixed, also check for failure.
Test: SANITIZE_HOST=address mmm external/e2fsprogs
mkdir mnt
mkfs.ext4 img 1G
sudo mount img mnt
sudo cp /dev/urandom mnt/file
sudo umount mnt
ext2simg img simg
Before this fix it gave:
==2216498==ERROR: AddressSanitizer: attempting double-free on 0x602000000090 in thread T0:
#0 0x55a52454c9a2 in free out/stage2/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/out/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3
#1 0x7ffa247c82ee in backed_block_destroy(backed_block*) system/core/libsparse/backed_block.cpp:106:5
#2 0x7ffa247c82ee in backed_block_list_destroy(backed_block_list*) system/core/libsparse/backed_block.cpp:124:7
#3 0x7ffa247cd055 in sparse_file_destroy system/core/libsparse/sparse.cpp:49:3
#4 0x55a524587b75 in main external/e2fsprogs/contrib/android/ext2simg.c:239:2
Change-Id: I4607ef5adcf6512645342beaf91aff6033414e54