mirror of
https://github.com/LineageOS/android_device_xiaomi_whyred.git
synced 2025-10-03 17:59:24 +02:00
whyred: init: Update for O
Change-Id: I635dc8d27f92f9a2fa83da62c2f32e48bd2c7680
This commit is contained in:
parent
4ef7e054d5
commit
fc87661af3
1 changed files with 9 additions and 7 deletions
|
@ -29,13 +29,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <android-base/file.h>
|
||||||
|
#include <android-base/properties.h>
|
||||||
#include <android-base/strings.h>
|
#include <android-base/strings.h>
|
||||||
|
|
||||||
#include "vendor_init.h"
|
|
||||||
#include "property_service.h"
|
#include "property_service.h"
|
||||||
#include "log.h"
|
#include "vendor_init.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
|
using android::base::GetProperty;
|
||||||
|
using android::base::ReadFileToString;
|
||||||
using android::base::Trim;
|
using android::base::Trim;
|
||||||
|
|
||||||
static void init_alarm_boot_properties()
|
static void init_alarm_boot_properties()
|
||||||
|
@ -44,10 +46,10 @@ static void init_alarm_boot_properties()
|
||||||
char const *power_off_alarm_file = "/persist/alarm/powerOffAlarmSet";
|
char const *power_off_alarm_file = "/persist/alarm/powerOffAlarmSet";
|
||||||
std::string boot_reason;
|
std::string boot_reason;
|
||||||
std::string power_off_alarm;
|
std::string power_off_alarm;
|
||||||
std::string reboot_reason = property_get("ro.boot.alarmboot");
|
std::string reboot_reason = GetProperty("ro.boot.alarmboot", "");
|
||||||
|
|
||||||
if (read_file(boot_reason_file, &boot_reason)
|
if (ReadFileToString(boot_reason_file, &boot_reason)
|
||||||
&& read_file(power_off_alarm_file, &power_off_alarm)) {
|
&& ReadFileToString(power_off_alarm_file, &power_off_alarm)) {
|
||||||
/*
|
/*
|
||||||
* Setup ro.alarm_boot value to true when it is RTC triggered boot up
|
* Setup ro.alarm_boot value to true when it is RTC triggered boot up
|
||||||
* For existing PMIC chips, the following mapping applies
|
* For existing PMIC chips, the following mapping applies
|
||||||
|
@ -76,7 +78,7 @@ void vendor_load_properties()
|
||||||
{
|
{
|
||||||
std::string platform;
|
std::string platform;
|
||||||
|
|
||||||
platform = property_get("ro.board.platform");
|
platform = GetProperty("ro.board.platform", "");
|
||||||
if (platform != ANDROID_TARGET)
|
if (platform != ANDROID_TARGET)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue