diff options
author | Matthew Williams <mjwilliams@google.com> | 2014-06-06 19:05:44 -0700 |
---|---|---|
committer | Matthew Williams <mjwilliams@google.com> | 2014-06-07 20:50:54 -0700 |
commit | 13b0241248716b126a538457828a964e86109d58 (patch) | |
tree | 4a12c8e46bc8d1318bb2c0521ae5df961e2632d7 /tests/JobSchedulerTestApp/res | |
parent | 2f98a26bbf24fdc40ef53a653bb152c7f5a5d0dd (diff) | |
download | frameworks_base-13b0241248716b126a538457828a964e86109d58.zip frameworks_base-13b0241248716b126a538457828a964e86109d58.tar.gz frameworks_base-13b0241248716b126a538457828a964e86109d58.tar.bz2 |
Add test app for JobScheduler
Schedule either a delay/deadline task, or a task with
connectivity constraints
Change-Id: Ie7ea731d0f6673b680cef79f894cb609a61b795d
Diffstat (limited to 'tests/JobSchedulerTestApp/res')
-rw-r--r-- | tests/JobSchedulerTestApp/res/drawable-hdpi/ic_launcher.png | bin | 0 -> 5473 bytes | |||
-rw-r--r-- | tests/JobSchedulerTestApp/res/drawable-mdpi/ic_launcher.png | bin | 0 -> 3298 bytes | |||
-rw-r--r-- | tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_action_refresh.png | bin | 0 -> 856 bytes | |||
-rw-r--r-- | tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_launcher.png | bin | 0 -> 7401 bytes | |||
-rw-r--r-- | tests/JobSchedulerTestApp/res/drawable-xxhdpi/ic_launcher.png | bin | 0 -> 12074 bytes | |||
-rw-r--r-- | tests/JobSchedulerTestApp/res/layout/activity_main.xml | 125 | ||||
-rw-r--r-- | tests/JobSchedulerTestApp/res/values-v11/styles.xml | 28 | ||||
-rw-r--r-- | tests/JobSchedulerTestApp/res/values-v14/styles.xml | 29 | ||||
-rw-r--r-- | tests/JobSchedulerTestApp/res/values/color.xml | 21 | ||||
-rw-r--r-- | tests/JobSchedulerTestApp/res/values/strings.xml | 33 | ||||
-rw-r--r-- | tests/JobSchedulerTestApp/res/values/styles.xml | 37 |
11 files changed, 273 insertions, 0 deletions
diff --git a/tests/JobSchedulerTestApp/res/drawable-hdpi/ic_launcher.png b/tests/JobSchedulerTestApp/res/drawable-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..a0f7005 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/drawable-hdpi/ic_launcher.png diff --git a/tests/JobSchedulerTestApp/res/drawable-mdpi/ic_launcher.png b/tests/JobSchedulerTestApp/res/drawable-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..a085462 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/drawable-mdpi/ic_launcher.png diff --git a/tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_action_refresh.png b/tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_action_refresh.png Binary files differnew file mode 100644 index 0000000..4f5d255 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_action_refresh.png diff --git a/tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_launcher.png b/tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..4f78eb8 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/drawable-xhdpi/ic_launcher.png diff --git a/tests/JobSchedulerTestApp/res/drawable-xxhdpi/ic_launcher.png b/tests/JobSchedulerTestApp/res/drawable-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..b198ee3 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/drawable-xxhdpi/ic_launcher.png diff --git a/tests/JobSchedulerTestApp/res/layout/activity_main.xml b/tests/JobSchedulerTestApp/res/layout/activity_main.xml new file mode 100644 index 0000000..7f4961b --- /dev/null +++ b/tests/JobSchedulerTestApp/res/layout/activity_main.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" > + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="100dp"> + <TextView + android:id="@+id/onstart_textview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@color/none_received" + android:gravity="center" + android:text="@string/onstarttask"/> + <TextView + android:id="@+id/onstop_textview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@color/none_received" + android:gravity="center" + android:text="@string/onstoptask"/> + </LinearLayout> + <Button + android:id="@+id/finished_button" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="20dp" + android:layout_marginBottom="5dp" + android:onClick="finishJob" + android:text="@string/finish_job_button_text"/> + + <TextView + android:id="@+id/task_params" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/defaultparamtext" + android:gravity="center" + android:textSize="20dp" + + android:padding="15dp" + android:layout_marginBottom="10dp" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/constraints" + android:textSize="18dp"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_marginLeft="10dp"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/connectivity" + android:layout_marginRight="10dp"/> + <RadioGroup + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <RadioButton android:id="@+id/checkbox_any" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/any"/> + <RadioButton android:id="@+id/checkbox_unmetered" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/unmetered"/> + </RadioGroup> + + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/timing"/> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="15dp" + android:textSize="17dp" + android:text="@string/delay"/> + <EditText + android:id="@+id/delay_time" + android:layout_width="60dp" + android:layout_height="wrap_content" + android:inputType="number"/> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/deadline" + android:textSize="17dp"/> + <EditText + android:id="@+id/deadline_time" + android:layout_width="60dp" + android:layout_height="wrap_content" + android:inputType="number"/> + </LinearLayout> + + </LinearLayout> + <Button + android:id="@+id/schedule_button" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="40dp" + android:onClick="scheduleJob" + android:text="@string/schedule_job_button_text"/> + </LinearLayout> +</LinearLayout> diff --git a/tests/JobSchedulerTestApp/res/values-v11/styles.xml b/tests/JobSchedulerTestApp/res/values-v11/styles.xml new file mode 100644 index 0000000..ff65301 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/values-v11/styles.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2013 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<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>
\ No newline at end of file diff --git a/tests/JobSchedulerTestApp/res/values-v14/styles.xml b/tests/JobSchedulerTestApp/res/values-v14/styles.xml new file mode 100644 index 0000000..a4a443a --- /dev/null +++ b/tests/JobSchedulerTestApp/res/values-v14/styles.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2013 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<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>
\ No newline at end of file diff --git a/tests/JobSchedulerTestApp/res/values/color.xml b/tests/JobSchedulerTestApp/res/values/color.xml new file mode 100644 index 0000000..7bd3a91 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/values/color.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + <color name="none_received">#999999</color> + <color name="start_received">#00FF00</color> + <color name="stop_received">#FF0000</color> +</resources>
\ No newline at end of file diff --git a/tests/JobSchedulerTestApp/res/values/strings.xml b/tests/JobSchedulerTestApp/res/values/strings.xml new file mode 100644 index 0000000..824d4b1 --- /dev/null +++ b/tests/JobSchedulerTestApp/res/values/strings.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2013 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<resources> + <string name="onstoptask">onStopTask</string> + <string name="onstarttask">onStartTask</string> + <string name="defaultparamtext">task params will show up here.</string> + <string name="schedule_job_button_text">Schedule Job</string> + <string name="app_name">Job Scheduler Test</string> + <string name="finish_job_button_text">taskFinished</string> + <string name="manual_sync_text">Manual Sync</string> + <string name="constraints">Constraints</string> + <string name="connectivity">Connectivity:</string> + <string name="any">Any</string> + <string name="unmetered">WiFi</string> + <string name="timing">Timing:</string> + <string name="delay">Delay:</string> + <string name="deadline">Deadline:</string> +</resources> diff --git a/tests/JobSchedulerTestApp/res/values/styles.xml b/tests/JobSchedulerTestApp/res/values/styles.xml new file mode 100644 index 0000000..43a8f2b --- /dev/null +++ b/tests/JobSchedulerTestApp/res/values/styles.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright 2013 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<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>
\ No newline at end of file |