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

This commit is contained in:
Cody Henthorne
2022-12-08 12:15:17 -05:00
parent 51015dc898
commit fb0aa55cbb
23 changed files with 49 additions and 48 deletions

View File

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