Remove dead code.

This commit is contained in:
Benoit Marty 2023-11-24 18:05:13 +01:00 committed by Benoit Marty
parent abddf3c3da
commit 3b6c92943c
2 changed files with 0 additions and 29 deletions

View file

@ -16,8 +16,6 @@
package io.element.android.libraries.androidutils.system
import android.annotation.TargetApi
import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
@ -104,19 +102,6 @@ fun Context.openAppSettingsPage(
}
}
/**
* Shows notification system settings for the given channel id.
*/
@TargetApi(Build.VERSION_CODES.O)
fun Activity.startNotificationChannelSettingsIntent(channelID: String) {
if (!supportNotificationChannels()) return
val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS).apply {
putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
putExtra(Settings.EXTRA_CHANNEL_ID, channelID)
}
startActivity(intent)
}
@RequiresApi(Build.VERSION_CODES.O)
fun Context.startInstallFromSourceIntent(
activityResultLauncher: ActivityResultLauncher<Intent>,

View file

@ -16,7 +16,6 @@
package io.element.android.libraries.push.impl.notifications.channels
import android.app.Activity
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
@ -24,7 +23,6 @@ import android.os.Build
import androidx.annotation.ChecksSdkIntAtLeast
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import io.element.android.libraries.androidutils.system.startNotificationChannelSettingsIntent
import io.element.android.libraries.di.AppScope
import io.element.android.libraries.di.ApplicationContext
import io.element.android.libraries.di.SingleIn
@ -163,17 +161,5 @@ class NotificationChannels @Inject constructor(
@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.O)
private fun supportNotificationChannels() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
fun openSystemSettingsForSilentCategory(activity: Activity) {
activity.startNotificationChannelSettingsIntent(SILENT_NOTIFICATION_CHANNEL_ID)
}
fun openSystemSettingsForNoisyCategory(activity: Activity) {
activity.startNotificationChannelSettingsIntent(NOISY_NOTIFICATION_CHANNEL_ID)
}
fun openSystemSettingsForCallCategory(activity: Activity) {
activity.startNotificationChannelSettingsIntent(CALL_NOTIFICATION_CHANNEL_ID)
}
}
}