Giter VIP home page Giter VIP logo

android_system_core_bettercharger's Introduction

HOW TO PREPARE IT

In case of Samsung devices using CM11:

  • Requires edit "CM11/android/device/samsung/smdk4412-common/BoardCommonConfig.mk" adding:

    ... #Charging mode BOARD_CHARGING_MODE_BOOTING_LPM := /sys/class/power_supply/battery/batt_lp_charging BOARD_BATTERY_DEVICE_NAME := "battery" BOARD_ALLOW_SUSPEND_IN_CHARGER := true BOARD_SAMSUNG_DEVICE := true BOARD_IMAGES_ON_SYSTEM := true FORCE_REBOOT_WHEN_FULL := true ...

  • Requires edit "CM11/android/device/samsung/smdk4412-common/common.mk" adding/replacing:

    ... #Charger PRODUCT_PACKAGES +=
    bettercharger
    bettercharger_res_images ...

    NOTE: By default CM not use "charger" for Samsung devices, it use private binary blobs playlpm

  • Requires edit "CM11/android/device/samsung/i9300/BoardConfig.mk" adding/replacing:

    ... #Charging mode BOARD_CHARGER_RES := device/samsung/i9300/bettercharger/images ...

  • Create folders "bettercharger/images" on "CM11/android/device/samsung/i9300/"

NOTE: We don't modify lpm.rc because all prior ROMs use private playlpm binary, and we use the same path for this reason.

HOW TO COMPILE IT

By default charger is integrated on recovery for Nexus devices, maybe its required compile it the first time:

THREADS=1
croot
time make recoveryimage showcommands -j${THREADS}

And the rest compilations, you can only compile bettercharger:

THREADS=1
cd ~/CM11/android
source build/envsetup.sh
breakfast i9300
export USE_CCACHE=1
cd system/core/bettercharger/
time mm

The compiled output must be in: ~/CM11android/out/target/product/i9300/root/system/bettercharger Using the same structure that goes to internal memory

But for correct execution we need to replace the original binary "/system/bin/playlpm" with a script like this:

#!/system/bin/sh
mkdir -p /res/images
/system/bettercharger/bettercharger

The "mkdir" line is a "workaround" because ower binary expects to find this folder in recovery, but we don't use this folder.

android_system_core_bettercharger's People

Contributors

shawe avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.