Skip to content

Commit b54e0cf

Browse files
Add files via upload
1 parent 24d9d09 commit b54e0cf

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

app/src/main/kotlin/com/google/ai/sample/MainActivity.kt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,34 @@ class MainActivity : ComponentActivity() {
494494
}
495495
}
496496

497-
private fun checkAccessibilityServiceEnabled() {
497+
// Made internal to be accessible from other classes in the same module
498+
internal fun checkAccessibilityServiceEnabled() {
498499
// Dummy implementation
499500
Log.d(TAG, "Checking accessibility service (dummy check).")
501+
// Consider providing a real implementation or a way for other classes to know the status
500502
}
501503

502-
private fun requestManageExternalStoragePermission() {
504+
// Made internal to be accessible from other classes in the same module
505+
internal fun requestManageExternalStoragePermission() {
503506
// Dummy implementation
504507
Log.d(TAG, "Requesting manage external storage permission (dummy).")
508+
// Consider providing a real implementation
509+
}
510+
511+
// Added to provide API key to other classes like ViewModels
512+
fun getCurrentApiKey(): String? {
513+
return if (::apiKeyManager.isInitialized) {
514+
apiKeyManager.getCurrentApiKey()
515+
} else {
516+
null
517+
}
518+
}
519+
520+
// Added to allow other classes to show messages to the user via MainActivity
521+
fun updateStatusMessage(message: String) {
522+
// Displaying as a Toast for now, can be changed to Snackbar or other UI element
523+
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
524+
Log.d(TAG, "Status Message Updated: $message")
505525
}
506526

507527
companion object {

0 commit comments

Comments
 (0)