aboutsummaryrefslogtreecommitdiff
path: root/admin/AppRestrictionSchema
diff options
context:
space:
mode:
authorTrevor Johns <trevorjohns@google.com>2014-11-19 15:18:33 -0800
committerTrevor Johns <trevorjohns@google.com>2014-11-20 01:06:00 -0800
commitef2edba8e1640053e2640b7bf0def358bee45131 (patch)
treedef7ce00bfd98db492d94cf4ba7df5f90328bf6e /admin/AppRestrictionSchema
parent92e1bb54bbb9be28bd9d68c8a26534b2eb6c9322 (diff)
downloadandroid-ef2edba8e1640053e2640b7bf0def358bee45131.tar.gz
Add metadata to AppRestrictionSchema sample
Change-Id: I1434a6d2d26df247d695720ed64508b10a481cd8
Diffstat (limited to 'admin/AppRestrictionSchema')
-rw-r--r--admin/AppRestrictionSchema/screenshots/main.pngbin0 -> 108165 bytes
-rw-r--r--admin/AppRestrictionSchema/template-params.xml68
2 files changed, 68 insertions, 0 deletions
diff --git a/admin/AppRestrictionSchema/screenshots/main.png b/admin/AppRestrictionSchema/screenshots/main.png
new file mode 100644
index 00000000..0d0d9c4c
--- /dev/null
+++ b/admin/AppRestrictionSchema/screenshots/main.png
Binary files differ
diff --git a/admin/AppRestrictionSchema/template-params.xml b/admin/AppRestrictionSchema/template-params.xml
index c6ec4a1d..66030344 100644
--- a/admin/AppRestrictionSchema/template-params.xml
+++ b/admin/AppRestrictionSchema/template-params.xml
@@ -39,4 +39,72 @@
<common src="logger" />
<common src="activities" />
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Device Admin</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>Application/main/big_icon.png</icon>
+ <screenshots>
+ <img>screenshots/main.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.content.RestrictionsManager</android>
+ </api_refs>
+
+ <description>
+A basic app showing how to allow a device administrator to restrict user
+activities using the Android Device Administration API. The app exports
+a custom policy that enables or disables a UI control. Device Administration
+applications are able to enforce a specific value for this policy, as
+directed by enterprise administrators.
+ </description>
+
+ <intro>
+<![CDATA[
+The [Android Device Administration API][1] allows enterprise administrators to
+enforce specific policies on a managed device. The system provides policies
+that control settings such as password complexity, screen lock, or camera
+availability. Developers can also augment this list with custom policies
+that control specific features within their applications. For example,
+a web browser could provide access to a whitelist of allowed domains.
+
+The list of policies exposed by an app must be specified using a file
+inside of the `res/xml` directory, using the `<restriction>` tag:
+
+```xml
+<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <restriction
+ android:defaultValue="false"
+ android:description="@string/description_can_say_hello"
+ android:key="can_say_hello"
+ android:restrictionType="bool"
+ android:title="@string/title_can_say_hello" />
+
+</restrictions>
+```
+
+In this sample, that file can be found at
+`Application/src/main/res/xml/app_restrictions.xml`. This file must be
+also be declared inside of `ApplicationManifest.xml` using a `<meta-data>`
+element:
+
+```xml
+<meta-data
+ android:name="android.content.APP_RESTRICTIONS"
+ android:resource="@xml/app_restrictions" />
+```
+
+At runtime, the current list of restrictions enforced by policy can be
+checked by calling [RestrictionsManager.getApplicationRestrictions()][2].
+
+[1]: http://developer.android.com/guide/topics/admin/device-admin.html
+[2]: https://developer.android.com/reference/android/content/RestrictionsManager.html#getApplicationRestrictions()
+]]>
+ </intro>
+ </metadata>
+
</sample>