replicant-vendor_replicant/prebuilt/common/bin/handle_compcache

32 lines
609 B
Plaintext
Raw Normal View History

#!/system/bin/sh
#
# Compcache handler
# Decides whether or not Compcache is enabled
#
MEMTOTAL=$( awk '{ if ($1 eq "MemTotal:") print $2 ;exit }' </proc/meminfo )
if [ `getprop persist.service.zram` == 1 ];
then
PROP=`getprop ro.zram.default`
setprop persist.service.zram $PROP
fi
if [ -e /data/property/persist.service.zram ];
2010-08-20 17:42:40 +00:00
then
PROP=`getprop persist.service.zram`
2010-08-20 17:42:40 +00:00
else
PROP=`getprop ro.zram.default`
setprop persist.service.zram $PROP
2010-08-20 17:42:40 +00:00
fi
if [ $PROP != 0 ]
then
CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
`dirname $0`/compcache start $CCSIZE
else
`dirname $0`/compcache stop
fi
exit 0