Skip to content

Commit

Permalink
Support MTK AIDL IMS on Android 14
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyCGYan committed Jun 1, 2024
1 parent 282ef75 commit 1c4cbd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/me/phh/treble/app/Ims.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ object Ims: EntryStartup {
.find { i -> mHidlService.get("vendor.mediatek.hardware.mtkradioex@2.0::IMtkRadioEx", i) != null } != null
val gotMtkS = mAllSlots
.find { i -> mHidlService.get("vendor.mediatek.hardware.mtkradioex@3.0::IMtkRadioEx", i) != null } != null
val gotMtkAidl = mAllSlots
.find { i -> ServiceManager.getService("vendor.mediatek.hardware.mtkradioex.ims.IMtkRadioExIms/" + i) != null } != null
val gotQcomHidl = mAllSlots
.find { i -> mHidlService.get("vendor.qti.hardware.radio.ims@1.0::IImsRadio", i) != null } != null
val gotQcomHidlMoto = gotQcomHidl
Expand All @@ -95,7 +97,7 @@ object Ims: EntryStartup {
val allOverlays = listOf("me.phh.treble.overlay.mtkims_telephony", "me.phh.treble.overlay.cafims_telephony", "me.phh.treble.overlay.hwims_telephony")
val selectOverlay = when {
gotFloss -> "me.phh.treble.overlay.flossims_telephony"
gotMtkP || gotMtkQ || gotMtkR || gotMtkS -> "me.phh.treble.overlay.mtkims_telephony"
gotMtkP || gotMtkQ || gotMtkR || gotMtkS || gotMtkAidl -> "me.phh.treble.overlay.mtkims_telephony"
gotQcomHidl || gotQcomAidl -> "me.phh.treble.overlay.cafims_telephony"
gotSLSI -> "me.phh.treble.overlay.slsiims_telephony"
gotSPRD -> "me.phh.treble.overlay.sprdims_telephony"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/me/phh/treble/app/ImsSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ class ImsSettingsFragment : SettingsFragment() {
Log.d("PHH", "MTK Q radio = ${Ims.gotMtkQ}")
Log.d("PHH", "MTK R radio = ${Ims.gotMtkR}")
Log.d("PHH", "MTK S radio = ${Ims.gotMtkS}")
Log.d("PHH", "MTK AIDL radio = ${Ims.gotMtkAidl}")
Log.d("PHH", "Qualcomm HIDL radio = ${Ims.gotQcomHidl}")
Log.d("PHH", "Qualcomm AIDL radio = ${Ims.gotQcomAidl}")

val (url, message) =
when {
(Ims.gotMtkR || Ims.gotMtkS || Ims.gotMtkAidl) && Build.VERSION.SDK_INT >= 34
-> Pair("https://treble.phh.me/ims-mtk-u.apk", "MediaTek R+ vendor")
Ims.gotMtkP -> Pair("https://treble.phh.me/stable/ims-mtk-p.apk", "MediaTek P vendor")
Ims.gotMtkQ -> Pair("https://treble.phh.me/stable/ims-mtk-q.apk", "MediaTek Q vendor")
Ims.gotMtkR -> Pair("https://treble.phh.me/stable/ims-mtk-r.apk", "MediaTek R vendor")
Expand Down

0 comments on commit 1c4cbd2

Please sign in to comment.