<commit_before>package org.stepik.android.view.notification

import android.app.AlarmManager
import android.app.Notification
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import org.stepic.droid.preferences.SharedPreferenceHelper
import org.stepic.droid.util.DateTimeHelper
import org.stepic.droid.util.scheduleCompat
import org.stepik.android.view.notification.receiver.StepikAlarmReceiver
import java.util.concurrent.ThreadPoolExecutor
import javax.inject.Inject

class StepikNotificationManagerImpl
@Inject constructor(
    private val context: Context,
    private val sharedPreferenceHelper: SharedPreferenceHelper,
    private val threadPoolExecutor: ThreadPoolExecutor
) : StepikNotificationManager {

    private val alarmManager: AlarmManager by lazy { context.getSystemService(Context.ALARM_SERVICE) as AlarmManager }
    private val notificationManager: NotificationManager by lazy { context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager }

    override fun scheduleNotification(id: String, millis: Long) {
        threadPoolExecutor.execute {
            val intent = StepikAlarmReceiver
                    .createIntent(context, id)

            val pendingIntent = PendingIntent
                    .getBroadcast(context, StepikAlarmReceiver.REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT)

            alarmManager.cancel(pendingIntent)
            alarmManager.scheduleCompat(millis, AlarmManager.INTERVAL_FIFTEEN_MINUTES, pendingIntent)

            sharedPreferenceHelper.putAlarmTimestamp(id, millis)
        }
    }

    override fun rescheduleActiveNotification(id: String) {
        val millis = sharedPreferenceHelper.getAlarmTimestamp(id)
        if (millis > 0L && millis > DateTimeHelper.nowUtc()) {
            scheduleNotification(id, millis)
        }
    }

    override fun showNotification(id: Long, notification: Notification) {
        notificationManager.notify(id.toInt(), notification)
    }
}<commit_msg>removed threadpool from notification manager<commit_after>package org.stepik.android.view.notification

import android.app.AlarmManager
import android.app.Notification
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import org.stepic.droid.preferences.SharedPreferenceHelper
import org.stepic.droid.util.DateTimeHelper
import org.stepic.droid.util.scheduleCompat
import org.stepik.android.view.notification.receiver.StepikAlarmReceiver
import javax.inject.Inject

class StepikNotificationManagerImpl
@Inject constructor(
    private val context: Context,
    private val sharedPreferenceHelper: SharedPreferenceHelper
) : StepikNotificationManager {

    private val alarmManager: AlarmManager by lazy { context.getSystemService(Context.ALARM_SERVICE) as AlarmManager }
    private val notificationManager: NotificationManager by lazy { context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager }

    override fun scheduleNotification(id: String, millis: Long) {
        val intent = StepikAlarmReceiver
                .createIntent(context, id)

        val pendingIntent = PendingIntent
                .getBroadcast(context, StepikAlarmReceiver.REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT)

        alarmManager.cancel(pendingIntent)
        alarmManager.scheduleCompat(millis, AlarmManager.INTERVAL_FIFTEEN_MINUTES, pendingIntent)

        sharedPreferenceHelper.putAlarmTimestamp(id, millis)
    }

    override fun rescheduleActiveNotification(id: String) {
        val millis = sharedPreferenceHelper.getAlarmTimestamp(id)
        if (millis > 0L && millis > DateTimeHelper.nowUtc()) {
            scheduleNotification(id, millis)
        }
    }

    override fun showNotification(id: Long, notification: Notification) {
        notificationManager.notify(id.toInt(), notification)
    }
}
{'fraction_non_alphanumeric': 0.06889512630773156, 'fraction_numerical': 0.0005103342689461597, 'mean_word_length': 4.326086956521739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1895220', 'n_tokens_mistral': 1022, 'n_tokens_neox': 1005, 'n_words': 209}