Skip to content

Commit

Permalink
integrated support for vtools
Browse files Browse the repository at this point in the history
  • Loading branch information
yc9559 committed Jul 27, 2019
1 parent 967c178 commit a8c7e31
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions common/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ MODDIR=${0%/*}

/vendor/bin/sh $MODDIR/system/vendor/bin/powercfg.sh
/vendor/bin/sh $MODDIR/system/vendor/bin/powercfg_once.sh

# support vtools
cp -af $MODDIR/vtools-powercfg.sh /data/powercfg.sh
18 changes: 18 additions & 0 deletions common/vtools-powercfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /vendor/bin/sh
# Perfd-opt https://github.com/yc9559/perfd-opt/
# Author: Matt Yang

# powercfg wrapper for com.omarea.vtools
# MAKE SURE THAT THE MAGISK MODULE "Perfd-opt" HAS BEEN INSTALLED

powercfg_path="/vendor/bin/powercfg.sh"

# suppress stderr
(

/vendor/bin/sh ${powercfg_path} $1

# suppress stderr
) 2>/dev/null

exit 0
5 changes: 3 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ print_modname() {
# Copy/extract your module files into $MODPATH in on_install.

on_install() {
# The following is the default implementation: extract $ZIPFILE/system to $MODPATH
# Extend/change the logic to whatever you want
# cp custom files in ./common
cp -af $TMPDIR/vtools-powercfg.sh $MODPATH/vtools-powercfg.sh

target=`getprop ro.board.platform`
ui_print "- The platform of this device is ${target}"

Expand Down
2 changes: 1 addition & 1 deletion profiles/sdm675_730/system/vendor/bin/powercfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ start_qti_perfd()
update_qti_perfd()
{
rm /data/vendor/perfd/default_values
cp ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
cp -af ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
}

# $1:key $return:value(string)
Expand Down
2 changes: 1 addition & 1 deletion profiles/sdm710/system/vendor/bin/powercfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ start_qti_perfd()
update_qti_perfd()
{
rm /data/vendor/perfd/default_values
cp ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
cp -af ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
}

# $1:key $return:value(string)
Expand Down
2 changes: 1 addition & 1 deletion profiles/sdm845/system/vendor/bin/powercfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ start_qti_perfd()
update_qti_perfd()
{
rm /data/vendor/perfd/default_values
cp ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
cp -af ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
}

# $1:key $return:value(string)
Expand Down
2 changes: 1 addition & 1 deletion profiles/sdm855/system/vendor/bin/powercfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ start_qti_perfd()
update_qti_perfd()
{
rm /data/vendor/perfd/default_values
cp ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
cp -af ${module_dir}/system/vendor/etc/perf/perfd_profiles/${1}/* ${module_dir}/system/vendor/etc/perf/
}

# $1:key $return:value(string)
Expand Down

0 comments on commit a8c7e31

Please sign in to comment.