Skip to content
Open
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
6 changes: 5 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".ui.reminder.ReminderService" />
<receiver android:name=".ui.reminder.ReminderReceiver" />
</application>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ class MemoryManager(
Pattern.compile("(?i)my (.+?) (?:is|are) (.+)")
)

// Patterns to detect reminder statements
private val reminderPatterns = listOf(
Pattern.compile("(?i)remind me (?:at|in) (.+?) to (.+)"),
Pattern.compile("(?i)set reminder (?:for|at) (.+?) (?:to|for) (.+)"),
Pattern.compile("(?i)alert me (?:at|in) (.+?) about (.+)"),
Pattern.compile("(?i)remind me (.+?) (?:to|for) (.+)"),

Copilot AI Aug 4, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex pattern is ambiguous as it doesn't capture time information, unlike the other patterns. The (.+?) capture group will match any text, potentially causing incorrect parsing when time expressions are present. Consider making this pattern more specific or removing it to avoid conflicts with other patterns.

Suggested change
Pattern.compile("(?i)remind me (.+?) (?:to|for) (.+)"),
// Pattern.compile("(?i)remind me (.+?) (?:to|for) (.+)"), // Removed due to ambiguity

Copilot uses AI. Check for mistakes.
Pattern.compile("(?i)can you remind me (?:at|in) (.+?) to (.+)")
)

// Pattern to detect JSON objects in text
private val jsonPattern = Pattern.compile("\\{(?:[^{}]|\\{[^{}]*\\})*\\}")

Expand Down Expand Up @@ -201,4 +210,4 @@ data class MemoryDetectionResult(
val memoryKey: String = "",
val memoryValue: String = "",
val isFromJson: Boolean = false
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ data class MemoryFact(
val id: Long = 0,
val key: String,
val value: String,
val timestamp: Long = System.currentTimeMillis()
)
val timestamp: Long = System.currentTimeMillis(),
val isReminder: Boolean = false,
val reminderTime: Long? = null,
val isCompleted: Boolean = false,
val reminderType: String? = null

Copilot AI Aug 4, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a nullable String for reminderType allows arbitrary values and provides no type safety. Consider using an enum class to define valid reminder types (e.g., TASK, APPOINTMENT, MEDICATION) for better API design and validation.

Suggested change
val reminderType: String? = null
val reminderType: ReminderType? = null

Copilot uses AI. Check for mistakes.
)