mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Force use of system settings to configure notifications on SDK30+.
This commit is contained in:
committed by
Alex Hart
parent
68ba3433a3
commit
06a49b5d5a
@@ -233,7 +233,7 @@ public class NotificationChannels {
|
||||
/**
|
||||
* Navigates the user to the system settings for the desired notification channel.
|
||||
*/
|
||||
public static void openChannelSettings(@NonNull Context context, @NonNull String channelId) {
|
||||
public static void openChannelSettings(@NonNull Context context, @NonNull String channelId, @Nullable String conversationId) {
|
||||
if (!supported()) {
|
||||
return;
|
||||
}
|
||||
@@ -242,6 +242,9 @@ public class NotificationChannels {
|
||||
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
|
||||
intent.putExtra(Settings.EXTRA_CHANNEL_ID, channelId);
|
||||
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
||||
if (conversationId != null && Build.VERSION.SDK_INT >= CONVERSATION_SUPPORT_VERSION) {
|
||||
intent.putExtra(Settings.EXTRA_CONVERSATION_ID, conversationId);
|
||||
}
|
||||
context.startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.w(TAG, "Channel settings activity not found", e);
|
||||
|
||||
Reference in New Issue
Block a user