stuartore / device_xiaomi_psyche

Device tree of Xiaomi 12X(psyche) - Auto bringup ability
https://gitlab.com/stuartore
7 stars 2 forks source link

[Volte] Both Volte & VoNR not works #1

Open stuartore opened 1 year ago

stuartore commented 1 year ago

As title

stuartore commented 1 year ago

It's maybe something about CarrierConfig in overlay and it seems IMS.apk need to be patched

stuartore commented 1 year ago

overlay reference

stuartore commented 1 year ago

Some commits (https://github.com/masemoel/device_xiaomi_picasso/commit/77b867ca9edf7fb9ec399aa0f747070d1e40ca26) discard force enable Volte.

stuartore commented 1 year ago

It seems that CarrierConfig was added but CarrierConfig in overlay was not configured in device.mk

stuartore commented 1 year ago

Fixed by refferring to https://github.com/VoidUI-Devices/device_xiaomi_sm8250-common/commit/d7cb8df03a1852a9c0c2dd8b3f4ab9a0cb364a6e to patch ims.apk

diff -git a/ims/AndroidManifest.xml b/ims/AndroidManifest.xml
index 87865a1 .2bdb14e 100644
- a/ims/AndroidManifest.xml
+ b/ims/AndroidManifest.xml
@@ -27,7 +27,6 @@
 <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
 <permission android:name="com.qti.permission.DIAG" android:protectionLevel="signatureOrSystem"/>
 <permission android:name="com.qti.permission.AUDIO" android:protectionLevel="signatureOrSystem"/>
- <permission android:name="com.qti.permission.BIND_QTI_IMS_SERVICE" android:protectionLevel="signatureOrSystem"/>
 <permission android:name="com.qti.permission.RECEIVE_PRE_ALERTING_CALL_INFO" android:protectionLevel="signatureOrSystem"/>
 <permission android:name="com.qti.permission.RECEIVE_SMS_CALLBACK_MODE" android:protectionLevel="signatureOrSystem"/>
 <permission android:name="com.qti.permission.RECEIVE_MSIM_VOICE_CAPABILITY" android:protectionLevel="signatureOrSystem"/>
@@ -39,7 +38,7 @@
 <action android:name="android.telephony.ims.ImsService"/>
 /intent-filter>
 /service>
- <service android:enabled="true" android:exported="true" android:name=".QtiImsExtService" android:permission="com.qti.pe
+ <service android:enabled="true" android:exported="true" android:name=".QtiImsExtService" android:singleUser="true"/>
 <uses-library android:name="qti-telephony-hidl-wrapper"/>
 <uses-library android:name="qti-telephony-utils"/>
 <uses-library android:name="ims-ext-common"/>

diff -git a/ims/smali/org/codeaurora/ims/ImsServiceStateReceiver.smali b/ims/smali/org/codeaurora/ims/ImsServiceStateReceiver.sm
index e59671e .fb4721b 100644
- a/ims/smali/org/codeaurora/ims/ImsServiceStateReceiver.smali
+ b/ims/smali/org/codeaurora/ims/ImsServiceStateReceiver.smali
@@ -877,18 +877,7 @@
 .param p1, "isVideoCapable" # Z
 .param p2, "isVoiceCapable" # Z
- .line 68
- invoke-static {}, Landroid/telephony/TelephonyBaseUtilsStub;->isMiuiRom()Z
-
- move-result v0
-
- if-eqz v0, :cond_0
-
- .line 69
- return-void
-
 .line 72
- :cond_0
 new-instance v0, Ljava/lang/StringBuilder;
 invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()