What Is The Purpose Of The Defaultvalue In The Managed Configurations Xml File?
Solution 1:
You can use the defaultValue
field to explain how your app behaves if the property is not explicitly set by the managing app.
The XML file referenced in the manifest is meant to be used by the MDM to display a UI in their console so the IT admin can configure your app. If you set a defaultValue
for a property the MDM pre-populates the corresponding field when your app is configured for the first time (e.g. display a checked checkbox for a boolean property that default to true
).
For the admin, not configuring your app should be the same as configuring it with the default configuration. Therefore, to be consistent, your app should behave the same way whether a property is unset or set to the defaultValue
.
To see how your configuration will look like in an MDM console you can use the Android Management Experience demo.
Edit: More details on how the restriction schema and defaultValue
can be retrieved
The app's restriction schema defined in the XML file can be retrieved either
- using the Google Play EMM API getAppRestrictionsSchema method which returns the
defaultValue
s for each restriction - or by any app on the device using RestrictionsManager.getManifestRestrictions, where the returned
RestrictionEntry
s have their values set to thedefaultValue
if specified in the XML file, or to a generic default value otherwise (0
forTYPE_INTEGER
,false
forTYPE_BOOLEAN
, etc). You can read the full logic of this method in AOSP's RestrictionManager.java, and see how it is used in TestDPC's ManageAppRestrictionsFragment.java.
Post a Comment for "What Is The Purpose Of The Defaultvalue In The Managed Configurations Xml File?"