@@ -142,25 +142,21 @@ class SubscriptionModer(
142142 private fun overrideConfigDirectly (bundle : Bundle ? ) {
143143 val iCclInstance = this .loadCachedInterface { carrierConfigLoader }
144144 val args = bundle?.let (::toPersistableBundle)
145- var securityException: SecurityException ? = null
146- var noSuchMethodError: NoSuchMethodError ? = null
147145
148146 try {
149- return iCclInstance.overrideConfig(subscriptionId, args, overrideConfigPersistent)
150- } catch (e: SecurityException ) {
151- securityException = e
147+ iCclInstance.overrideConfig(subscriptionId, args, overrideConfigPersistent)
152148 } catch (e: NoSuchMethodError ) {
153- noSuchMethodError = e
149+ val overrideConfigMethod =
150+ iCclInstance.javaClass.getMethod(
151+ " overrideConfig" ,
152+ Int ::class .javaPrimitiveType,
153+ PersistableBundle ::class .java,
154+ )
155+ overrideConfigMethod.invoke(iCclInstance, subscriptionId, args)
156+ if (overrideConfigPersistent) {
157+ throw e
158+ }
154159 }
155-
156- val overrideConfigMethod =
157- iCclInstance.javaClass.getMethod(
158- " overrideConfig" ,
159- Int ::class .javaPrimitiveType,
160- PersistableBundle ::class .java,
161- )
162- overrideConfigMethod.invoke(iCclInstance, subscriptionId, args)
163- throw securityException ? : noSuchMethodError!!
164160 }
165161
166162 private fun overrideConfigUsingBroker (bundle : Bundle ? ) {
@@ -291,7 +287,6 @@ class SubscriptionModer(
291287 } catch (e: NoSuchMethodError ) {
292288 telephony.disableIms(sub.getSlotIndex(this .subscriptionId))
293289 telephony.enableIms(sub.getSlotIndex(this .subscriptionId))
294- throw e
295290 }
296291 }
297292
0 commit comments