summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java10
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java1
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java
index bdc1276..782d112 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java
@@ -45,6 +45,7 @@ public class AssistVisualizer extends View {
}
public void setAssistStructure(AssistStructure as) {
+ mAssistStructure.dump();
mAssistStructure = as;
mTextRects.clear();
final int N = as.getWindowNodeCount();
@@ -55,6 +56,7 @@ public class AssistVisualizer extends View {
windowNode.getTop());
}
}
+ Log.d(TAG, "Building text rects in " + this + ": found " + mTextRects.size());
invalidate();
}
@@ -69,10 +71,11 @@ public class AssistVisualizer extends View {
}
int left = parentLeft+root.getLeft();
int top = parentTop+root.getTop();
- Log.d(TAG, "View " + root.getClassName() + ": " + left + ", " + top);
- if (root.getText() != null) {
+ if (root.getText() != null || root.getContentDescription() != null) {
Rect r = new Rect(left, top, left+root.getWidth(), top+root.getHeight());
- Log.d(TAG, "Text Rect " + r.toShortString() + ": " + root.getText());
+ Log.d(TAG, "View " + root.getClassName() + " " + left + "," + top + " tr "
+ + r.toShortString() + ": "
+ + (root.getText() != null ? root.getText() : root.getContentDescription()));
mTextRects.add(r);
}
final int N = root.getChildCount();
@@ -91,6 +94,7 @@ public class AssistVisualizer extends View {
super.onDraw(canvas);
getLocationOnScreen(mTmpLocation);
final int N = mTextRects.size();
+ Log.d(TAG, "Drawing text rects in " + this + ": found " + mTextRects.size());
for (int i=0; i<N; i++) {
Rect r = mTextRects.get(i);
canvas.drawRect(r.left-mTmpLocation[0], r.top-mTmpLocation[1],
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
index bc18ca9..ec727c4 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java
@@ -142,7 +142,6 @@ public class MainInteractionSession extends VoiceInteractionSession
if (assistContext != null) {
mAssistStructure = AssistStructure.getAssistStructure(assistContext);
if (mAssistStructure != null) {
- mAssistStructure.dump();
if (mAssistVisualizer != null) {
mAssistVisualizer.setAssistStructure(mAssistStructure);
}