summaryrefslogtreecommitdiffstats
path: root/tzdata/update_test_app/res
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-03-13 14:31:20 +0000
committerNeil Fuller <nfuller@google.com>2015-03-31 09:28:06 +0100
commit91c98d778c80e53a7f458264233375f982dcae14 (patch)
tree6d048b60f46c805e8a701e3af9798a4b1850a0c5 /tzdata/update_test_app/res
parent1e342670cc46445bd51d53f7a28f95d1eb879c9f (diff)
downloadlibcore-91c98d778c80e53a7f458264233375f982dcae14.zip
libcore-91c98d778c80e53a7f458264233375f982dcae14.tar.gz
libcore-91c98d778c80e53a7f458264233375f982dcae14.tar.bz2
Timezone data installer code
The code here is used by the system server to install timezone data updates. It is separate so it can be tested. Scripts are included that build an "update bundle" (a zip file with a well-defined contents). ConfigBundle contains logic to extract the bundle safely. TzDataBundleBuilder is used in the test and tools to construct a bundle. The scripts in tools is a placeholder and will evolve. bionic/libc/tools/zoneinfo tools will likely move there so they can be integrated more closely. An app is included for testing updates. Bug: 19941636 Change-Id: Id0985f8c5be2f12858ee8bf52acf52bdb2df8741
Diffstat (limited to 'tzdata/update_test_app/res')
-rw-r--r--tzdata/update_test_app/res/drawable/ic_launcher.pngbin0 -> 9397 bytes
-rw-r--r--tzdata/update_test_app/res/layout/activity_main.xml106
-rw-r--r--tzdata/update_test_app/res/values/strings.xml13
-rw-r--r--tzdata/update_test_app/res/xml/filepaths.xml4
4 files changed, 123 insertions, 0 deletions
diff --git a/tzdata/update_test_app/res/drawable/ic_launcher.png b/tzdata/update_test_app/res/drawable/ic_launcher.png
new file mode 100644
index 0000000..96a442e
--- /dev/null
+++ b/tzdata/update_test_app/res/drawable/ic_launcher.png
Binary files differ
diff --git a/tzdata/update_test_app/res/layout/activity_main.xml b/tzdata/update_test_app/res/layout/activity_main.xml
new file mode 100644
index 0000000..b265837
--- /dev/null
+++ b/tzdata/update_test_app/res/layout/activity_main.xml
@@ -0,0 +1,106 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context=".MainActivity">
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/action"
+ android:id="@+id/action_label" />
+
+ <EditText
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/action"
+ android:layout_weight="1"
+ android:text="@string/default_action" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/version"
+ android:id="@+id/version_label" />
+
+ <EditText
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/version"
+ android:layout_weight="1"
+ android:text="@string/default_version" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/content_path"
+ android:id="@+id/content_path_label" />
+
+ <EditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/default_content_path"
+ android:id="@+id/content_path" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/required_hash"
+ android:id="@+id/required_hash_label" />
+
+ <EditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/default_required_hash"
+ android:id="@+id/required_hash" />
+
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/trigger_install_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:text="@string/trigger_install" />
+
+ <ScrollView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:scrollbars="vertical"
+ android:fillViewport="true">
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:id="@+id/log"
+ android:singleLine="false" />
+
+ </ScrollView>
+
+</LinearLayout>
diff --git a/tzdata/update_test_app/res/values/strings.xml b/tzdata/update_test_app/res/values/strings.xml
new file mode 100644
index 0000000..524f9d8
--- /dev/null
+++ b/tzdata/update_test_app/res/values/strings.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">InstallUpdateTestApp</string>
+ <string name="action">Action</string>
+ <string name="content_path">Content Path</string>
+ <string name="default_action">android.intent.action.UPDATE_TZDATA</string>
+ <string name="default_content_path">/data/local/tmp/out.zip</string>
+ <string name="default_required_hash">NONE</string>
+ <string name="default_version">1</string>
+ <string name="required_hash">Required Hash</string>
+ <string name="trigger_install">Trigger Install</string>
+ <string name="version">Version</string>
+</resources>
diff --git a/tzdata/update_test_app/res/xml/filepaths.xml b/tzdata/update_test_app/res/xml/filepaths.xml
new file mode 100644
index 0000000..c95b8f4
--- /dev/null
+++ b/tzdata/update_test_app/res/xml/filepaths.xml
@@ -0,0 +1,4 @@
+<!-- Used by FileProvider. See AndroidManifest.xml -->
+<paths>
+ <files-path path="temp/" name="temp" />
+</paths>