summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/init_wayne.cpp43
1 files changed, 2 insertions, 41 deletions
diff --git a/init/init_wayne.cpp b/init/init_wayne.cpp
index 50e039a..dc6a4a2 100644
--- a/init/init_wayne.cpp
+++ b/init/init_wayne.cpp
@@ -30,15 +30,13 @@
#include <cstdlib>
#include <fstream>
-#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
#include <sys/sysinfo.h>
#include <unistd.h>
-#include <android-base/file.h>
#include <android-base/properties.h>
-#include <android-base/strings.h>
+#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
+#include <sys/_system_properties.h>
#include "vendor_init.h"
#include "property_service.h"
@@ -46,8 +44,6 @@
using android::base::GetProperty;
using android::init::property_set;
-using android::base::ReadFileToString;
-using android::base::Trim;
char const *heapstartsize;
char const *heapgrowthlimit;
@@ -60,40 +56,6 @@ __attribute__ ((weak))
void init_target_properties() {}
#endif
-static void init_alarm_boot_properties()
-{
- char const *boot_reason_file = "/proc/sys/kernel/boot_reason";
- char const *power_off_alarm_file = "/persist/alarm/powerOffAlarmSet";
- std::string boot_reason;
- std::string power_off_alarm;
- std::string reboot_reason = GetProperty("ro.boot.alarmboot", "");
-
- if (ReadFileToString(boot_reason_file, &boot_reason)
- && ReadFileToString(power_off_alarm_file, &power_off_alarm)) {
- /*
- * Setup ro.alarm_boot value to true when it is RTC triggered boot up
- * For existing PMIC chips, the following mapping applies
- * for the value of boot_reason:
- *
- * 0 -> unknown
- * 1 -> hard reset
- * 2 -> sudden momentary power loss (SMPL)
- * 3 -> real time clock (RTC)
- * 4 -> DC charger inserted
- * 5 -> USB charger inserted
- * 6 -> PON1 pin toggled (for secondary PMICs)
- * 7 -> CBLPWR_N pin toggled (for external power supply)
- * 8 -> KPDPWR_N pin toggled (power key pressed)
- */
- if ((Trim(boot_reason) == "3" || reboot_reason == "true")
- && Trim(power_off_alarm) == "1") {
- property_set("ro.alarm_boot", "true");
- } else {
- property_set("ro.alarm_boot", "false");
- }
- }
-}
-
void check_device()
{
struct sysinfo sys;
@@ -119,7 +81,6 @@ void check_device()
void vendor_load_properties()
{
- init_alarm_boot_properties();
check_device();
#ifdef TARGET_HAVE_LIBINIT
init_target_properties();