Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a860e150 authored by Dominique Martinet's avatar Dominique Martinet
Browse files

update ims to 81b1c8640b8723474a8831ffe5c99fd1f77671af

parent 11f136d5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -44,8 +44,7 @@ PRODUCT_PACKAGES += \
    PrivacyCentral \
    WeatherProvider \
    SplitInstallService \
    PhhIms \
    PhhImsOverlay
    PhhIms

# Optional applications
MINIMAL_APPS ?= false
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ android_app {
      "com.google.android.material_material",
      "kotlinx-coroutines-android",
    ],
    required: ["PhhImsOverlay"],
}

runtime_resource_overlay {
+16 −14
Original line number Diff line number Diff line
@@ -6,36 +6,38 @@ import android.telephony.ims.RcsClientConfiguration
import android.telephony.ims.stub.ImsConfigImplBase

class PhhImsConfig() : ImsConfigImplBase() {
    companion object {
        val TAG = "PHH ImsConfig"
    }

    val intMap = HashMap<Int, Int>()
    val strMap = HashMap<Int, String>()

    override fun setConfig(item: Int, value: Int): /*SetConfigResult*/ Int {
        Rlog.d("PHH", "PhhImsConfig setConfig $item $value")
    override @SetConfigResult fun setConfig(item: Int, value: Int): Int {
        Rlog.d(TAG, "setConfig $item $value")
        intMap.put(item, value)
        return ImsConfigImplBase.CONFIG_RESULT_SUCCESS
    }
    override fun setConfig(item: Int, value: String): /*SetConfigResult*/ Int {
        Rlog.d("PHH", "PhhImsConfig setConfig $item $value")
    override @SetConfigResult fun setConfig(item: Int, value: String): Int {
        Rlog.d(TAG, "setConfig $item $value")
        strMap.put(item, value)
        return ImsConfigImplBase.CONFIG_RESULT_SUCCESS
    }
    override fun getConfigInt(item: Int): Int {
        Rlog.d("PHH", "PhhImsConfig getConfigInt $item")
        // XXX throw RemoteException
        return intMap.get(item)!!
        Rlog.d(TAG, "getConfigInt $item")
        return intMap.get(item) ?: ImsConfigImplBase.CONFIG_RESULT_UNKNOWN
    }
    override fun getConfigString(item: Int): String {
        Rlog.d("PHH", "PhhImsConfig getConfigString $item")
        // XXX throw RemoteException
        return strMap.get(item)!!
    override fun getConfigString(item: Int): String? {
        Rlog.d(TAG, "getConfigString $item")
        return strMap.get(item)
    }
    override fun updateImsCarrierConfigs(bundle: PersistableBundle) {
        Rlog.d("PHH", "PhhImsConfig updateImsCarrierConfigs")
        Rlog.d(TAG, "updateImsCarrierConfigs")
    }
    override fun setRcsClientConfiguration(rcc: RcsClientConfiguration) {
        Rlog.d("PHH", "PhhImsConfig setRcsClientConfiguration")
        Rlog.d(TAG, "setRcsClientConfiguration")
    }
    override fun triggerAutoConfiguration() {
        Rlog.d("PHH", "PhhImsConfig triggerAutoConfiguration")
        Rlog.d(TAG, "triggerAutoConfiguration")
    }
}
+18 −14
Original line number Diff line number Diff line
@@ -12,20 +12,29 @@ import android.telephony.ims.stub.ImsConfigImplBase
import android.telephony.ims.stub.ImsRegistrationImplBase

class PhhImsBroadcastReceiver : BroadcastReceiver() {
    companion object {
        val TAG = "Phh ImsBroadcastReceiver"
    }

    override fun onReceive(ctxt: Context, intent: Intent) {
        Rlog.d("PHH", "PhhImsBroadcastReceiver onReceive")
        Rlog.d(TAG, "onReceive")
    }
}

class PhhImsService : ImsService() {
    companion object {
        val TAG = "PHH ImsService"
        var instance: PhhImsService? = null
    }

    override fun onCreate() {
        Rlog.d("PHH", "ImsService onCreate")
        Rlog.d(TAG, "onCreate")
    }

    // XXX one per slot id...
    var mmTelFeature: PhhMmTelFeature? = null
    override fun createMmTelFeature(slotId: Int): MmTelFeature {
        Rlog.d("PHH", "ImsService createMmTelFeature")
        Rlog.d(TAG, "createMmTelFeature")
        var feature = mmTelFeature
        if (feature == null) {
            feature = PhhMmTelFeature(slotId)
@@ -34,14 +43,14 @@ class PhhImsService : ImsService() {
        return feature
    }
    override fun createRcsFeature(slotId: Int): RcsFeature? {
        Rlog.d("PHH", "ImsService createRcsFeature")
        Rlog.d(TAG, "createRcsFeature")
        return null
    }

    val config = PhhImsConfig()

    override fun getConfig(slotId: Int): ImsConfigImplBase {
        Rlog.d("PHH", "ImsService getConfig")
        Rlog.d(TAG, "getConfig")
        return config
    }

@@ -49,7 +58,7 @@ class PhhImsService : ImsService() {

    class LocalBinder : Binder() {
        fun getService(): PhhImsService {
            Rlog.d("PHH", "ImsService LocalBinder getService")
            Rlog.d(TAG, "LocalBinder getService")
            return PhhImsService()
        }
    }
@@ -57,25 +66,20 @@ class PhhImsService : ImsService() {
    // XXX cache one per slot id
    val imsRegistration = ImsRegistrationImplBase()
    override fun getRegistration(slotId: Int): ImsRegistrationImplBase {
        Rlog.d("PHH", "ImsService getRegistration $slotId")
        Rlog.d(TAG, "getRegistration $slotId")
        return imsRegistration
    }

    override fun onDestroy() {
        Rlog.d("PHH", "ImsService onDestroy")
        Rlog.d(TAG, "onDestroy")
        instance = null
    }

    override fun readyForFeatureCreation() {
        Rlog.d("PHH", "ImsService readyForFeatureCreation")
        Rlog.d(TAG, "readyForFeatureCreation")
        if (instance != null && instance !== this) {
            throw RuntimeException()
        }
        instance = this
    }

    companion object {
        var instance: PhhImsService? = null
        // const val tag = "PhhImsService"
    }
}
+8 −4
Original line number Diff line number Diff line
@@ -8,6 +8,10 @@ import me.phh.sip.SipHandler
// handle sms from device to ims
// frameworks/base/telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java
class PhhImsSms(val slotId: Int) : ImsSmsImplBase() {
    companion object {
        val TAG = "Phh ImsSms"
    }

    lateinit var sipHandler: SipHandler

    // phone -> outside API
@@ -21,7 +25,7 @@ class PhhImsSms(val slotId: Int) : ImsSmsImplBase() {
    ) {
        val content = String(pdu)
        // called when android tries to send a sms?
        Rlog.d("PHH", "ImsSms $slotId sendSms $token, $messageRef, $format, $smsc, $content")
        Rlog.d(TAG, "$slotId sendSms $token, $messageRef, $format, $smsc, $content")
        if (::sipHandler.isInitialized == false) {
            onSendSmsResultError(
                token,
@@ -52,15 +56,15 @@ class PhhImsSms(val slotId: Int) : ImsSmsImplBase() {
    }
    override fun acknowledgeSms(token: Int, messageRef: Int, result: Int) {
        // called when android acks a received sms?
        Rlog.d("PHH", "ImsSms $slotId acknowledgeSms $token, $messageRef, $result")
        Rlog.d(TAG, "$slotId acknowledgeSms $token, $messageRef, $result")
    }
    override fun acknowledgeSmsReport(token: Int, messageRef: Int, result: Int) {
        // called when android acks onSmsStatusReportReceived?
        Rlog.d("PHH", "ImsSms $slotId acknowledgeSmsReport $token, $messageRef, $result")
        Rlog.d(TAG, "$slotId acknowledgeSmsReport $token, $messageRef, $result")
    }
    override fun onReady() {
        // should not do anything before this is called
        Rlog.d("PHH", "ImsSms $slotId onReady")
        Rlog.d(TAG, "$slotId onReady")
    }
    // outside -> phone API
    // on message received from ims call onSmsReceived(token, format, pdu)
Loading