summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-04-02 18:18:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-02 18:18:42 +0000
commit9e57a254953bedf24ba8b9eb6b6e24d10ff328f7 (patch)
tree5812c3bb48bdf3d414b3ddd8cd6c75cdc01257f4 /tests
parent24d3dad8dd91af037e2f7cc2780efc1be643bbe3 (diff)
parent6251f0d42be7da54d7f1bc8f570a44883b7d9052 (diff)
downloadframeworks_base-9e57a254953bedf24ba8b9eb6b6e24d10ff328f7.zip
frameworks_base-9e57a254953bedf24ba8b9eb6b6e24d10ff328f7.tar.gz
frameworks_base-9e57a254953bedf24ba8b9eb6b6e24d10ff328f7.tar.bz2
Merge "Rework assist to walk down the view hierarchy."
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);
}