diff --git a/docs/html/images/training/enterprise/app_restrictions_diagram.png b/docs/html/images/training/enterprise/app_restrictions_diagram.png new file mode 100644 index 0000000000000..5ab3f8db6484d Binary files /dev/null and b/docs/html/images/training/enterprise/app_restrictions_diagram.png differ diff --git a/docs/html/images/training/enterprise/app_restrictions_diagram_2x.png b/docs/html/images/training/enterprise/app_restrictions_diagram_2x.png new file mode 100644 index 0000000000000..13a2db1933965 Binary files /dev/null and b/docs/html/images/training/enterprise/app_restrictions_diagram_2x.png differ diff --git a/docs/html/training/enterprise/app-restrictions.jd b/docs/html/training/enterprise/app-restrictions.jd index dd2c2c015bce9..07b1de7b5c177 100644 --- a/docs/html/training/enterprise/app-restrictions.jd +++ b/docs/html/training/enterprise/app-restrictions.jd @@ -152,10 +152,10 @@ enterprise administrator to:
<restrictions xmlns:android="http://schemas.android.com/apk/res/android" > <restriction - android:key="downloadOnCellular" - android:title="App is allowed to download data via cellular" + android:key="download_on_cell" + android:title="@string/download_on_cell_title" android:restrictionType="bool" - android:description="If 'false', app can only download data via Wi-Fi" + android:description="@string/download_on_cell_description" android:defaultValue="true" /> </restrictions> @@ -166,6 +166,12 @@ enterprise administrator to: documented in the reference for {@link android.content.RestrictionsManager}. +
+ Note: bundle and
+ bundle_array restriction types are not supported by Google Play
+ for Work.
+
You use each restriction's android:key attribute to read its
value from a restrictions bundle. For this reason, each restriction must have
@@ -211,7 +217,7 @@ enterprise administrator to:
+ When your app checks for restrictions using + {@link android.content.RestrictionsManager#getApplicationRestrictions + RestrictionsManager.getApplicationRestrictions()}, we recommend that you + check to see if the enterprise administrator has set the key-value pair + {@link android.os.UserManager#KEY_RESTRICTIONS_PENDING} to true. If so, you + should block the user from using the app, and prompt them to contact their + enterprise administrator. The app should then proceed as normal, registering + for the {@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED + ACTION_APPLICATION_RESTRICTIONS_CHANGED} broadcast. +
+ +
+
+ + Figure 1. Checking whether restrictions are pending before + registering for the broadcast. +
+Boolean, int,
- String, and String[]. Once you have the
- restrictions {@link android.os.Bundle}, you can check the current
- restrictions settings with the standard {@link android.os.Bundle} methods for
- those data types, such as {@link android.os.Bundle#getBoolean getBoolean()}
- or
+ String, String[], Bundle, and
+ Bundle[]. Once you have the restrictions {@link android.os.Bundle},
+ you can check the current restrictions settings with the standard
+ {@link android.os.Bundle} methods for those data types, such as
+ {@link android.os.Bundle#getBoolean getBoolean()} or
{@link android.os.Bundle#getString getString()}.
@@ -284,10 +311,11 @@ enterprise administrator to:
It is up to your app to take appropriate action based on the current
- restrictions settings. For example, if your app has a restriction specifying
- whether it can download data over a cellular connection, and you find that
- the restriction is set to false, you would have to disable data
- download except when the device has a Wi-Fi connection, as shown in the
+ restrictions settings. For example, if your app has a restriction schema
+ to specify whether it can download over a cellular connection (like the
+ example in Define App Restrictions),
+ and you find that the restriction is set to false, you would have to disable
+ data download except when the device has a Wi-Fi connection, as shown in the
following example code:
+ Note: The restrictions schema should be + backward and forward compatible, since Google Play for Work + gives the EMM only one version of the App Restrictions + Schema per app. +
+