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

Commit c7c3ef4a authored by Chris Antol's avatar Chris Antol
Browse files

Skip failing PreferenceScreens in DeviceState

Log errors, but continue to construct

Bug: N/A
Test: N/A
Flag: com.android.settings.flags.device_state
Change-Id: Ic3acfebc5c986713dc9a93ce21ddfb29d0a86f0a
parent 46dcfcf8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -108,7 +108,14 @@ class DeviceStateAppFunctionService : AppFunctionService() {
        val perScreenDeviceStatesList: MutableList<PerScreenDeviceStates> = ArrayList()
        coroutineScope {
            val deferredList = screenKeyList.map { screenKey ->
                async { buildPerScreenDeviceStates(screenKey, requestCategory) }
                async {
                    try {
                        buildPerScreenDeviceStates(screenKey, requestCategory)
                    } catch (e: Exception) {
                        Log.e(TAG, "error building $screenKey", e)
                        null
                    }
                }
            }
            deferredList.awaitAll().forEach {
                if (it != null) {