INNER CODE UNIT · Kotlin
startBackgroundTasks
1812z/HyperIsland · android/app/src/main/kotlin/io/github/hyperisland/MainActivity.kt:126
private fun startBackgroundTasks(prefs: FlutterPrefsRepository) {
if (!backgroundTasksStarted.compareAndSet(false, true)) return
Thread {
val xposedReady = XposedPrefsSyncApp.awaitReady()
if (xposedReady && prefs.getBoolean("pref_show_welcome", true)) {
TestNotificationService.sendWelcome(applicationContext)
}
}.start()
}
private fun openPrivacyPolicy() {
val language = resources.configuration.locales.get(0).language
val path = if (language.equals("zh", ignoreCase = true)) "privacy" else "en/privacy"
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("$PRIVACY_POLICY_BASE_URL/$path")))
}
private companion object {
const val PRIVACY_POLICY_BASE_URL = "https://hyperisland.1812z.top"