File tree Expand file tree Collapse file tree
app/src/main/kotlin/com/google/ai/sample Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -505,15 +505,7 @@ class ScreenOperatorAccessibilityService : AccessibilityService() {
505505 val className = rootNode.className?.toString() ? : " Unknown"
506506
507507 // Get the window title (safely)
508- val windowTitle = try {
509- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
510- rootNode.windowTitle?.toString() ? : " Unknown"
511- } else {
512- " Unknown"
513- }
514- } catch (e: Exception ) {
515- " Unknown"
516- }
508+ val title = " Unknown"
517509
518510 // Get the content description
519511 val contentDescription = rootNode.contentDescription?.toString() ? : " None"
@@ -528,7 +520,7 @@ class ScreenOperatorAccessibilityService : AccessibilityService() {
528520 val screenInfo = StringBuilder ()
529521 screenInfo.append(" App: $packageName \n " )
530522 screenInfo.append(" Screen: $className \n " )
531- screenInfo.append(" Title: $windowTitle \n " )
523+ screenInfo.append(" Title: $title \n " )
532524 screenInfo.append(" Description: $contentDescription \n " )
533525 screenInfo.append(" Child Count: $childCount \n\n " )
534526
You can’t perform that action at this time.
0 commit comments