From 29bd4e0aff58702938db421bf173307270cc5e07 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sat, 5 May 2018 19:04:50 +0300 Subject: [PATCH] whyred: init: Cleanup and fix code style Change-Id: Ice339617a0fb4555b5f37f42084ceaf98535bd24 --- init/Android.mk | 7 ++++--- init/init_sagit.cpp | 22 ++++++++-------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/init/Android.mk b/init/Android.mk index 11553cf..5f5077f 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -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) diff --git a/init/init_sagit.cpp b/init/init_sagit.cpp index 5789162..d0243c8 100644 --- a/init/init_sagit.cpp +++ b/init/init_sagit.cpp @@ -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 -#include +#include #include #include @@ -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(); }