whyred: init: Cleanup and fix code style

Change-Id: Ice339617a0fb4555b5f37f42084ceaf98535bd24
This commit is contained in:
Michael Bestas 2018-05-05 19:04:50 +03:00 committed by Vasishath Kaushal
parent 1b147f98cf
commit 29bd4e0aff
2 changed files with 12 additions and 17 deletions

View file

@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH:= $(call my-dir)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@ -24,7 +24,8 @@ LOCAL_C_INCLUDES := \
system/core/base/include \
system/core/init
LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
LOCAL_SRC_FILES := init_sdm660.cpp
LOCAL_MODULE := libinit_sdm660
LOCAL_CPPFLAGS := -Wall
LOCAL_SRC_FILES := init_sagit.cpp
LOCAL_MODULE := libinit_sagit
include $(BUILD_STATIC_LIBRARY)

View file

@ -1,6 +1,7 @@
/*
Copyright (c) 2015, The Linux Foundation. All rights reserved.
Copyright (C) 2016 The CyanogenMod Project.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
@ -13,6 +14,7 @@
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
@ -26,8 +28,7 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <android-base/file.h>
#include <android-base/properties.h>
@ -66,22 +67,15 @@ static void init_alarm_boot_properties()
* 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");
}
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 vendor_load_properties()
{
std::string platform;
platform = GetProperty("ro.board.platform", "");
if (platform != ANDROID_TARGET)
return;
init_alarm_boot_properties();
}