3cf39adf81
Change-Id: I725a139830511bf343df2efe238c3a20dd5c235a
32 lines
651 B
Bash
Executable File
32 lines
651 B
Bash
Executable File
#!/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.compcache` == 1 ];
|
|
then
|
|
PROP=`getprop ro.compcache.default`
|
|
setprop persist.service.compcache $PROP
|
|
fi
|
|
|
|
if [ -e /data/property/persist.service.compcache ];
|
|
then
|
|
PROP=`getprop persist.service.compcache`
|
|
else
|
|
PROP=`getprop ro.compcache.default`
|
|
setprop persist.service.compcache $PROP
|
|
fi
|
|
|
|
if [ $PROP != 0 ]
|
|
then
|
|
CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100 * 1024))
|
|
`dirname $0`/compcache start $CCSIZE
|
|
else
|
|
`dirname $0`/compcache stop
|
|
fi
|
|
|
|
exit 0
|
|
|