Snap for 9364794 from d0586cdd4b
to tm-qpr2-release
Change-Id: Icad63b51f8c3f0a0c907b21c34b775429475dc6a
This commit is contained in:
commit
b0b48e04cd
2 changed files with 9 additions and 5 deletions
|
@ -67,7 +67,7 @@ const struct MitigationConfig::Config cfg = {
|
||||||
const char kReadyFilePath[] = "/sys/devices/virtual/pmic/mitigation/instruction/ready";
|
const char kReadyFilePath[] = "/sys/devices/virtual/pmic/mitigation/instruction/ready";
|
||||||
const char kReadyProperty[] = "vendor.brownout.mitigation.ready";
|
const char kReadyProperty[] = "vendor.brownout.mitigation.ready";
|
||||||
const char kLastMealPath[] = "/data/vendor/mitigation/lastmeal.txt";
|
const char kLastMealPath[] = "/data/vendor/mitigation/lastmeal.txt";
|
||||||
const char kBRRequestedProperty[] = "vendor.startup_bugreport_requested";
|
const char kBRRequestedProperty[] = "vendor.brownout_reason";
|
||||||
const std::regex kTimestampRegex("^\\S+\\s[0-9]+:[0-9]+:[0-9]+\\S+$");
|
const std::regex kTimestampRegex("^\\S+\\s[0-9]+:[0-9]+:[0-9]+\\S+$");
|
||||||
|
|
||||||
int main(int /*argc*/, char ** /*argv*/) {
|
int main(int /*argc*/, char ** /*argv*/) {
|
||||||
|
@ -80,8 +80,8 @@ int main(int /*argc*/, char ** /*argv*/) {
|
||||||
cfg.LogFilePath,
|
cfg.LogFilePath,
|
||||||
cfg.TimestampFormat,
|
cfg.TimestampFormat,
|
||||||
kTimestampRegex);
|
kTimestampRegex);
|
||||||
int startupBugreport = android::base::GetIntProperty(kBRRequestedProperty, 0);
|
std::string reason = android::base::GetProperty(kBRRequestedProperty, "");
|
||||||
if (startupBugreport && mitigationLogTimeValid) {
|
if (!reason.empty() && mitigationLogTimeValid) {
|
||||||
std::ifstream src(cfg.LogFilePath, std::ios::in);
|
std::ifstream src(cfg.LogFilePath, std::ios::in);
|
||||||
std::ofstream dst(kLastMealPath, std::ios::out);
|
std::ofstream dst(kLastMealPath, std::ios::out);
|
||||||
dst << src.rdbuf();
|
dst << src.rdbuf();
|
||||||
|
|
|
@ -551,8 +551,12 @@ PRODUCT_PACKAGES += \
|
||||||
|
|
||||||
# Battery Mitigation
|
# Battery Mitigation
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
battery_mitigation \
|
battery_mitigation
|
||||||
BrownoutDetection
|
|
||||||
|
|
||||||
|
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
|
||||||
|
PRODUCT_PACKAGES += BrownoutDetection
|
||||||
|
endif
|
||||||
|
|
||||||
PRODUCT_PACKAGES_DEBUG += \
|
PRODUCT_PACKAGES_DEBUG += \
|
||||||
sg_write_buffer \
|
sg_write_buffer \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue