mirror of
https://github.com/LineageOS/android_device_xiaomi_whyred.git
synced 2025-10-03 09:49:16 +02:00
whyred: init: Cleanup and fix code style
Change-Id: Ice339617a0fb4555b5f37f42084ceaf98535bd24
This commit is contained in:
parent
1b147f98cf
commit
29bd4e0aff
2 changed files with 12 additions and 17 deletions
|
@ -24,7 +24,8 @@ LOCAL_C_INCLUDES := \
|
||||||
system/core/base/include \
|
system/core/base/include \
|
||||||
system/core/init
|
system/core/init
|
||||||
LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
|
LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
|
||||||
LOCAL_SRC_FILES := init_sdm660.cpp
|
LOCAL_CPPFLAGS := -Wall
|
||||||
LOCAL_MODULE := libinit_sdm660
|
LOCAL_SRC_FILES := init_sagit.cpp
|
||||||
|
LOCAL_MODULE := libinit_sagit
|
||||||
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||||
Copyright (C) 2016 The CyanogenMod Project.
|
Copyright (C) 2016 The CyanogenMod Project.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are
|
modification, are permitted provided that the following conditions are
|
||||||
met:
|
met:
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
* Neither the name of The Linux Foundation nor the names of its
|
* Neither the name of The Linux Foundation nor the names of its
|
||||||
contributors may be used to endorse or promote products derived
|
contributors may be used to endorse or promote products derived
|
||||||
from this software without specific prior written permission.
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
@ -26,8 +28,7 @@
|
||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <android-base/file.h>
|
#include <android-base/file.h>
|
||||||
#include <android-base/properties.h>
|
#include <android-base/properties.h>
|
||||||
|
@ -67,21 +68,14 @@ static void init_alarm_boot_properties()
|
||||||
* 8 -> KPDPWR_N pin toggled (power key pressed)
|
* 8 -> KPDPWR_N pin toggled (power key pressed)
|
||||||
*/
|
*/
|
||||||
if ((Trim(boot_reason) == "3" || reboot_reason == "true")
|
if ((Trim(boot_reason) == "3" || reboot_reason == "true")
|
||||||
&& Trim(power_off_alarm) == "1") {
|
&& Trim(power_off_alarm) == "1")
|
||||||
property_set("ro.alarm_boot", "true");
|
property_set("ro.alarm_boot", "true");
|
||||||
} else {
|
else
|
||||||
property_set("ro.alarm_boot", "false");
|
property_set("ro.alarm_boot", "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void vendor_load_properties()
|
void vendor_load_properties()
|
||||||
{
|
{
|
||||||
std::string platform;
|
|
||||||
|
|
||||||
platform = GetProperty("ro.board.platform", "");
|
|
||||||
if (platform != ANDROID_TARGET)
|
|
||||||
return;
|
|
||||||
|
|
||||||
init_alarm_boot_properties();
|
init_alarm_boot_properties();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue