summaryrefslogtreecommitdiffstats
path: root/tests/LockTaskTests/res
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2015-04-08 15:43:26 -0700
committerCraig Mautner <cmautner@google.com>2015-04-15 14:27:56 -0700
commit2ad0bb46a42476f91b63baa95f0bcf97a337a4fc (patch)
tree038cec3cde560e9d898ef8c3aa0f1d5cff58fa14 /tests/LockTaskTests/res
parent15df08abd8190353e1430f88c2ed6462d72a5b25 (diff)
downloadframeworks_base-2ad0bb46a42476f91b63baa95f0bcf97a337a4fc.zip
frameworks_base-2ad0bb46a42476f91b63baa95f0bcf97a337a4fc.tar.gz
frameworks_base-2ad0bb46a42476f91b63baa95f0bcf97a337a4fc.tar.bz2
Add tests for android:lockTaskMode.
Android app to exercise the new attribute. For bug 19995702. Change-Id: I0794301a6b677ec6367dd3ad99a40b5d3f9f1d7c
Diffstat (limited to 'tests/LockTaskTests/res')
-rw-r--r--tests/LockTaskTests/res/drawable-hdpi/ic_launcher.pngbin0 -> 7658 bytes
-rw-r--r--tests/LockTaskTests/res/drawable-mdpi/ic_launcher.pngbin0 -> 3777 bytes
-rw-r--r--tests/LockTaskTests/res/drawable-xhdpi/ic_launcher.pngbin0 -> 12516 bytes
-rw-r--r--tests/LockTaskTests/res/drawable-xxhdpi/ic_launcher.pngbin0 -> 24777 bytes
-rw-r--r--tests/LockTaskTests/res/layout/activity_launch.xml32
-rw-r--r--tests/LockTaskTests/res/layout/activity_main.xml41
-rw-r--r--tests/LockTaskTests/res/values-v11/styles.xml11
-rw-r--r--tests/LockTaskTests/res/values-v14/styles.xml12
-rw-r--r--tests/LockTaskTests/res/values-w820dp/dimens.xml10
-rw-r--r--tests/LockTaskTests/res/values/dimens.xml7
-rw-r--r--tests/LockTaskTests/res/values/strings.xml25
-rw-r--r--tests/LockTaskTests/res/values/styles.xml20
12 files changed, 158 insertions, 0 deletions
diff --git a/tests/LockTaskTests/res/drawable-hdpi/ic_launcher.png b/tests/LockTaskTests/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..288b665
--- /dev/null
+++ b/tests/LockTaskTests/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/tests/LockTaskTests/res/drawable-mdpi/ic_launcher.png b/tests/LockTaskTests/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..6ae570b
--- /dev/null
+++ b/tests/LockTaskTests/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/tests/LockTaskTests/res/drawable-xhdpi/ic_launcher.png b/tests/LockTaskTests/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..d4fb7cd
--- /dev/null
+++ b/tests/LockTaskTests/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/tests/LockTaskTests/res/drawable-xxhdpi/ic_launcher.png b/tests/LockTaskTests/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..85a6081
--- /dev/null
+++ b/tests/LockTaskTests/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/tests/LockTaskTests/res/layout/activity_launch.xml b/tests/LockTaskTests/res/layout/activity_launch.xml
new file mode 100644
index 0000000..b619743
--- /dev/null
+++ b/tests/LockTaskTests/res/layout/activity_launch.xml
@@ -0,0 +1,32 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/root_launch"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ tools:context="com.google.android.example.locktasktests.LaunchActivity" >
+
+ <Button
+ android:id="@+id/button_try_lock"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:onClick="onTryLock"
+ android:text="@string/try_lock" />
+ <Button
+ android:id="@+id/button_try_unlock"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:onClick="onTryUnlock"
+ android:text="@string/try_unlock" />
+ <Button
+ android:id="@+id/button_launch_main"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:onClick="onLaunchMain"
+ android:text="@string/launch_main" />
+
+</LinearLayout>
diff --git a/tests/LockTaskTests/res/layout/activity_main.xml b/tests/LockTaskTests/res/layout/activity_main.xml
new file mode 100644
index 0000000..c2e93c4
--- /dev/null
+++ b/tests/LockTaskTests/res/layout/activity_main.xml
@@ -0,0 +1,41 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/root_launch"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ tools:context="com.google.android.example.locktasktests.MainActivity" >
+ <Button
+ android:id="@+id/button_default"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:onClick="onButtonPressed"
+ android:text="@string/launch_default" />
+ <Button
+ android:id="@+id/button_never"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:onClick="onButtonPressed"
+ android:text="@string/launch_never" />
+ <Button
+ android:id="@+id/button_whitelist"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:onClick="onButtonPressed"
+ android:text="@string/launch_whitelist" />
+ <Button
+ android:id="@+id/button_always"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:onClick="onButtonPressed"
+ android:text="@string/launch_always" />
+
+</LinearLayout>
diff --git a/tests/LockTaskTests/res/values-v11/styles.xml b/tests/LockTaskTests/res/values-v11/styles.xml
new file mode 100644
index 0000000..3c02242
--- /dev/null
+++ b/tests/LockTaskTests/res/values-v11/styles.xml
@@ -0,0 +1,11 @@
+<resources>
+
+ <!--
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+ <!-- API 11 theme customizations can go here. -->
+ </style>
+
+</resources>
diff --git a/tests/LockTaskTests/res/values-v14/styles.xml b/tests/LockTaskTests/res/values-v14/styles.xml
new file mode 100644
index 0000000..a91fd03
--- /dev/null
+++ b/tests/LockTaskTests/res/values-v14/styles.xml
@@ -0,0 +1,12 @@
+<resources>
+
+ <!--
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+ <!-- API 14 theme customizations can go here. -->
+ </style>
+
+</resources>
diff --git a/tests/LockTaskTests/res/values-w820dp/dimens.xml b/tests/LockTaskTests/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..f3e7020
--- /dev/null
+++ b/tests/LockTaskTests/res/values-w820dp/dimens.xml
@@ -0,0 +1,10 @@
+<resources>
+
+ <!--
+ Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
+ -->
+ <dimen name="activity_horizontal_margin">64dp</dimen>
+
+</resources>
diff --git a/tests/LockTaskTests/res/values/dimens.xml b/tests/LockTaskTests/res/values/dimens.xml
new file mode 100644
index 0000000..55c1e59
--- /dev/null
+++ b/tests/LockTaskTests/res/values/dimens.xml
@@ -0,0 +1,7 @@
+<resources>
+
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+
+</resources>
diff --git a/tests/LockTaskTests/res/values/strings.xml b/tests/LockTaskTests/res/values/strings.xml
new file mode 100644
index 0000000..ae7768e
--- /dev/null
+++ b/tests/LockTaskTests/res/values/strings.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="app_name">Lock Task Tests</string>
+ <string name="title_activity_default">LockDefaultActivity</string>
+ <string name="title_activity_never">LockTaskNeverActivity</string>
+ <string name="title_activity_whitelist">LockWhitelistedActivity</string>
+ <string name="title_activity_always">LockAtLaunchActivity</string>
+ <string name="launch_default">android:lockTaskMode=\n
+ \"lockTaskModeDefault\"\n
+ Pinnable from Overview.</string>
+ <string name="launch_never">android:lockTaskMode=\n
+ \"lockTaskModeNever\"\n
+ Not Lockable or Pinnable.</string>
+ <string name="launch_whitelist">android:lockTaskMode=\n\"lockTaskModeIfWhitelisted\"\n
+ Lockable if whitelisted, Pinnable.\n
+ Use SampleDeviceOwner app to set whitelist.</string>
+ <string name="launch_always">android:lockTaskMode=\n
+ \"lockTaskModeAlways\"\n
+ Launches into lock mode.</string>
+ <string name="launch_main">launch MainActivity (as activity)"</string>
+ <string name="try_lock">Call startLockMode()</string>
+ <string name="try_unlock">Call stopLockMode()</string>
+
+</resources>
diff --git a/tests/LockTaskTests/res/values/styles.xml b/tests/LockTaskTests/res/values/styles.xml
new file mode 100644
index 0000000..6ce89c7
--- /dev/null
+++ b/tests/LockTaskTests/res/values/styles.xml
@@ -0,0 +1,20 @@
+<resources>
+
+ <!--
+ Base application theme, dependent on API level. This theme is replaced
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Light">
+ <!--
+ Theme customizations available in newer API levels can go in
+ res/values-vXX/styles.xml, while customizations related to
+ backward-compatibility can go here.
+ -->
+ </style>
+
+ <!-- Application theme. -->
+ <style name="AppTheme" parent="AppBaseTheme">
+ <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+ </style>
+
+</resources>