summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/VoiceInteraction/res/layout/main.xml6
-rw-r--r--tests/VoiceInteraction/res/values/strings.xml1
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/VoiceInteractionMain.java13
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/VoiceInteraction/res/layout/main.xml b/tests/VoiceInteraction/res/layout/main.xml
index 0f968eb..a83d02c 100644
--- a/tests/VoiceInteraction/res/layout/main.xml
+++ b/tests/VoiceInteraction/res/layout/main.xml
@@ -26,6 +26,12 @@
android:text="@string/start"
/>
+ <CheckBox android:id="@+id/secure"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/secure"
+ />
+
<com.android.test.voiceinteraction.AsyncStructure
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/tests/VoiceInteraction/res/values/strings.xml b/tests/VoiceInteraction/res/values/strings.xml
index ab39f99..29ffe21 100644
--- a/tests/VoiceInteraction/res/values/strings.xml
+++ b/tests/VoiceInteraction/res/values/strings.xml
@@ -17,6 +17,7 @@
<resources>
<string name="start">Start</string>
+ <string name="secure">Secure</string>
<string name="tree">Tree</string>
<string name="text">Text</string>
<string name="asyncStructure">(Async structure goes here)</string>
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/VoiceInteractionMain.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/VoiceInteractionMain.java
index ee75f28..87fa91a 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/VoiceInteractionMain.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/VoiceInteractionMain.java
@@ -21,6 +21,8 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
+import android.view.WindowManager;
+import android.widget.CheckBox;
public class VoiceInteractionMain extends Activity {
@@ -30,6 +32,7 @@ public class VoiceInteractionMain extends Activity {
setContentView(R.layout.main);
findViewById(R.id.start).setOnClickListener(mStartListener);
+ findViewById(R.id.secure).setOnClickListener(mSecureListener);
}
@Override
@@ -52,4 +55,14 @@ public class VoiceInteractionMain extends Activity {
showAssist(null);
}
};
+
+ View.OnClickListener mSecureListener = new View.OnClickListener() {
+ public void onClick(View v) {
+ if (((CheckBox)v).isChecked()) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ } else {
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+ }
+ };
}