Skip to content

Commit 3c42b22

Browse files
Kra1o5Daz Jones
Kra1o5
authored and
Daz Jones
committed
More battery life
Conflicts: power/Android.mk power/power.c ramdisk/init.huawei.rc
1 parent bf09fbf commit 3c42b22

File tree

4 files changed

+47
-281
lines changed

4 files changed

+47
-281
lines changed

device.mk

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ PRODUCT_PACKAGES += \
4040

4141
# Other HALs
4242
PRODUCT_PACKAGES += \
43-
power.msm7x27a \
4443
gps.u8815 \
4544
lights.u8815
4645

power/Android.mk

-27
This file was deleted.

power/power.c

-239
This file was deleted.

ramdisk/init.huawei.rc

+47-14
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,54 @@ on boot
105105
chown system system /sys/devices/platform/msm_hsusb/gadget/switchusb
106106
chown system system /sys/devices/platform/msm_hsusb/gadget/fixusb
107107

108-
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
109-
chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
110-
chmod 0666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
111-
chmod 0666 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
112-
108+
# Memory management. Basic kernel parameters, and allow the high
109+
# level system server to be able to adjust the kernel OOM driver
110+
# parameters to match how it is managing things.
111+
write /proc/sys/vm/overcommit_memory 1
112+
write /proc/sys/vm/min_free_order_shift 4
113+
chown root system /sys/module/lowmemorykiller/parameters/adj
114+
chmod 0664 /sys/module/lowmemorykiller/parameters/adj
115+
chown root system /sys/module/lowmemorykiller/parameters/minfree
116+
chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
117+
118+
# Tweak background writeout
119+
write /proc/sys/vm/dirty_expire_centisecs 200
120+
write /proc/sys/vm/dirty_background_ratio 5
121+
122+
# Permissions for System Server and daemons.
123+
chown radio system /sys/android_power/state
124+
chown radio system /sys/android_power/request_state
125+
chown radio system /sys/android_power/acquire_full_wake_lock
126+
chown radio system /sys/android_power/acquire_partial_wake_lock
127+
chown radio system /sys/android_power/release_wake_lock
128+
chown system system /sys/power/state
129+
chown system system /sys/power/autosleep
130+
chown system system /sys/power/wakeup_count
131+
chown radio system /sys/power/wake_lock
132+
chown radio system /sys/power/wake_unlock
133+
chmod 0660 /sys/power/state
134+
chmod 0660 /sys/power/wake_lock
135+
chmod 0660 /sys/power/wake_unlock
136+
137+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/timer_rate
138+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/timer_rate
139+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/min_sample_time
140+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/min_sample_time
141+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/hispeed_freq
142+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/hispeed_freq
143+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/go_hispeed_load
144+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/go_hispeed_load
145+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/above_hispeed_delay
146+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/above_hispeed_delay
147+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/boost
148+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/boost
113149
chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
114-
chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
115-
chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
116-
chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
117-
chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
118-
chmod 0666 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
119-
chmod 0666 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
120-
chmod 0666 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
121-
chmod 0666 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
122-
chmod 0666 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
150+
chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
151+
chmod 0660 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
152+
153+
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
154+
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
155+
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
123156

124157
on emmc-fs
125158
# mount mmc partitions

0 commit comments

Comments
 (0)