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

Verified Commit 128ca58b authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

EN: Handle callback exceptions for newest methods

parent 5b5f21d2
Loading
Loading
Loading
Loading
+30 −6
Original line number Diff line number Diff line
@@ -465,7 +465,11 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
                }.toString())
            }

            try {
                params.callback.onResult(Status.SUCCESS, response)
            } catch (e: Exception) {
                Log.w(TAG, "Callback failed", e)
            }
        }
    }

@@ -512,7 +516,11 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
                }.toString())
            }

            try {
                params.callback.onResult(Status.SUCCESS, response)
            } catch (e: Exception) {
                Log.w(TAG, "Callback failed", e)
            }
        }
    }

@@ -522,7 +530,11 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
                database.storeConfiguration(packageName, TOKEN_A, params.mapping)
                database.noteAppAction(packageName, "setDiagnosisKeysDataMapping")
            }
            try {
                params.callback.onResult(Status.SUCCESS)
            } catch (e: Exception) {
                Log.w(TAG, "Callback failed", e)
            }
        }
    }

@@ -533,7 +545,11 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
                database.noteAppAction(packageName, "getDiagnosisKeysDataMapping")
                triple?.third
            }
            try {
                params.callback.onResult(Status.SUCCESS, mapping.orDefault())
            } catch (e: Exception) {
                Log.w(TAG, "Callback failed", e)
            }
        }
    }

@@ -543,7 +559,11 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
            ExposureDatabase.with(context) { database ->
                database.noteAppAction(packageName, "getPackageConfiguration")
            }
            try {
                params.callback.onResult(Status.SUCCESS, PackageConfiguration.PackageConfigurationBuilder().setValues(Bundle.EMPTY).build())
            } catch (e: Exception) {
                Log.w(TAG, "Callback failed", e)
            }
        }
    }

@@ -553,7 +573,11 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
            ExposureDatabase.with(context) { database ->
                database.noteAppAction(packageName, "getStatus")
            }
            try {
                params.callback.onResult(Status.SUCCESS, ExposureNotificationStatus.setToFlags(setOf(ExposureNotificationStatus.UNKNOWN)))
            } catch (e: Exception) {
                Log.w(TAG, "Callback failed", e)
            }
        }
    }