Fix instrumentation tests by forcing channel id usage to init channels.

main
Cody Henthorne 2022-12-08 12:15:17 -05:00
rodzic 51015dc898
commit fb0aa55cbb
23 zmienionych plików z 49 dodań i 48 usunięć

Wyświetl plik

@ -73,6 +73,7 @@ class UsernameEditFragmentTest {
onView(withContentDescription(R.string.load_more_header__loading)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE))) onView(withContentDescription(R.string.load_more_header__loading)).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
} }
@Ignore("Flakey espresso test.")
@Test @Test
fun testUsernameCreationOutsideOfRegistration() { fun testUsernameCreationOutsideOfRegistration() {
val scenario = createScenario() val scenario = createScenario()

Wyświetl plik

@ -81,7 +81,7 @@ object MockProvider {
} }
kbsRepository.stub { kbsRepository.stub {
on { getToken(any() as String) } doReturn Single.just(ServiceResponse.forResult(tokenData, 200, "")) on { getToken(any() as? String) } doReturn Single.just(ServiceResponse.forResult(tokenData, 200, ""))
} }
val session: KeyBackupService.RestoreSession = object : KeyBackupService.RestoreSession { val session: KeyBackupService.RestoreSession = object : KeyBackupService.RestoreSession {

Wyświetl plik

@ -42,7 +42,7 @@ public enum BackupFileIOError {
public void postNotification(@NonNull Context context) { public void postNotification(@NonNull Context context) {
PendingIntent pendingIntent = PendingIntent.getActivity(context, -1, AppSettingsActivity.backups(context), PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(context, -1, AppSettingsActivity.backups(context), PendingIntentFlags.mutable());
Notification backupFailedNotification = new NotificationCompat.Builder(context, NotificationChannels.FAILURES) Notification backupFailedNotification = new NotificationCompat.Builder(context, NotificationChannels.getInstance().FAILURES)
.setSmallIcon(R.drawable.ic_signal_backup) .setSmallIcon(R.drawable.ic_signal_backup)
.setContentTitle(context.getString(titleId)) .setContentTitle(context.getString(titleId))
.setContentText(context.getString(messageId)) .setContentText(context.getString(messageId))

Wyświetl plik

@ -20,7 +20,7 @@ import org.thoughtcrime.securesms.notifications.NotificationIds
object DonationErrorNotifications { object DonationErrorNotifications {
fun displayErrorNotification(context: Context, donationError: DonationError) { fun displayErrorNotification(context: Context, donationError: DonationError) {
val parameters = DonationErrorParams.create(context, donationError, NotificationCallback) val parameters = DonationErrorParams.create(context, donationError, NotificationCallback)
val notification = NotificationCompat.Builder(context, NotificationChannels.FAILURES) val notification = NotificationCompat.Builder(context, NotificationChannels.getInstance().FAILURES)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setContentTitle(context.getString(parameters.title)) .setContentTitle(context.getString(parameters.title))
.setContentText(context.getString(parameters.message)).apply { .setContentText(context.getString(parameters.message)).apply {

Wyświetl plik

@ -40,7 +40,7 @@ class VoiceNoteNotificationManager {
{ {
this.context = context; this.context = context;
controller = new MediaControllerCompat(context, token); controller = new MediaControllerCompat(context, token);
notificationManager = new PlayerNotificationManager.Builder(context, NOW_PLAYING_NOTIFICATION_ID, NotificationChannels.VOICE_NOTES) notificationManager = new PlayerNotificationManager.Builder(context, NOW_PLAYING_NOTIFICATION_ID, NotificationChannels.getInstance().VOICE_NOTES)
.setChannelNameResourceId(R.string.NotificationChannel_voice_notes) .setChannelNameResourceId(R.string.NotificationChannel_voice_notes)
.setMediaDescriptionAdapter(new DescriptionAdapter()) .setMediaDescriptionAdapter(new DescriptionAdapter())
.setNotificationListener(listener) .setNotificationListener(listener)

Wyświetl plik

@ -31,7 +31,7 @@ public final class GroupCallSafetyNumberChangeNotificationUtil {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
Notification safetyNumberChangeNotification = new NotificationCompat.Builder(context, NotificationChannels.CALLS) Notification safetyNumberChangeNotification = new NotificationCompat.Builder(context, NotificationChannels.getInstance().CALLS)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setContentTitle(recipient.getDisplayName(context)) .setContentTitle(recipient.getDisplayName(context))
.setContentText(context.getString(R.string.GroupCallSafetyNumberChangeNotification__someone_has_joined_this_call_with_a_safety_number_that_has_changed)) .setContentText(context.getString(R.string.GroupCallSafetyNumberChangeNotification__someone_has_joined_this_call_with_a_safety_number_that_has_changed))

Wyświetl plik

@ -184,7 +184,7 @@ public final class EnableCallNotificationSettingsDialog extends DialogFragment {
} }
private void showNotificationChannelSettings() { private void showNotificationChannelSettings() {
NotificationChannels.getInstance().openChannelSettings(requireActivity(), NotificationChannels.CALLS, null); NotificationChannels.getInstance().openChannelSettings(requireActivity(), NotificationChannels.getInstance().CALLS, null);
} }
private void showAppSettings() { private void showAppSettings() {

Wyświetl plik

@ -85,7 +85,7 @@ public final class NewDeviceTransferSetupFragment extends DeviceTransferSetupFra
protected void startTransfer() { protected void startTransfer() {
PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, MainActivity.clearTop(requireContext()), PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, MainActivity.clearTop(requireContext()), PendingIntentFlags.mutable());
TransferNotificationData notificationData = new TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.BACKUPS, R.drawable.ic_signal_backup); TransferNotificationData notificationData = new TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.getInstance().BACKUPS, R.drawable.ic_signal_backup);
DeviceToDeviceTransferService.startServer(requireContext(), new NewDeviceServerTask(), notificationData, pendingIntent); DeviceToDeviceTransferService.startServer(requireContext(), new NewDeviceServerTask(), notificationData, pendingIntent);
} }
} }

Wyświetl plik

@ -58,7 +58,7 @@ public final class OldDeviceTransferSetupFragment extends DeviceTransferSetupFra
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, intent, PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, intent, PendingIntentFlags.mutable());
DeviceToDeviceTransferService.TransferNotificationData notificationData = new DeviceToDeviceTransferService.TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.BACKUPS, R.drawable.ic_signal_backup); DeviceToDeviceTransferService.TransferNotificationData notificationData = new DeviceToDeviceTransferService.TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.getInstance().BACKUPS, R.drawable.ic_signal_backup);
DeviceToDeviceTransferService.startClient(requireContext(), new OldDeviceClientTask(), notificationData, pendingIntent); DeviceToDeviceTransferService.startClient(requireContext(), new OldDeviceClientTask(), notificationData, pendingIntent);
} }

Wyświetl plik

@ -50,7 +50,7 @@ class SignalSmsExportService : SmsExportService() {
return ExportNotification( return ExportNotification(
NotificationIds.SMS_EXPORT_SERVICE, NotificationIds.SMS_EXPORT_SERVICE,
NotificationCompat.Builder(this, NotificationChannels.BACKUPS) NotificationCompat.Builder(this, NotificationChannels.getInstance().BACKUPS)
.setSmallIcon(R.drawable.ic_signal_backup) .setSmallIcon(R.drawable.ic_signal_backup)
.setContentTitle(getString(R.string.SignalSmsExportService__exporting_messages)) .setContentTitle(getString(R.string.SignalSmsExportService__exporting_messages))
.setContentIntent(pendingIntent) .setContentIntent(pendingIntent)
@ -73,7 +73,7 @@ class SignalSmsExportService : SmsExportService() {
return ExportNotification( return ExportNotification(
NotificationIds.SMS_EXPORT_COMPLETE, NotificationIds.SMS_EXPORT_COMPLETE,
NotificationCompat.Builder(this, NotificationChannels.APP_ALERTS) NotificationCompat.Builder(this, NotificationChannels.getInstance().APP_ALERTS)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setContentTitle(getString(R.string.SignalSmsExportService__signal_sms_export_complete)) .setContentTitle(getString(R.string.SignalSmsExportService__signal_sms_export_complete))
.setContentText(getString(R.string.SignalSmsExportService__tap_to_return_to_signal)) .setContentText(getString(R.string.SignalSmsExportService__tap_to_return_to_signal))

Wyświetl plik

@ -38,7 +38,7 @@ class FcmFetchForegroundService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
startForeground( startForeground(
NotificationIds.FCM_FETCH, NotificationIds.FCM_FETCH,
NotificationCompat.Builder(this, NotificationChannels.OTHER) NotificationCompat.Builder(this, NotificationChannels.getInstance().OTHER)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setContentTitle(getString(R.string.BackgroundMessageRetriever_checking_for_messages)) .setContentTitle(getString(R.string.BackgroundMessageRetriever_checking_for_messages))
.setCategory(NotificationCompat.CATEGORY_SERVICE) .setCategory(NotificationCompat.CATEGORY_SERVICE)

Wyświetl plik

@ -122,7 +122,7 @@ public class FcmRefreshJob extends BaseJob {
private void notifyFcmFailure() { private void notifyFcmFailure() {
Intent intent = new Intent(context, PlayServicesProblemActivity.class); Intent intent = new Intent(context, PlayServicesProblemActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntentFlags.cancelCurrent()); PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntentFlags.cancelCurrent());
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.FAILURES); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.getInstance().FAILURES);
builder.setSmallIcon(R.drawable.ic_notification); builder.setSmallIcon(R.drawable.ic_notification);
builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(),

Wyświetl plik

@ -96,7 +96,7 @@ public final class LocalBackupJob extends BaseJob {
ProgressUpdater updater = new ProgressUpdater(context.getString(R.string.LocalBackupJob_verifying_signal_backup)); ProgressUpdater updater = new ProgressUpdater(context.getString(R.string.LocalBackupJob_verifying_signal_backup));
try (NotificationController notification = GenericForegroundService.startForegroundTask(context, try (NotificationController notification = GenericForegroundService.startForegroundTask(context,
context.getString(R.string.LocalBackupJob_creating_signal_backup), context.getString(R.string.LocalBackupJob_creating_signal_backup),
NotificationChannels.BACKUPS, NotificationChannels.getInstance().BACKUPS,
R.drawable.ic_signal_backup)) R.drawable.ic_signal_backup))
{ {
updater.setNotification(notification); updater.setNotification(notification);

Wyświetl plik

@ -98,7 +98,7 @@ public final class LocalBackupJobApi29 extends BaseJob {
try { try {
notification = GenericForegroundService.startForegroundTask(context, notification = GenericForegroundService.startForegroundTask(context,
context.getString(R.string.LocalBackupJob_creating_signal_backup), context.getString(R.string.LocalBackupJob_creating_signal_backup),
NotificationChannels.BACKUPS, NotificationChannels.getInstance().BACKUPS,
R.drawable.ic_signal_backup); R.drawable.ic_signal_backup);
} catch (UnableToStartException e) { } catch (UnableToStartException e) {
Log.w(TAG, "Unable to start foreground backup service, continuing without service"); Log.w(TAG, "Unable to start foreground backup service, continuing without service");

Wyświetl plik

@ -299,7 +299,7 @@ public class IncomingMessageObserver {
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId); super.onStartCommand(intent, flags, startId);
NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), NotificationChannels.BACKGROUND); NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), NotificationChannels.getInstance().BACKGROUND);
builder.setContentTitle(getApplicationContext().getString(R.string.MessageRetrievalService_signal)); builder.setContentTitle(getApplicationContext().getString(R.string.MessageRetrievalService_signal));
builder.setContentText(getApplicationContext().getString(R.string.MessageRetrievalService_background_connection_enabled)); builder.setContentText(getApplicationContext().getString(R.string.MessageRetrievalService_background_connection_enabled));
builder.setPriority(NotificationCompat.PRIORITY_MIN); builder.setPriority(NotificationCompat.PRIORITY_MIN);

Wyświetl plik

@ -236,7 +236,7 @@ public final class MessageDecryptionUtil {
if (!FeatureFlags.internalUser()) return; if (!FeatureFlags.internalUser()) return;
NotificationManagerCompat.from(context).notify(NotificationIds.INTERNAL_ERROR, NotificationManagerCompat.from(context).notify(NotificationIds.INTERNAL_ERROR,
new NotificationCompat.Builder(context, NotificationChannels.FAILURES) new NotificationCompat.Builder(context, NotificationChannels.getInstance().FAILURES)
.setSmallIcon(R.drawable.ic_notification) .setSmallIcon(R.drawable.ic_notification)
.setContentTitle(context.getString(R.string.MessageDecryptionUtil_failed_to_decrypt_message)) .setContentTitle(context.getString(R.string.MessageDecryptionUtil_failed_to_decrypt_message))
.setContentText(context.getString(R.string.MessageDecryptionUtil_tap_to_send_a_debug_log)) .setContentText(context.getString(R.string.MessageDecryptionUtil_tap_to_send_a_debug_log))

Wyświetl plik

@ -66,17 +66,17 @@ public class NotificationChannels {
private static final String CONTACT_PREFIX = "contact_"; private static final String CONTACT_PREFIX = "contact_";
private static final String MESSAGES_PREFIX = "messages_"; private static final String MESSAGES_PREFIX = "messages_";
public static final String CALLS = "calls_v3"; public final String CALLS = "calls_v3";
public static final String FAILURES = "failures"; public final String FAILURES = "failures";
public static final String APP_UPDATES = "app_updates"; public final String APP_UPDATES = "app_updates";
public static final String BACKUPS = "backups_v2"; public final String BACKUPS = "backups_v2";
public static final String LOCKED_STATUS = "locked_status_v2"; public final String LOCKED_STATUS = "locked_status_v2";
public static final String OTHER = "other_v3"; public final String OTHER = "other_v3";
public static final String VOICE_NOTES = "voice_notes"; public final String VOICE_NOTES = "voice_notes";
public static final String JOIN_EVENTS = "join_events"; public final String JOIN_EVENTS = "join_events";
public static final String BACKGROUND = "background_connection"; public final String BACKGROUND = "background_connection";
public static final String CALL_STATUS = "call_status"; public final String CALL_STATUS = "call_status";
public static final String APP_ALERTS = "app_alerts"; public final String APP_ALERTS = "app_alerts";
private static volatile NotificationChannels instance; private static volatile NotificationChannels instance;
@ -658,7 +658,7 @@ public class NotificationChannels {
} }
@TargetApi(26) @TargetApi(26)
private static int getDefaultBackgroundChannelImportance(NotificationManager notificationManager) { private int getDefaultBackgroundChannelImportance(NotificationManager notificationManager) {
NotificationChannel existingOther = notificationManager.getNotificationChannel(OTHER); NotificationChannel existingOther = notificationManager.getNotificationChannel(OTHER);
if (existingOther != null && existingOther.getImportance() != NotificationManager.IMPORTANCE_LOW) { if (existingOther != null && existingOther.getImportance() != NotificationManager.IMPORTANCE_LOW) {

Wyświetl plik

@ -101,7 +101,7 @@ data class NotificationConversation(
fun getChannelId(context: Context): String { fun getChannelId(context: Context): String {
return if (isOnlyContactJoinedEvent) { return if (isOnlyContactJoinedEvent) {
NotificationChannels.JOIN_EVENTS NotificationChannels.getInstance().JOIN_EVENTS
} else { } else {
recipient.notificationChannel ?: NotificationChannels.getInstance().messagesChannel recipient.notificationChannel ?: NotificationChannels.getInstance().messagesChannel
} }

Wyświetl plik

@ -323,7 +323,7 @@ object NotificationFactory {
setContentIntent(NotificationPendingIntentHelper.getActivity(context, 0, intent, PendingIntentFlags.mutable())) setContentIntent(NotificationPendingIntentHelper.getActivity(context, 0, intent, PendingIntentFlags.mutable()))
setAutoCancel(true) setAutoCancel(true)
setAlarms(recipient) setAlarms(recipient)
setChannelId(NotificationChannels.FAILURES) setChannelId(NotificationChannels.getInstance().FAILURES)
} }
NotificationManagerCompat.from(context).safelyNotify(context, recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build()) NotificationManagerCompat.from(context).safelyNotify(context, recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build())
@ -353,7 +353,7 @@ object NotificationFactory {
setOnlyAlertOnce(true) setOnlyAlertOnce(true)
setAutoCancel(true) setAutoCancel(true)
setAlarms(recipient) setAlarms(recipient)
setChannelId(NotificationChannels.FAILURES) setChannelId(NotificationChannels.getInstance().FAILURES)
} }
NotificationManagerCompat.from(context).safelyNotify(context, recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build()) NotificationManagerCompat.from(context).safelyNotify(context, recipient, NotificationIds.getNotificationIdForMessageDeliveryFailed(thread), builder.build())

Wyświetl plik

@ -51,7 +51,7 @@ public final class GenericForegroundService extends Service {
private final LinkedHashMap<Integer, Entry> allActiveMessages = new LinkedHashMap<>(); private final LinkedHashMap<Integer, Entry> allActiveMessages = new LinkedHashMap<>();
private static final Entry DEFAULTS = new Entry("", NotificationChannels.OTHER, R.drawable.ic_notification, -1, 0, 0, false); private static final Entry DEFAULTS = new Entry("", NotificationChannels.getInstance().OTHER, R.drawable.ic_notification, -1, 0, 0, false);
private @Nullable Entry lastPosted; private @Nullable Entry lastPosted;

Wyświetl plik

@ -263,7 +263,7 @@ public class KeyCachingService extends Service {
} }
Log.i(TAG, "foregrounding KCS"); Log.i(TAG, "foregrounding KCS");
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NotificationChannels.LOCKED_STATUS); NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NotificationChannels.getInstance().LOCKED_STATUS);
builder.setContentTitle(getString(R.string.KeyCachingService_passphrase_cached)); builder.setContentTitle(getString(R.string.KeyCachingService_passphrase_cached));
builder.setContentText(getString(R.string.KeyCachingService_signal_passphrase_cached)); builder.setContentText(getString(R.string.KeyCachingService_signal_passphrase_cached));

Wyświetl plik

@ -64,7 +64,7 @@ public class UpdateApkReadyListener extends BroadcastReceiver {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntentFlags.mutable());
Notification notification = new NotificationCompat.Builder(context, NotificationChannels.APP_UPDATES) Notification notification = new NotificationCompat.Builder(context, NotificationChannels.getInstance().APP_UPDATES)
.setOngoing(true) .setOngoing(true)
.setContentTitle(context.getString(R.string.UpdateApkReadyListener_Signal_update)) .setContentTitle(context.getString(R.string.UpdateApkReadyListener_Signal_update))
.setContentText(context.getString(R.string.UpdateApkReadyListener_a_new_version_of_signal_is_available_tap_to_update)) .setContentText(context.getString(R.string.UpdateApkReadyListener_a_new_version_of_signal_is_available_tap_to_update))

Wyświetl plik

@ -90,12 +90,12 @@ public class CallNotificationBuilder {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp) return new NotificationCompat.Builder(context, NotificationChannels.getInstance().CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp)
.setContentIntent(pendingIntent) .setContentIntent(pendingIntent)
.setOngoing(true) .setOngoing(true)
.setContentTitle(context.getString(R.string.NotificationBarManager__starting_signal_call_service)) .setContentTitle(context.getString(R.string.NotificationBarManager__starting_signal_call_service))
.setPriority(NotificationCompat.PRIORITY_MIN) .setPriority(NotificationCompat.PRIORITY_MIN)
.build(); .build();
} }
public static @NonNull Notification getStoppingNotification(@NonNull Context context) { public static @NonNull Notification getStoppingNotification(@NonNull Context context) {
@ -104,12 +104,12 @@ public class CallNotificationBuilder {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable()); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp) return new NotificationCompat.Builder(context, NotificationChannels.getInstance().CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp)
.setContentIntent(pendingIntent) .setContentIntent(pendingIntent)
.setOngoing(true) .setOngoing(true)
.setContentTitle(context.getString(R.string.NotificationBarManager__stopping_signal_call_service)) .setContentTitle(context.getString(R.string.NotificationBarManager__stopping_signal_call_service))
.setPriority(NotificationCompat.PRIORITY_MIN) .setPriority(NotificationCompat.PRIORITY_MIN)
.build(); .build();
} }
public static int getStartingStoppingNotificationId() { public static int getStartingStoppingNotificationId() {
@ -123,9 +123,9 @@ public class CallNotificationBuilder {
private static @NonNull String getNotificationChannel(int type) { private static @NonNull String getNotificationChannel(int type) {
if ((callActivityRestricted() && type == TYPE_INCOMING_RINGING) || type == TYPE_ESTABLISHED) { if ((callActivityRestricted() && type == TYPE_INCOMING_RINGING) || type == TYPE_ESTABLISHED) {
return NotificationChannels.CALLS; return NotificationChannels.getInstance().CALLS;
} else { } else {
return NotificationChannels.CALL_STATUS; return NotificationChannels.getInstance().CALL_STATUS;
} }
} }