Skip to content

Commit

Permalink
Merge pull request #33 from ryenyuku/master
Browse files Browse the repository at this point in the history
Add an option to enable dynamic FPS & Expose TranssionSettings to Itel devices
  • Loading branch information
phhusson authored May 12, 2024
2 parents 361c153 + 3559055 commit 9be6373
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/me/phh/treble/app/Misc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ object Misc: EntryStartup {
|| (thisMode.getPhysicalHeight() != lastMode.getPhysicalHeight()))
}
}
MiscSettings.dynamicFps -> {
val value = sp.getBoolean(key, false)
SystemProperties.set("persist.sys.phh.dynamic_fps", if (value) "1" else "0")
}
MiscSettings.remotectl -> {
val value = sp.getBoolean(key, false)
SystemProperties.set("persist.sys.phh.remote", if (value) "true" else "false")
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/me/phh/treble/app/MiscSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.preference.Preference
object MiscSettings : Settings {
val mobileSignal = "key_misc_mobile_signal"
val displayFps = "key_misc_display_fps"
val dynamicFps = "key_misc_dynamic_fps"
val maxAspectRatioPreO = "key_misc_max_aspect_ratio_pre_o"
val multiCameras = "key_misc_multi_camera"
val forceCamera2APIHAL3 = "key_misc_force_camera2api_hal3"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/me/phh/treble/app/TranssionSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ object TranssionSettings : Settings {
val dt2w = "key_transsion_dt2w"

override fun enabled() = Tools.vendorFp.startsWith("Infinix/") || Tools.vendorFp.startsWith("TECNO/")
|| Tools.vendorFp.startsWith("Itel/")
}

class TranssionSettingsFragment : SettingsFragment() {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/pref_misc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
android:entryValues="@array/pref_misc_display_fps_values"
android:key="key_misc_display_fps"
android:title="Force FPS" />
<SwitchPreference
android:defaultValue="false"
android:key="key_misc_dynamic_fps"
android:title="Dynamic FPS"
android:summary="Adjust refresh rate depending on the content on screen\nRequires reboot"/>
<Preference
android:key="key_misc_restart_systemui"
android:title="Restart SystemUI"
Expand Down

0 comments on commit 9be6373

Please sign in to comment.