docs: work minisite post-launch fixes
* Localization for table of contents. * Replace occurrences of 'app restrictions' with the preferred term 'managed configurations' (see go/afw-words). Update resource card titles and add page redirects. * In guide, update language for SSO with Chrome Custom Tabs. (Cherry-picked from 1056063.) * Add resource card for 'Your Apps at Work' video. bug: 28378252, 27744376 Change-Id: I8bc2e87d0486159bdd6680600b783af7334c3a58
This commit is contained in:
@@ -706,7 +706,9 @@ redirects:
|
||||
- from: /training/enterprise/app-compatibility.html
|
||||
to: /work/managed-profiles.html
|
||||
- from: /training/enterprise/app-restrictions.html
|
||||
to: /work/app-restrictions.html
|
||||
to: /work/managed-configurations.html
|
||||
- from: /work/app-restrictions.html
|
||||
to: /work/managed-configurations.html
|
||||
- from: /training/enterprise/cosu.html
|
||||
to: /work/cosu.html
|
||||
- from: /training/enterprise/device-management-policy.html
|
||||
|
||||
@@ -56,8 +56,8 @@ page.image=images/distribute/gpfw.jpg
|
||||
properly. Businesses are more conscious of data security and
|
||||
employee productivity, especially when it comes to features that
|
||||
share information with other services.</li>
|
||||
<li>Support the <a href="{@docRoot}work/app-restrictions.html"
|
||||
>App Configuration framework</a> to let an administrator remotely
|
||||
<li>Support <a href="{@docRoot}work/managed-configurations.html"
|
||||
>managed configurations</a> to let an administrator remotely
|
||||
configure app settings such as:
|
||||
<ul>
|
||||
<li>Server address and protocol settings</li>
|
||||
@@ -74,16 +74,26 @@ page.image=images/distribute/gpfw.jpg
|
||||
profile</a> and test that with the
|
||||
<a href="{@docRoot}samples/BasicManagedProfile/index.html"
|
||||
>BasicManagedProfile sample app</a>.</li>
|
||||
<li>Support <a href="{@docRoot}work/app-restrictions.html">app restrictions</a>
|
||||
so that IT admins can remotely configure your app through leading
|
||||
EMM solutions.</li>
|
||||
<li>Support <a href="{@docRoot}work/managed-configurations.html"
|
||||
>managed configurations</a> so that IT admins can remotely
|
||||
configure your app through leading EMM solutions.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="support">Provide support and maintenance</h3>
|
||||
|
||||
<ul>
|
||||
<li>Consider offering enhanced support to cover extended hours or specific means of contact. Businesses are often willing to pay for this service.</li>
|
||||
<li>If you update the App Configuration / App Restrictions schema for your app, make sure it remains backward compatible. This is because it’s possible that different users will have different versions of your app (at least temporarily), and IT admin will want a consistent remote configuration experience between versions to ensure efficient management of apps in the field.</li>
|
||||
<li>
|
||||
Consider offering enhanced support to cover extended hours or
|
||||
specific means of contact. Businesses are often willing to pay for
|
||||
this service.
|
||||
</li>
|
||||
<li>
|
||||
If you update the app configuration / managed configuration schema for
|
||||
your app, make sure it remains backward compatible. This is because
|
||||
it’s possible that different users will have different versions of
|
||||
your app (at least temporarily), and IT admin will want a consistent
|
||||
remote configuration experience between versions to ensure efficient
|
||||
management of apps in the field.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id=related_resources>Related resources</h2>
|
||||
|
||||
@@ -1881,7 +1881,7 @@ var RESOURCE_COLLECTIONS = {
|
||||
"work/overview.html",
|
||||
"work/guide.html",
|
||||
"https://www.google.com/work/android/developers/applyDevHub/",
|
||||
"work/app-restrictions.html",
|
||||
"work/managed-configurations.html",
|
||||
"work/cosu.html",
|
||||
"work/managed-profiles.html"
|
||||
]
|
||||
@@ -1893,7 +1893,7 @@ var RESOURCE_COLLECTIONS = {
|
||||
"https://www.google.com/work/android/",
|
||||
"https://developers.google.com/android/work/build-dpc",
|
||||
"https://www.youtube.com/watch?v=jQWB_-o1kz4&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX",
|
||||
"https://www.youtube.com/watch?v=39NkpWkaH8M&index=2&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX",
|
||||
"https://www.youtube.com/watch?v=Za0OQo8DRM4",
|
||||
"https://www.youtube.com/watch?v=dH41OutAMNM&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX"
|
||||
]
|
||||
},
|
||||
@@ -1901,7 +1901,7 @@ var RESOURCE_COLLECTIONS = {
|
||||
"title": "",
|
||||
"resources": [
|
||||
"work/managed-profiles.html",
|
||||
"work/app-restrictions.html",
|
||||
"work/managed-configurations.html",
|
||||
"work/cosu.html",
|
||||
"https://www.youtube.com/watch?v=39NkpWkaH8M&index=2&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX",
|
||||
"samples/AppRestrictionSchema/index.html",
|
||||
|
||||
@@ -3378,6 +3378,18 @@ DISTRIBUTE_RESOURCES = DISTRIBUTE_RESOURCES.concat([
|
||||
"lang":"en",
|
||||
"type":"youtube"
|
||||
},
|
||||
{
|
||||
"title":"Your Apps at Work",
|
||||
"titleFriendly":"",
|
||||
"summary":"In this Google I/O 2016 session we’ll give you details for making your app more attractive to businesses.",
|
||||
"url":"https://www.youtube.com/watch?v=Za0OQo8DRM4",
|
||||
"group":"",
|
||||
"keywords": ["work", "enterprise", "emm"],
|
||||
"tags": [],
|
||||
"image":"https://i1.ytimg.com/vi/Za0OQo8DRM4/maxresdefault.jpg",
|
||||
"lang":"en",
|
||||
"type":"youtube"
|
||||
},
|
||||
{
|
||||
"title":"Discover YouTube cards",
|
||||
"titleFriendly":"",
|
||||
|
||||
@@ -3266,10 +3266,10 @@ METADATA['en'].extras = METADATA['en'].extras.concat([
|
||||
"type":"guide"
|
||||
},
|
||||
{
|
||||
"title":"Set up App Restrictions",
|
||||
"title":"Set up Managed Configurations",
|
||||
"titleFriendly":"",
|
||||
"summary": "Learn how to implement app restrictions and configuration settings that can be changed by other apps on the same device.",
|
||||
"url":"https://developer.android.com/work/app-restrictions.html",
|
||||
"summary": "Learn how to implement managed configurations that can be changed by other apps on the same device.",
|
||||
"url":"https://developer.android.com/work/managed-restrictions.html",
|
||||
"group":"",
|
||||
"keywords": ["work", "enterprise", "emm"],
|
||||
"tags": [],
|
||||
@@ -3397,6 +3397,18 @@ METADATA['en'].extras = METADATA['en'].extras.concat([
|
||||
"lang":"en",
|
||||
"type":"youtube"
|
||||
},
|
||||
{
|
||||
"title":"Your Apps at Work",
|
||||
"titleFriendly":"",
|
||||
"summary":"In this Google I/O 2016 session we’ll give you details for making your app more attractive to businesses.",
|
||||
"url":"https://www.youtube.com/watch?v=Za0OQo8DRM4",
|
||||
"group":"",
|
||||
"keywords": ["work", "enterprise", "emm"],
|
||||
"tags": [],
|
||||
"image":"https://i1.ytimg.com/vi/Za0OQo8DRM4/maxresdefault.jpg",
|
||||
"lang":"en",
|
||||
"type":"youtube"
|
||||
},
|
||||
{
|
||||
"title":"Discover YouTube cards",
|
||||
"category":"google",
|
||||
@@ -5390,7 +5402,7 @@ METADATA['en'].collections = {
|
||||
"work/overview.html",
|
||||
"work/guide.html",
|
||||
"https://www.google.com/work/android/developers/applyDevHub/",
|
||||
"work/app-restrictions.html",
|
||||
"work/managed-configurations.html",
|
||||
"work/cosu.html",
|
||||
"work/managed-profiles.html"
|
||||
]
|
||||
@@ -5402,7 +5414,7 @@ METADATA['en'].collections = {
|
||||
"https://www.google.com/work/android/",
|
||||
"https://developers.google.com/android/work/build-dpc",
|
||||
"https://www.youtube.com/watch?v=jQWB_-o1kz4&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX",
|
||||
"https://www.youtube.com/watch?v=39NkpWkaH8M&index=2&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX",
|
||||
"https://www.youtube.com/watch?v=Za0OQo8DRM4",
|
||||
"https://www.youtube.com/watch?v=dH41OutAMNM&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX"
|
||||
]
|
||||
},
|
||||
@@ -5410,7 +5422,7 @@ METADATA['en'].collections = {
|
||||
"title": "",
|
||||
"resources": [
|
||||
"work/managed-profiles.html",
|
||||
"work/app-restrictions.html",
|
||||
"work/managed-configurations.html",
|
||||
"work/cosu.html",
|
||||
"https://www.youtube.com/watch?v=39NkpWkaH8M&index=2&list=PLOU2XLYxmsIKAK2Bhv19H2THwF-22O5WX",
|
||||
"samples/AppRestrictionSchema/index.html",
|
||||
|
||||
@@ -47,7 +47,7 @@ page.keywords="android for work", "android N", "enterprise", "QR code"
|
||||
<li><a href="#ui-policy">System UI Policy Transparency
|
||||
</a></li>
|
||||
|
||||
<li><a href="#restrictions-mgmt">App Restrictions Management Enhancements
|
||||
<li><a href="#managed-configurations">Managed Configurations Enhancements
|
||||
</a></li>
|
||||
|
||||
<li><a href="#location-off">Location Off Switch
|
||||
@@ -401,11 +401,11 @@ Android N.</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="restrictions-mgmt">App Restrictions Management Enhancements</h2>
|
||||
<h2 id="managed-configurations">Managed Configurations Enhancements</h2>
|
||||
|
||||
<p>
|
||||
The device or profile owner can enable another application to manage app
|
||||
restrictions via the new
|
||||
The device or profile owner can enable another application to manage
|
||||
configurations via the new
|
||||
<code>DevicePolicyManager.setApplicationRestrictionsManagingPackage()</code>
|
||||
method. The nominated application can check whether this permission has been
|
||||
granted by calling
|
||||
@@ -413,7 +413,7 @@ Android N.</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
An application nominated to manage app restrictions can call {@link
|
||||
An application nominated to manage configurations can call {@link
|
||||
android.app.admin.DevicePolicyManager#setApplicationRestrictions
|
||||
setApplicationRestrictions()} and {@link
|
||||
android.app.admin.DevicePolicyManager#getApplicationRestrictions
|
||||
|
||||
@@ -1,18 +1,132 @@
|
||||
toc:
|
||||
- title: Android for Work Home
|
||||
path: /work/index.html
|
||||
path_attributes:
|
||||
- name: es-lang
|
||||
value: Página principal de Android for Work
|
||||
- name: in-lang
|
||||
value: Beranda Android for Work
|
||||
- name: ja-lang
|
||||
value: Android for Work ホーム
|
||||
- name: ko-lang
|
||||
value: Android for Work 홈
|
||||
- name: pt-br-lang
|
||||
value: Página inicial do Android for Work
|
||||
- name: ru-lang
|
||||
value: Главная – Android for Work
|
||||
- name: vi-lang
|
||||
value: Trang chủ Android for Work
|
||||
- name: zh-cn-lang
|
||||
value: Android for Work 首页
|
||||
- name: zh-tw-lang
|
||||
value: Android for Work 首頁
|
||||
|
||||
- title: Overview
|
||||
path: /work/overview.html
|
||||
path_attributes:
|
||||
- name: es-lang
|
||||
value: Información general
|
||||
- name: in-lang
|
||||
value: Ringkasan
|
||||
- name: ja-lang
|
||||
value: 概要
|
||||
- name: ko-lang
|
||||
value: 개요
|
||||
- name: pt-br-lang
|
||||
value: Visão geral
|
||||
- name: ru-lang
|
||||
value: Обзор
|
||||
- name: vi-lang
|
||||
value: Tổng quan
|
||||
- name: zh-cn-lang
|
||||
value: 概览
|
||||
- name: zh-tw-lang
|
||||
value: 總覽
|
||||
|
||||
- title: Developer Guide
|
||||
path: /work/guide.html
|
||||
path_attributes:
|
||||
- name: es-lang
|
||||
value: Guía para desarrolladores
|
||||
- name: in-lang
|
||||
value: Panduan Pengembang
|
||||
- name: ja-lang
|
||||
value: デベロッパー ガイド
|
||||
- name: ko-lang
|
||||
value: 개발자 가이드
|
||||
- name: pt-br-lang
|
||||
value: Guia do desenvolvedor
|
||||
- name: ru-lang
|
||||
value: Руководство для разработчиков
|
||||
- name: vi-lang
|
||||
value: Hướng dẫn cho nhà phát triển
|
||||
- name: zh-cn-lang
|
||||
value: 开发者指南
|
||||
- name: zh-tw-lang
|
||||
value: 開發人員指南
|
||||
|
||||
- title: Set up Managed Profiles
|
||||
path: /work/managed-profiles.html
|
||||
path_attributes:
|
||||
- name: es-lang
|
||||
value: Configurar perfiles administrados
|
||||
- name: in-lang
|
||||
value: Menyiapkan Profil Terkelola
|
||||
- name: ja-lang
|
||||
value: 管理対象プロファイルの設定
|
||||
- name: ko-lang
|
||||
value: 관리 프로필 설정
|
||||
- name: pt-br-lang
|
||||
value: Configurar perfis gerenciados
|
||||
- name: ru-lang
|
||||
value: Настройка управляемых профилей
|
||||
- name: vi-lang
|
||||
value: Thiết lập hồ sơ được quản lý
|
||||
- name: zh-cn-lang
|
||||
value: 设置托管配置文件
|
||||
- name: zh-tw-lang
|
||||
value: 設定受管理的設定檔
|
||||
|
||||
- title: Set up App Restrictions
|
||||
path: /work/app-restrictions.html
|
||||
- title: Set up Managed Configurations
|
||||
path: /work/managed-configurations.html
|
||||
path_attributes:
|
||||
- name: es-lang
|
||||
value: Configurar ajustes administrados
|
||||
- name: in-lang
|
||||
value: Menyiapkan Konfigurasi Terkelola
|
||||
- name: ja-lang
|
||||
value: 管理対象構成の設定
|
||||
- name: ko-lang
|
||||
value: 관리 구성 설정
|
||||
- name: pt-br-lang
|
||||
value: Definir configurações gerenciadas
|
||||
- name: ru-lang
|
||||
value: Настройка управляемых конфигураций
|
||||
- name: vi-lang
|
||||
value: Thiết lập cấu hình được quản lý
|
||||
- name: zh-cn-lang
|
||||
value: 设置托管配置
|
||||
- name: zh-tw-lang
|
||||
value: 設置受管理的設定
|
||||
|
||||
- title: Set up Single-Purpose Devices
|
||||
path: /work/cosu.html
|
||||
path_attributes:
|
||||
- name: es-lang
|
||||
value: Configurar dispositivos con una sola finalidad
|
||||
- name: in-lang
|
||||
value: Menyiapkan Perangkat Tujuan Tunggal
|
||||
- name: ja-lang
|
||||
value: 用途に特化した端末の設定
|
||||
- name: ko-lang
|
||||
value: 단일 목적 기기 설정
|
||||
- name: pt-br-lang
|
||||
value: Configurar dispositivos com uma finalidade específica
|
||||
- name: ru-lang
|
||||
value: Настройка одноцелевых устройств
|
||||
- name: vi-lang
|
||||
value: Thiết lập thiết bị chuyên dùng
|
||||
- name: zh-cn-lang
|
||||
value: 设置单一用途设备
|
||||
- name: zh-tw-lang
|
||||
value: 設定單一用途的裝置
|
||||
|
||||
@@ -128,7 +128,7 @@ Prevents restarting in safe mode
|
||||
<p>
|
||||
Additional COSU management features launched with Marshmallow make it easier to
|
||||
develop and deploy Android devices as a single-use device. If you want to
|
||||
enforce server-side app restrictions or server-side profile policy controls,
|
||||
enforce server-side managed configurations or server-side profile policy controls,
|
||||
you need to use an EMM or make your application a DPC. Follow the instructions
|
||||
below as you create your application.
|
||||
</p>
|
||||
@@ -343,7 +343,7 @@ Keep a device’s screen on while plugged in via
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Set default user restrictions via
|
||||
Set default user restriction for managed configurations via
|
||||
{@link android.app.admin.DevicePolicyManager#addUserRestriction addUserRestriction()}
|
||||
</li>
|
||||
|
||||
@@ -398,7 +398,7 @@ public class CosuActivity extends Activity {
|
||||
}
|
||||
|
||||
private void setDefaultCosuPolicies(boolean active) {
|
||||
// set user restrictions
|
||||
// set managed configurations
|
||||
setUserRestriction(DISALLOW_SAFE_BOOT, active);
|
||||
setUserRestriction(DISALLOW_FACTORY_RESET, active);
|
||||
setUserRestriction(DISALLOW_ADD_USER, active);
|
||||
|
||||
@@ -10,7 +10,7 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
<h2>In this document</h2>
|
||||
<ul>
|
||||
<li><a href="#managed-profiles">Managed Profiles</a></li>
|
||||
<li><a href="#app-restrictions">Implementing App Restrictions</a></li>
|
||||
<li><a href="#managed-configurations">Implementing Managed Configurations</a></li>
|
||||
<li><a href="#cosu">COSU Devices</a></li>
|
||||
<li><a href="#sso">Set up Single Sign-on with Chrome Custom Tabs</a></li>
|
||||
<li><a href="#testing">Test Your App</a></li>
|
||||
@@ -32,7 +32,7 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
app so it functions best on an Android device with a work profile.
|
||||
</li>
|
||||
<li>
|
||||
<a href="#app-restrictions">Managed configuration using app restrictions</a>—Modify
|
||||
<a href="#managed-configurations">Managed configurations</a>—Modify
|
||||
your app to allow IT administrators the option to specify custom
|
||||
settings for your apps.
|
||||
</li>
|
||||
@@ -191,10 +191,10 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
<a href="#testing">Test your app with Android for Work</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="app-restrictions">Implementing App Restrictions</h2>
|
||||
<h2 id="managed-configurations">Implementing Managed Configurations</h2>
|
||||
|
||||
<p>
|
||||
App restrictions are a set of instructions that IT administrators
|
||||
Managed configurations are a set of instructions that IT administrators
|
||||
can use to manage their users’ mobile devices in a specific way.
|
||||
These instructions are universal and work across any EMM, allowing
|
||||
administrators to remotely configure applications on their users’
|
||||
@@ -204,7 +204,7 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
<p>
|
||||
If you’re developing apps for business or government, you may need
|
||||
to satisfy your industry’s specific set of requirements. Using
|
||||
application restrictions, the IT administrator can remotely specify
|
||||
managed configurations, the IT administrator can remotely specify
|
||||
settings and enforce policies for their users’ Android apps; for
|
||||
example:
|
||||
</p>
|
||||
@@ -217,26 +217,26 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
<li>Manage bookmarks</li>
|
||||
</ul>
|
||||
|
||||
<h3>Best practices for implementing app restrictions</h3>
|
||||
<h3>Best practices for implementing managed configurations</h3>
|
||||
|
||||
<p>
|
||||
The <a href="{@docRoot}work/app-restrictions.html">Set up App Restrictions</a>
|
||||
The <a href="{@docRoot}work/managed-configurations.html">Set up Managed Configurations</a>
|
||||
guide is the key source for information on how to build and deploy
|
||||
app restrictions. After you’ve reviewed this documentation, see
|
||||
managed configurations. After you’ve reviewed this documentation, see
|
||||
recommendations below for additional guidance.
|
||||
</p>
|
||||
|
||||
<h4>When first launching the app</h4>
|
||||
<p>
|
||||
As soon as you launch an application, you can see if app
|
||||
restrictions are already set for this app in <code>onStart()</code> or
|
||||
As soon as you launch an application, you can see if managed
|
||||
configurations are already set for this app in <code>onStart()</code> or
|
||||
<code>onResume()</code>. Additionally, you can find out if your
|
||||
application is managed or unmanaged. For example, if
|
||||
<a href="{@docRoot}reference/android/content/RestrictionsManager.html#getApplicationRestrictions()"
|
||||
><code>getApplicationRestrictions()</code></a> returns:
|
||||
<ul>
|
||||
<li><strong>A set of application-specific restrictions</strong>—You
|
||||
can configure the app restrictions silently (without requiring
|
||||
can configure the managed configurations silently (without requiring
|
||||
user input).</li>
|
||||
<li><strong>An empty bundle</strong>—Your application acts like
|
||||
it’s unmanaged (for example, how the app behaves in a personal
|
||||
@@ -250,12 +250,12 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h4>Listen for changes to app restrictions</h4>
|
||||
<h4>Listen for changes to managed configurations</h4>
|
||||
<p>
|
||||
IT administrators can change app restrictions and what policies they
|
||||
want to enforce on their users at any time. Because of this, we
|
||||
recommend you ensure that your app can accept new restrictions as
|
||||
follows:
|
||||
IT administrators can change managed configurations and what
|
||||
policies they want to enforce on their users at any time. Because of
|
||||
this, we recommend you ensure that your app can accept new
|
||||
restrictions for your managed configuration as follows:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
@@ -318,7 +318,7 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
A solution to both problems is to authenticate users using Chrome
|
||||
A solution to both problems is to authenticate users using browser
|
||||
Custom Tabs, instead of WebView. This ensures that authentication:
|
||||
</p>
|
||||
<ul>
|
||||
@@ -335,19 +335,23 @@ page.image=images/work/cards/android-studio_600px.png
|
||||
<h3>Requirements</h3>
|
||||
|
||||
<p>
|
||||
Chrome Custom Tabs are supported using Platform APIs from API level
|
||||
23 (Android 6.0), and support libraries back to API level 4 (Android
|
||||
1.6). To implement Chrome Custom Tabs, you need to use a supported
|
||||
browser, such as Chrome 45 or later.
|
||||
<a href="https://developer.android.com/topic/libraries/support-library/features.html#custom-tabs"
|
||||
>Custom Tabs</a> are supported back to API level 15 (Android 4.0.3).
|
||||
To use Custom Tabs you need a supported browser, such as Chrome.
|
||||
Chrome 45 and later implement this feature as
|
||||
<a href="https://developer.chrome.com/multidevice/android/customtabs">Chrome Custom Tabs</a>.
|
||||
</p>
|
||||
|
||||
<h3>How do I implement Chrome Custom Tabs?</h3>
|
||||
<h3>How do I implement SSO with Custom Tabs?</h3>
|
||||
|
||||
<p>
|
||||
Google, in conjunction with the OpenID Foundation, has published an
|
||||
open source library on GitHub. To set up Chrome Custom Tabs for SSO,
|
||||
see the <a href="https://github.com/openid/AppAuth-Android"
|
||||
>documentation and sample code on GitHub</a>.
|
||||
Google has open sourced an OAuth client library that uses Custom
|
||||
Tabs, contributing it to the OpenID Connect working group of the
|
||||
OpenID Foundation. To set up Custom Tabs for SSO with the
|
||||
AppAuth library, see the <a href="https://github.com/openid/AppAuth-Android"
|
||||
>documentation and sample code on GitHub</a>, or try
|
||||
<a href="https://codelabs.developers.google.com/codelabs/appauth-android-codelab/"
|
||||
>the codelab</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="testing">Test your App with Android for Work</h2>
|
||||
@@ -467,7 +471,7 @@ android.app.extra.PROVISIONING_TIME_ZONE=America/New_York</pre>
|
||||
<li>Follow the onscreen instructions to set up your target device.</li>
|
||||
<li>Once you’ve completed provisioning the device owner, you can test your app on that device. You
|
||||
should specifically test how
|
||||
<a href="{@docRoot}work/app-restrictions.html">app restrictions</a>,
|
||||
<a href="{@docRoot}work/managed-configurations.html">managed configurations</a>,
|
||||
<a href="{@docRoot}work/managed-profiles.html#sharing_files">URIs</a>, and
|
||||
<a href="{@docRoot}work/managed-profiles.html#prevent_failed_intents">intents</a>
|
||||
work on that device.</li>
|
||||
@@ -484,7 +488,7 @@ android.app.extra.PROVISIONING_TIME_ZONE=America/New_York</pre>
|
||||
|
||||
<ul>
|
||||
<li>App distribution through Play</li>
|
||||
<li>Server-side app restriction configuration</li>
|
||||
<li>Server-side managed configuration</li>
|
||||
<li>Server-side profile policy control</li>
|
||||
</ul>
|
||||
|
||||
@@ -510,7 +514,7 @@ android.app.extra.PROVISIONING_TIME_ZONE=America/New_York</pre>
|
||||
<ol>
|
||||
<li>Set up work devices.</li>
|
||||
<li>Distribute your application.</li>
|
||||
<li>Set application restrictions.</li>
|
||||
<li>Set managed configuration.</li>
|
||||
<li>Set device policies.</li>
|
||||
</ol>
|
||||
</ol>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
page.title=Set up App Restrictions
|
||||
page.metaDescription=Learn how to implement app restrictions and configuration settings that can be changed by other apps on the same device.
|
||||
page.title=Set up Managed Configurations
|
||||
page.metaDescription=Learn how to implement managed configurations that can be changed by other apps on the same device.
|
||||
page.image=images/work/cards/briefcase_600px.png
|
||||
|
||||
@jd:body
|
||||
@@ -8,18 +8,21 @@ page.image=images/work/cards/briefcase_600px.png
|
||||
<div id="qv">
|
||||
<h2>In this document</h2>
|
||||
<ol>
|
||||
<li><a href="#define_restrictions">Define App Restrictions</a></li>
|
||||
<li><a href="#check_restrictions">Check App Restrictions</a></li>
|
||||
<li><a href="#listen">Listen for App Restriction Changes</a></li>
|
||||
<li><a href="#define-configuration">Define Managed Configurations</a></li>
|
||||
<li><a href="#check-configuration">Check Managed Configurations</a></li>
|
||||
<li><a href="#listen-configuration">Listen for Managed Configuration Changes</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>If you are developing apps for the enterprise market, you may need to satisfy
|
||||
particular requirements set by a company's policies. Application restrictions
|
||||
allow the enterprise administrator to remotely specify settings for apps.
|
||||
This capability is particularly useful for enterprise-approved apps deployed to
|
||||
a managed profile.</p>
|
||||
<p>
|
||||
If you are developing apps for the enterprise market, you may need
|
||||
to satisfy particular requirements set by a company's policies.
|
||||
Managed configurations, previously known as <em>application restrictions</em>,
|
||||
allow the enterprise administrator to remotely specify settings for
|
||||
apps. This capability is particularly useful for enterprise-approved
|
||||
apps deployed to a managed profile.
|
||||
</p>
|
||||
|
||||
<p>For example, an enterprise might require that approved apps allow the
|
||||
enterprise administrator to:</p>
|
||||
@@ -48,55 +51,55 @@ enterprise administrator to:</p>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
Apps define the restrictions and configuration options that can be remotely
|
||||
set by an administrator. These restrictions are
|
||||
arbitrary configuration settings that can be changed by a restrictions
|
||||
provider. If your app is running on an enterprise device's managed
|
||||
profile, the enterprise administrator can change your app's restrictions.
|
||||
Apps define the managed configuration options that can be remotely
|
||||
set by an administrator. These are arbitrary settings that can be
|
||||
changed by a managed configuration provider. If your app is running on an
|
||||
enterprise device's managed profile, the enterprise administrator
|
||||
can change your app's managed configuration.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The restrictions provider is another app running on the same device.
|
||||
The managed configurations provider is another app running on the same device.
|
||||
This app is typically controlled by the enterprise administrator. The
|
||||
enterprise administrator communicates restriction changes to the restrictions
|
||||
provider app. That app, in turn, changes the restrictions on your app.
|
||||
enterprise administrator communicates configuration changes to the managed
|
||||
configuration provider app. That app, in turn, changes the configurations on your app.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To provide externally configurable restrictions:
|
||||
To provide externally managed configurations:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Declare the restrictions in your app manifest. Doing so allows the
|
||||
enterprise administrator to read the app's restrictions through Google
|
||||
Play APIs.
|
||||
<li>Declare the managed configurations in your app manifest. Doing
|
||||
so allows the enterprise administrator to read the app's
|
||||
configurations through Google Play APIs.
|
||||
</li>
|
||||
|
||||
<li>Whenever the app resumes, use the {@link
|
||||
android.content.RestrictionsManager} object to check the current
|
||||
restrictions, and change your app's UI and behavior to conform with those
|
||||
restrictions.
|
||||
managed configurations, and change your app's UI and behavior to
|
||||
conform with those configurations.
|
||||
</li>
|
||||
|
||||
<li>Listen for the
|
||||
{@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED
|
||||
ACTION_APPLICATION_RESTRICTIONS_CHANGED} intent. When you receive this
|
||||
broadcast, check the {@link android.content.RestrictionsManager} to see what
|
||||
the current restrictions are, and make any necessary changes to your app's
|
||||
behavior.
|
||||
the current managed configurations are, and make any necessary changes to your
|
||||
app's behavior.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="define_restrictions">
|
||||
Define App Restrictions
|
||||
<h2 id="define-configuration">
|
||||
Define Managed Configurations
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
Your app can support any restrictions you want to define. You declare the
|
||||
app's restrictions in a <em>restrictions file</em>, and declare the
|
||||
restrictions file in the manifest. Creating a restrictions file allows other
|
||||
apps to examine the restrictions your app provides. Enterprise Mobility
|
||||
Management (EMM) partners can read your app's restrictions by using Google
|
||||
Your app can support any managed configuration you want to define. You declare the
|
||||
app's managed configurations in a <em>managed configurations file</em>, and declare the
|
||||
configurations file in the manifest. Creating a configurations file allows other
|
||||
apps to examine the managed configurations your app provides. Enterprise Mobility
|
||||
Management (EMM) partners can read your app's configurations by using Google
|
||||
Play APIs.
|
||||
</p>
|
||||
|
||||
@@ -121,15 +124,17 @@ enterprise administrator to:</p>
|
||||
</p>
|
||||
|
||||
<p class="note">
|
||||
<strong>Note:</strong> Do not create localized versions of the restrictions
|
||||
file. Your app is only allowed to have a single restrictions file,
|
||||
so restrictions will be consistent for your app in all locales.
|
||||
<strong>Note:</strong> Do not create localized versions of the
|
||||
managed configuration file. Your app is only allowed to have a
|
||||
single managed configurations file, so configurations will be
|
||||
consistent for your app in all locales.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In an enterprise environment, an EMM will typically use the restrictions
|
||||
schema to generate a remote console for IT administrators, so the
|
||||
administrators can remotely configure your application.
|
||||
In an enterprise environment, an EMM will typically use the managed
|
||||
configuration schema to generate a remote console for IT
|
||||
administrators, so the administrators can remotely configure your
|
||||
application.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -158,10 +163,10 @@ enterprise administrator to:</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You use each restriction's <code>android:key</code> attribute to read its
|
||||
value from a restrictions bundle. For this reason, each restriction must have
|
||||
a unique key string, and the string <em>cannot</em> be localized. It must be
|
||||
specified with a string literal.
|
||||
You use each configuration's <code>android:key</code> attribute to
|
||||
read its value from a managed configuration bundle. For this reason,
|
||||
each configuration must have a unique key string, and the string
|
||||
<em>cannot</em> be localized. It must be specified with a string literal.
|
||||
</p>
|
||||
|
||||
<p class="note">
|
||||
@@ -173,27 +178,29 @@ enterprise administrator to:</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The restrictions provider can query the app to find details on the app's
|
||||
available restrictions, including their description text. Restrictions
|
||||
providers and enterprise administrators can change your app's restrictions at
|
||||
any time, even when the app is not running.
|
||||
The managed configuration provider can query the app to find details
|
||||
on the app's available configurations, including their description
|
||||
text. Configurations providers and enterprise administrators can
|
||||
change your app's managed configurations at any time, even when the
|
||||
app is not running.
|
||||
</p>
|
||||
|
||||
<h2 id="check_restrictions">
|
||||
Check App Restrictions
|
||||
<h2 id="check-configuration">
|
||||
Check Managed Configurations
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
Your app is not automatically notified when other apps change its restriction
|
||||
settings. Instead, you need to check what the restrictions are when your app
|
||||
starts or resumes, and listen for a system intent to find out if the
|
||||
restrictions change while your app is running.
|
||||
Your app is not automatically notified when other apps change its
|
||||
configuration settings. Instead, you need to check what the managed
|
||||
configurations are when your app starts or resumes, and listen for a
|
||||
system intent to find out if the configurations change while your
|
||||
app is running.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To find out the current restriction settings, your app uses a {@link
|
||||
android.content.RestrictionsManager} object. Your app should check for the
|
||||
current restrictions at the following times:
|
||||
To find out the current configuration settings, your app uses a
|
||||
{@link android.content.RestrictionsManager} object. Your app should
|
||||
check for the current managed configurations at the following times:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
@@ -201,8 +208,8 @@ enterprise administrator to:</p>
|
||||
{@link android.app.Activity#onResume onResume()} method
|
||||
</li>
|
||||
|
||||
<li>When the app is notified of a restriction change, as described in
|
||||
<a href="#listen">Listen for Device Configuration
|
||||
<li>When the app is notified of a configuration change, as described in
|
||||
<a href="#listen-configuration">Listen for Managed Configuration
|
||||
Changes</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -219,8 +226,8 @@ enterprise administrator to:</p>
|
||||
.getSystemService(Context.RESTRICTIONS_SERVICE);</pre>
|
||||
|
||||
<p>
|
||||
Once you have a {@link android.content.RestrictionsManager}, you can get the current restrictions
|
||||
settings by calling its
|
||||
Once you have a {@link android.content.RestrictionsManager}, you can get the
|
||||
current configuration settings by calling its
|
||||
{@link android.content.RestrictionsManager#getApplicationRestrictions
|
||||
getApplicationRestrictions()} method:
|
||||
</p>
|
||||
@@ -229,8 +236,8 @@ enterprise administrator to:</p>
|
||||
|
||||
<p class="note">
|
||||
<strong>Note:</strong> For convenience, you can also fetch the current
|
||||
restrictions with a {@link android.os.UserManager}, by calling {@link
|
||||
android.os.UserManager#getApplicationRestrictions
|
||||
configurations with a {@link android.os.UserManager}, by calling
|
||||
{@link android.os.UserManager#getApplicationRestrictions
|
||||
UserManager.getApplicationRestrictions()}. This method behaves exactly the
|
||||
same as {@link android.content.RestrictionsManager#getApplicationRestrictions
|
||||
RestrictionsManager.getApplicationRestrictions()}.
|
||||
@@ -240,46 +247,46 @@ enterprise administrator to:</p>
|
||||
The {@link android.content.RestrictionsManager#getApplicationRestrictions
|
||||
getApplicationRestrictions()} method requires reading from data storage, so
|
||||
it should be done sparingly. Do not call this method every time you need to
|
||||
know the current restrictions. Instead, you should call it once when your app
|
||||
starts or resumes, and cache the fetched restrictions bundle. Then listen for
|
||||
the {@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED
|
||||
ACTION_APPLICATION_RESTRICTIONS_CHANGED} intent to find out if restrictions
|
||||
change while your app is active, as described in <a href="#listen">Listen for
|
||||
Device Configuration Changes</a>.
|
||||
know the current configuration. Instead, you should call it once when your app
|
||||
starts or resumes, and cache the fetched managed configurations bundle. Then listen
|
||||
for the {@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED
|
||||
ACTION_APPLICATION_RESTRICTIONS_CHANGED} intent to find out if the configuration
|
||||
change while your app is active, as described in
|
||||
<a href="#listen-configuration">Listen for Managed Configuration Changes</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="read_restrictions">
|
||||
Reading and applying restrictions
|
||||
<h3 id="read-configurations">
|
||||
Reading and applying managed configurations
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
The {@link android.content.RestrictionsManager#getApplicationRestrictions
|
||||
getApplicationRestrictions()} method returns a {@link android.os.Bundle}
|
||||
containing a key-value pair for each restriction that has been set. The
|
||||
containing a key-value pair for each configuration that has been set. The
|
||||
values are all of type <code>Boolean</code>, <code>int</code>,
|
||||
<code>String</code>, and <code>String[]</code>. 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
|
||||
managed configurations {@link android.os.Bundle}, you can check the current
|
||||
configuration 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()}.
|
||||
</p>
|
||||
|
||||
<p class="note">
|
||||
<strong>Note:</strong> The restrictions {@link android.os.Bundle} contains
|
||||
one item for every restriction that has been explicitly set by a restrictions
|
||||
provider. However, you <em>cannot</em> assume that a restriction will be
|
||||
present in the bundle just because you defined a default value in the
|
||||
restrictions XML file.
|
||||
<strong>Note:</strong> The managed configurations {@link android.os.Bundle}
|
||||
contains one item for every configuration that has been explicitly set by a
|
||||
managed configurations provider. However, you <em>cannot</em> assume that a
|
||||
configuration will be present in the bundle just because you defined a default
|
||||
value in the managed configurations XML file.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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 <code>false</code>, you would have to disable data
|
||||
download except when the device has a Wi-Fi connection, as shown in the
|
||||
following example code:
|
||||
managed configuration settings. For example, if your app has a
|
||||
configuration specifying whether it can download data over a
|
||||
cellular connection, and you find that the configuration is set to
|
||||
<code>false</code>, you would have to disable data download except when
|
||||
the device has a Wi-Fi connection, as shown in the following example code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -298,15 +305,15 @@ if (!appCanUseCellular) {
|
||||
// ...show appropriate notices to user
|
||||
}</pre>
|
||||
|
||||
<h2 id="listen">
|
||||
Listen for App Restriction Changes
|
||||
<h2 id="listen-configuration">
|
||||
Listen for Managed Configuration Changes
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
Whenever an app's restrictions are changed, the system fires the
|
||||
Whenever an app's managed configurations are changed, the system fires the
|
||||
{@link android.content.Intent#ACTION_APPLICATION_RESTRICTIONS_CHANGED
|
||||
ACTION_APPLICATION_RESTRICTIONS_CHANGED} intent. Your app has to listen for
|
||||
this intent so you can change the app's behavior when the restriction settings
|
||||
this intent so you can change the app's behavior when the configuration settings
|
||||
change.</p>
|
||||
|
||||
<p class="note">
|
||||
@@ -327,26 +334,22 @@ if (!appCanUseCellular) {
|
||||
BroadcastReceiver restrictionsReceiver = new BroadcastReceiver() {
|
||||
@Override public void onReceive(Context context, Intent intent) {
|
||||
|
||||
// Get the current restrictions bundle
|
||||
Bundle <code>appRestrictions</code> =
|
||||
// Get the current configuration bundle
|
||||
Bundle appRestrictions = myRestrictionsMgr.getApplicationRestrictions();
|
||||
|
||||
myRestrictionsMgr.getApplicationRestrictions();
|
||||
|
||||
// Check current restrictions settings, change your app's UI and
|
||||
// Check current configuration settings, change your app's UI and
|
||||
// functionality as necessary.
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
registerReceiver(restrictionsReceiver, restrictionsFilter);
|
||||
</pre>
|
||||
<p class="note">
|
||||
<strong>Note:</strong> Ordinarily, your app does not need to be notified
|
||||
about restriction changes when it is paused. Instead, you should unregister
|
||||
about configuration changes when it is paused. Instead, you should unregister
|
||||
your broadcast receiver when the app is paused. When the app resumes, you
|
||||
first check for the current restrictions (as discussed in <a href=
|
||||
"#check_restrictions">Check Device Restrictions</a>), then register your
|
||||
broadcast receiver to make sure you're notified about restriction changes
|
||||
first check for the current managed configurations (as discussed in
|
||||
<a href="#check-configuration">Check Managed Configurations</a>), then register
|
||||
your broadcast receiver to make sure you're notified about configuration changes
|
||||
that happen while the app is active.
|
||||
</p>
|
||||
@@ -1,44 +0,0 @@
|
||||
<ul id="nav">
|
||||
|
||||
<li class="nav-section">
|
||||
<div class="nav-section-header empty">
|
||||
<a href="<?cs var:toroot ?>work/index.html">
|
||||
Android for Work Home</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-section">
|
||||
<div class="nav-section-header empty">
|
||||
<a href="<?cs var:toroot ?>work/overview.html">
|
||||
Overview</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-section">
|
||||
<div class="nav-section-header empty">
|
||||
<a href="<?cs var:toroot ?>work/guide.html">
|
||||
Developer Guide</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-section">
|
||||
<div class="nav-section-header empty">
|
||||
<a href="<?cs var:toroot ?>work/managed-profiles.html">
|
||||
Set up Managed Profiles</a></div>
|
||||
</li>
|
||||
|
||||
<li class="nav-section">
|
||||
<div class="nav-section-header empty">
|
||||
<a href="<?cs var:toroot ?>work/app-restrictions.html">
|
||||
Set up App Restrictions</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-section">
|
||||
<div class="nav-section-header empty">
|
||||
<a href="<?cs var:toroot ?>work/cosu.html">
|
||||
Set up Single-Purpose Devices</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
Reference in New Issue
Block a user