Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "set zero shutdown timeout for eng build"
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Mar 29, 2017
2 parents 8772b36 + c4ffa5c commit 6fb2ef1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions init/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ init_options += \
-DREBOOT_BOOTLOADER_ON_PANIC=0
endif

ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
init_options += \
-DSHUTDOWN_ZERO_TIMEOUT=1
else
init_options += \
-DSHUTDOWN_ZERO_TIMEOUT=0
endif

init_options += -DLOG_UEVENTS=0

init_cflags += \
Expand Down
9 changes: 8 additions & 1 deletion init/reboot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,14 @@ void DoReboot(unsigned int cmd, const std::string& reason, const std::string& re
}

/* TODO update default waiting time based on usage data */
unsigned int shutdownTimeout = android::base::GetUintProperty("ro.build.shutdown_timeout", 10u);
constexpr unsigned int shutdownTimeoutDefault = 10;
unsigned int shutdownTimeout = shutdownTimeoutDefault;
if (SHUTDOWN_ZERO_TIMEOUT) { // eng build
shutdownTimeout = 0;
} else {
shutdownTimeout =
android::base::GetUintProperty("ro.build.shutdown_timeout", shutdownTimeoutDefault);
}
LOG(INFO) << "Shutdown timeout: " << shutdownTimeout;

static const constexpr char* shutdown_critical_services[] = {"vold", "watchdogd"};
Expand Down

0 comments on commit 6fb2ef1

Please sign in to comment.