Minor extension update cleanup, default to on

This commit is contained in:
arkon
2020-03-20 22:53:24 -04:00
parent 9585f9a1a6
commit 6da350aee6
19 changed files with 146 additions and 133 deletions

View File

@@ -26,7 +26,7 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
}
companion object {
const val TAG = "BackupCreator"
private const val TAG = "BackupCreator"
fun setupTask(context: Context, prefInterval: Int? = null) {
val preferences = Injekt.get<PreferencesHelper>()

View File

@@ -23,7 +23,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
}
companion object {
const val TAG = "LibraryUpdate"
private const val TAG = "LibraryUpdate"
fun setupTask(context: Context, prefInterval: Int? = null) {
val preferences = Injekt.get<PreferencesHelper>()

View File

@@ -410,11 +410,9 @@ class NotificationReceiver : BroadcastReceiver() {
internal fun markAsReadPendingBroadcast(
context: Context,
manga: Manga,
chapters:
Array<Chapter>,
chapters: Array<Chapter>,
groupId: Int
):
PendingIntent {
): PendingIntent {
val newIntent = Intent(context, NotificationReceiver::class.java).apply {
action = ACTION_MARK_AS_READ
putExtra(EXTRA_CHAPTER_URL, chapters.map { it.url }.toTypedArray())
@@ -442,14 +440,14 @@ class NotificationReceiver : BroadcastReceiver() {
* Returns [PendingIntent] that opens the extensions controller.
*
* @param context context of application
* @return [PendingIntent]
*/
internal fun openExtensionsPendingActivity(context: Context): PendingIntent {
val newIntent =
Intent(context, MainActivity::class.java).setAction(MainActivity.SHORTCUT_EXTENSIONS)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
return PendingIntent.getActivity(
context, 0, newIntent, PendingIntent.FLAG_UPDATE_CURRENT
)
val intent = Intent(context, MainActivity::class.java).apply {
action = MainActivity.SHORTCUT_EXTENSIONS
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
}
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
}
}
}

View File

@@ -190,7 +190,7 @@ class PreferencesHelper(val context: Context) {
fun automaticUpdates() = prefs.getBoolean(Keys.automaticUpdates, true)
fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, false)
fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, true)
fun extensionUpdatesCount() = rxPrefs.getInteger("ext_updates_count", 0)

View File

@@ -55,7 +55,7 @@ class UpdaterJob(private val context: Context, workerParams: WorkerParameters) :
}
companion object {
const val TAG = "UpdateChecker"
private const val TAG = "UpdateChecker"
fun setupTask(context: Context) {
val constraints = Constraints.Builder()