Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"formatVersion": 1,
"database": {
"version": 7,
"identityHash": "ddf91ad81bbb46713142177c854d85ad",
"identityHash": "0bb8836fe6777d5c9170a6881beae9fe",
"entities": [
{
"tableName": "notification",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `appName` TEXT NOT NULL, `title` TEXT NOT NULL, `content` TEXT NOT NULL, `timestamp` INTEGER NOT NULL)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `appName` TEXT NOT NULL, `title` TEXT NOT NULL, `content` TEXT NOT NULL, `timestamp` INTEGER NOT NULL, `subText` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -37,6 +37,12 @@
"columnName": "timestamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "subText",
"columnName": "subText",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
Expand All @@ -62,7 +68,7 @@
},
{
"tableName": "notification_meta",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`notificationId` INTEGER NOT NULL, `intentActive` INTEGER NOT NULL, `intentArray` BLOB NOT NULL, PRIMARY KEY(`notificationId`), FOREIGN KEY(`notificationId`) REFERENCES `notification`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`notificationId` INTEGER NOT NULL, `intentActive` INTEGER NOT NULL, `intentArray` BLOB NOT NULL, `isRead` INTEGER NOT NULL, PRIMARY KEY(`notificationId`), FOREIGN KEY(`notificationId`) REFERENCES `notification`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "notificationId",
Expand All @@ -81,6 +87,12 @@
"columnName": "intentArray",
"affinity": "BLOB",
"notNull": true
},
{
"fieldPath": "isRead",
"columnName": "isRead",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
Expand Down Expand Up @@ -222,7 +234,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'ddf91ad81bbb46713142177c854d85ad')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '0bb8836fe6777d5c9170a6881beae9fe')"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
{
"formatVersion": 1,
"database": {
"version": 8,
"identityHash": "0bb8836fe6777d5c9170a6881beae9fe",
"entities": [
{
"tableName": "notification",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `appName` TEXT NOT NULL, `title` TEXT NOT NULL, `content` TEXT NOT NULL, `timestamp` INTEGER NOT NULL, `subText` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "appName",
"columnName": "appName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "content",
"columnName": "content",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "timestamp",
"columnName": "timestamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "subText",
"columnName": "subText",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_notification_appName_title_timestamp",
"unique": false,
"columnNames": [
"appName",
"title",
"timestamp"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_notification_appName_title_timestamp` ON `${TABLE_NAME}` (`appName`, `title`, `timestamp`)"
}
],
"foreignKeys": []
},
{
"tableName": "notification_meta",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`notificationId` INTEGER NOT NULL, `intentActive` INTEGER NOT NULL, `intentArray` BLOB NOT NULL, `isRead` INTEGER NOT NULL, PRIMARY KEY(`notificationId`), FOREIGN KEY(`notificationId`) REFERENCES `notification`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "intentActive",
"columnName": "intentActive",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "intentArray",
"columnName": "intentArray",
"affinity": "BLOB",
"notNull": true
},
{
"fieldPath": "isRead",
"columnName": "isRead",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"notificationId"
]
},
"indices": [],
"foreignKeys": [
{
"table": "notification",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"notificationId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "notification_icon",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`notificationId` INTEGER NOT NULL, `iconBytes` BLOB NOT NULL, `priorityActive` INTEGER NOT NULL DEFAULT 0, `priority` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`notificationId`), FOREIGN KEY(`notificationId`) REFERENCES `notification`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "iconBytes",
"columnName": "iconBytes",
"affinity": "BLOB",
"notNull": true
},
{
"fieldPath": "priorityActive",
"columnName": "priorityActive",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "priority",
"columnName": "priority",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"notificationId"
]
},
"indices": [
{
"name": "index_notification_icon_priorityActive_priority",
"unique": false,
"columnNames": [
"priorityActive",
"priority"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_notification_icon_priorityActive_priority` ON `${TABLE_NAME}` (`priorityActive`, `priority`)"
}
],
"foreignKeys": [
{
"table": "notification",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"notificationId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "app_icon",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`notiAppName` TEXT NOT NULL, `iconBytes` BLOB NOT NULL, `priorityActive` INTEGER NOT NULL DEFAULT 0, `priority` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`notiAppName`))",
"fields": [
{
"fieldPath": "notiAppName",
"columnName": "notiAppName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "iconBytes",
"columnName": "iconBytes",
"affinity": "BLOB",
"notNull": true
},
{
"fieldPath": "priorityActive",
"columnName": "priorityActive",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "priority",
"columnName": "priority",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"notiAppName"
]
},
"indices": [
{
"name": "index_app_icon_priorityActive_priority",
"unique": false,
"columnNames": [
"priorityActive",
"priority"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_app_icon_priorityActive_priority` ON `${TABLE_NAME}` (`priorityActive`, `priority`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '0bb8836fe6777d5c9170a6881beae9fe')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import com.example.notimanager.presentation.ui.activity.MainActivity
import com.example.notimanager.data.model.NotificationModel
import com.example.notimanager.data.repository.NotificationRepository
import com.example.notimanager.domain.service.NotiListenerService
import com.example.notimanager.data.utils.NameGetter
import com.example.notimanager.data.utils.IntentHelper
import com.example.notimanager.domain.utils.NameGetter
import com.example.notimanager.domain.utils.IntentHelper
import io.mockk.coEvery
import io.mockk.coVerify
import io.mockk.every
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.content.pm.PackageManager
import android.os.UserHandle
import android.service.notification.StatusBarNotification
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.example.notimanager.domain.utils.NameGetter
import io.mockk.every
import io.mockk.mockk
import io.mockk.unmockkAll
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.example.notimanager.common.objects

import java.net.URLDecoder
import java.net.URLEncoder
import java.nio.charset.StandardCharsets

object Encoder {
fun getEncodedString(target: String): String {
return URLEncoder.encode(target, StandardCharsets.UTF_8.toString())
}

fun getDecodeString(target: String): String {
return URLDecoder.decode(target, StandardCharsets.UTF_8.toString())
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.example.notimanager.data.dto

import android.graphics.BitmapFactory
import com.example.notimanager.data.utils.IntentHelper.retrieveIntent
import com.example.notimanager.domain.utils.IntentHelper.retrieveIntent
import com.example.notimanager.domain.model.Notification

data class NotificationDto(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data class NotificationMetaModel(
@PrimaryKey
val notificationId: Long,
val intentActive: Boolean = true,
val intentArray: ByteArray
val intentArray: ByteArray,
val isRead: Boolean = false,
)

Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ data class NotificationModel(
val title: String,
val content: String,
val timestamp: Long,
val subText: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@ object MigrationObject {
db.execSQL("CREATE INDEX index_app_icon_priorityActive_priority ON app_icon (priorityActive, priority);")
}
}

val MIGRATION_7_8 = object : Migration(7, 8) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE notification ADD COLUMN subText TEXT NOT NULL DEFAULT '';")
db.execSQL("ALTER TABLE notification_meta ADD COLUMN isRead INTEGER NOT NULL DEFAULT '0';")
}
}
}
Loading
Loading