ui: Fix frame drops by calling isMEP in the IO context
All checks were successful
/ build-debug (push) Successful in 4m10s
All checks were successful
/ build-debug (push) Successful in 4m10s
For whatever reason, UiccCardInfo.isMultipleEnabledProfilesSupported() can be slow only on some SIM slots.
This commit is contained in:
parent
960fa6743a
commit
9c7cf2c797
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,8 @@ import android.widget.Button
|
|||
import android.widget.PopupMenu
|
||||
import im.angry.openeuicc.R
|
||||
import im.angry.openeuicc.util.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import net.typeblog.lpac_jni.LocalProfileInfo
|
||||
|
||||
class PrivilegedEuiccManagementFragment: EuiccManagementFragment() {
|
||||
|
@ -15,7 +17,9 @@ class PrivilegedEuiccManagementFragment: EuiccManagementFragment() {
|
|||
}
|
||||
|
||||
override suspend fun onCreateFooterViews(parent: ViewGroup): List<View> =
|
||||
if (channel.isMEP) {
|
||||
// isMEP can map to a slow operation (UiccCardInfo.isMultipleEnabledProfilesSupported())
|
||||
// so let's do it in the IO context
|
||||
if (withContext(Dispatchers.IO) { channel.isMEP }) {
|
||||
val view = layoutInflater.inflate(R.layout.footer_mep, parent, false)
|
||||
view.requireViewById<Button>(R.id.footer_mep_slot_mapping).setOnClickListener {
|
||||
(requireActivity() as PrivilegedMainActivity).showSlotMappingFragment()
|
||||
|
|
Loading…
Reference in a new issue