Skip to content

Commit

Permalink
Fix charger only mode
Browse files Browse the repository at this point in the history
Change-Id: Iaffc5cebc3261a2909bfa4a300d4bcc17bf4a019
  • Loading branch information
BigMajster committed Jan 9, 2015
1 parent 59b894e commit fbc816a
Show file tree
Hide file tree
Showing 13 changed files with 1,352 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100

# Offmode Charging
COMMON_GLOBAL_CFLAGS += \
-DBOARD_CHARGING_CMDLINE_NAME='"androidboot.mode"' \
-DBOARD_CHARGING_CMDLINE_VALUE='"chargerlogo"'

# Enable dex-preoptimization to speed up first boot sequence
WITH_DEXPREOPT := true

Expand Down
54 changes: 54 additions & 0 deletions charger/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2011 The Android Open Source Project

ifneq ($(BUILD_TINY_ANDROID),true)

LOCAL_PATH := $(call my-dir)

define _add-w7-charger-image
include $$(CLEAR_VARS)
LOCAL_MODULE := device_w7_w7_charger_$(notdir $(1))
LOCAL_MODULE_STEM := $(notdir $(1))
_img_modules += $$(LOCAL_MODULE)
LOCAL_SRC_FILES := $1
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
include $$(BUILD_PREBUILT)
endef

_img_modules :=
_images :=
$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
$(eval $(call _add-w7-charger-image,$(_img))))

include $(CLEAR_VARS)
LOCAL_MODULE := charger_res_images_w7
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := $(_img_modules)
include $(BUILD_PHONY_PACKAGE)

_add-charger-image :=
_img_modules :=

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
charger.c

LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND

LOCAL_MODULE := charger_w7
LOCAL_MODULE_TAGS := optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
LOCAL_ADDITIONAL_DEPENDENCIES := charger_res_images_w7
LOCAL_C_INCLUDES := $(call project-path-for,recovery)

LOCAL_STATIC_LIBRARIES := libminui libpixelflinger_static libpng
LOCAL_STATIC_LIBRARIES += libsuspend
LOCAL_STATIC_LIBRARIES += libz libstdc++ libcutils liblog libm libc

include $(BUILD_EXECUTABLE)

endif
Loading

0 comments on commit fbc816a

Please sign in to comment.