• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2013 The Android Open Source Project
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<sample>
18    <name>AppRestrictions</name>
19    <group>Content</group>
20    <package>com.example.android.apprestrictions</package>
21
22    <!-- change minSdk if needed-->
23    <minSdk>18</minSdk>
24
25    <strings>
26        <intro>
27            <![CDATA[
28            This sample demonstrates the use of the App Restriction feature, which is available on
29            Android 4.3 and above tablet device with the multiuser feature.
30
31            When launched under the primary User account, you can toggle between standard app restriction
32            types and custom.  When launched under a restricted profile, this activity displays app
33            restriction settings, if available.
34            ]]>
35        </intro>
36    </strings>
37
38    <template src="base"/>
39
40
41    <metadata>
42    <status>PUBLISHED</status>
43    <categories>content</categories>
44    <technologies>Android</technologies>
45    <languages>Java</languages>
46    <solutions>Mobile</solutions>
47    <level>INTERMEDIATE</level>
48    <icon>screenshots/big_icon.png</icon>
49    <screenshots>
50        <img>screenshots/1-application.png</img>
51        <img>screenshots/2-custom-restrictions-actiivity.png</img>
52    </screenshots>
53
54    <api_refs>
55        <android>android.content.RestrictionEntry</android>
56        <android>android.os.UserManager</android>
57    </api_refs>
58
59    <description>
60        <![CDATA[
61A sample that demonstrates the use of the App Restriction feature on devices with multiuser support
62]]>
63    </description>
64        <intro>
65            <![CDATA[
66This sample demonstrates the use of the App Restriction feature, which is available on
67Android 4.3 and above tablet device with the multiuser feature.
68
69When launched under the primary User account, you can toggle between standard app restriction
70types and custom.  When launched under a restricted profile, this activity displays app
71restriction settings, if available.
72
73This sample app maintains custom app restriction settings in shared preferences.  When
74the activity is invoked (from Settings > Users), the stored settings are used to initialize
75the custom configuration on the user interface.  Three sample [RestrictionEntry][1] types are
76shown: checkbox, single-choice, and multi-choice.  When the settings are modified by the user,
77the corresponding restriction entries are saved, which are retrievable under a restricted
78profile through the [UserManager][2].
79
80[1]: https://developer.android.com/reference/android/content/RestrictionEntry.html
81[2]: https://developer.android.com/reference/android/os/UserManager.html
82
83
84]]>
85        </intro>
86    </metadata>
87</sample>
88