@@ -9,11 +9,15 @@ import android.os.Build
99import android.os.Build.VERSION_CODES
1010import android.os.Bundle
1111import android.os.IInterface
12+ import android.os.PersistableBundle
1213import android.telephony.CarrierConfigManager
1314import android.telephony.SubscriptionInfo
1415import android.telephony.TelephonyFrameworkInitializer
1516import android.util.Log
1617import androidx.annotation.RequiresApi
18+ import androidx.compose.runtime.getValue
19+ import androidx.compose.runtime.mutableStateOf
20+ import androidx.compose.runtime.setValue
1721import com.android.internal.telephony.ICarrierConfigLoader
1822import com.android.internal.telephony.IPhoneSubInfo
1923import com.android.internal.telephony.ISub
@@ -27,6 +31,8 @@ object InterfaceCache {
2731 val cache = HashMap <String , IInterface >()
2832}
2933
34+ var overrideConfigPersistent by mutableStateOf(true )
35+
3036open class Moder {
3137 @Suppress(" ktlint:standard:property-naming" )
3238 val KEY_IMS_USER_AGENT = " ims.ims_user_agent_string"
@@ -140,22 +146,13 @@ class SubscriptionModer(
140146 var noSuchMethodError: NoSuchMethodError ? = null
141147
142148 try {
143- return iCclInstance.overrideConfig(subscriptionId, args, true )
149+ return iCclInstance.overrideConfig(subscriptionId, args, overrideConfigPersistent )
144150 } catch (e: SecurityException ) {
145151 securityException = e
146152 } catch (e: NoSuchMethodError ) {
147153 noSuchMethodError = e
148154 }
149155
150- try {
151- iCclInstance.overrideConfig(subscriptionId, args, false )
152- throw securityException ? : noSuchMethodError!!
153- } catch (e: SecurityException ) {
154- securityException = securityException ? : e
155- } catch (e: NoSuchMethodError ) {
156- noSuchMethodError = noSuchMethodError ? : e
157- }
158-
159156 val overrideConfigMethod =
160157 iCclInstance.javaClass.getMethod(
161158 " overrideConfig" ,
0 commit comments