Policy class
A policy resource represents a group of settings that govern the behavior of a managed device and the apps installed on it.
Constructors
-
Policy({List<
String> ? accountTypesWithManagementDisabled, bool? addUserDisabled, bool? adjustVolumeDisabled, AdvancedSecurityOverrides? advancedSecurityOverrides, AlwaysOnVpnPackage? alwaysOnVpnPackage, List<String> ? androidDevicePolicyTracks, String? appAutoUpdatePolicy, List<ApplicationPolicy> ? applications, String? autoDateAndTimeZone, bool? autoTimeRequired, bool? blockApplicationsEnabled, bool? bluetoothConfigDisabled, bool? bluetoothContactSharingDisabled, bool? bluetoothDisabled, String? cameraAccess, bool? cameraDisabled, bool? cellBroadcastsConfigDisabled, List<ChoosePrivateKeyRule> ? choosePrivateKeyRules, List<ComplianceRule> ? complianceRules, bool? createWindowsDisabled, String? credentialProviderPolicyDefault, bool? credentialsConfigDisabled, CrossProfilePolicies? crossProfilePolicies, bool? dataRoamingDisabled, bool? debuggingFeaturesAllowed, String? defaultPermissionPolicy, DeviceConnectivityManagement? deviceConnectivityManagement, UserFacingMessage? deviceOwnerLockScreenInfo, DeviceRadioState? deviceRadioState, String? encryptionPolicy, bool? ensureVerifyAppsEnabled, bool? factoryResetDisabled, List<String> ? frpAdminEmails, bool? funDisabled, bool? installAppsDisabled, bool? installUnknownSourcesAllowed, bool? keyguardDisabled, List<String> ? keyguardDisabledFeatures, bool? kioskCustomLauncherEnabled, KioskCustomization? kioskCustomization, String? locationMode, UserFacingMessage? longSupportMessage, String? maximumTimeToLock, String? microphoneAccess, int? minimumApiLevel, bool? mobileNetworksConfigDisabled, bool? modifyAccountsDisabled, bool? mountPhysicalMediaDisabled, String? name, bool? networkEscapeHatchEnabled, bool? networkResetDisabled, List<OncCertificateProvider> ? oncCertificateProviders, Map<String, Object?> ? openNetworkConfiguration, bool? outgoingBeamDisabled, bool? outgoingCallsDisabled, List<PasswordRequirements> ? passwordPolicies, PasswordRequirements? passwordRequirements, List<PermissionGrant> ? permissionGrants, PackageNameList? permittedAccessibilityServices, PackageNameList? permittedInputMethods, List<PersistentPreferredActivity> ? persistentPreferredActivities, PersonalUsagePolicies? personalUsagePolicies, String? playStoreMode, List<PolicyEnforcementRule> ? policyEnforcementRules, String? preferentialNetworkService, String? printingPolicy, bool? privateKeySelectionEnabled, ProxyInfo? recommendedGlobalProxy, bool? removeUserDisabled, bool? safeBootDisabled, bool? screenCaptureDisabled, bool? setUserIconDisabled, bool? setWallpaperDisabled, List<SetupAction> ? setupActions, UserFacingMessage? shortSupportMessage, bool? skipFirstUseHintsEnabled, bool? smsDisabled, bool? statusBarDisabled, StatusReportingSettings? statusReportingSettings, List<String> ? stayOnPluggedModes, SystemUpdate? systemUpdate, bool? tetheringConfigDisabled, bool? uninstallAppsDisabled, bool? unmuteMicrophoneDisabled, UsageLog? usageLog, bool? usbFileTransferDisabled, bool? usbMassStorageEnabled, String? version, bool? vpnConfigDisabled, bool? wifiConfigDisabled, bool? wifiConfigsLockdownEnabled}) - Policy.fromJson(Map json_)
Properties
-
accountTypesWithManagementDisabled
↔ List<
String> ? -
Account types that can't be managed by the user.
getter/setter pair
- addUserDisabled ↔ bool?
-
Whether adding new users and profiles is disabled.
getter/setter pair
- adjustVolumeDisabled ↔ bool?
-
Whether adjusting the master volume is disabled.
getter/setter pair
- advancedSecurityOverrides ↔ AdvancedSecurityOverrides?
-
Advanced security settings.
getter/setter pair
- alwaysOnVpnPackage ↔ AlwaysOnVpnPackage?
-
Configuration for an always-on VPN connection.
getter/setter pair
-
androidDevicePolicyTracks
↔ List<
String> ? -
This setting is not supported.
getter/setter pair
- appAutoUpdatePolicy ↔ String?
-
Recommended alternative: autoUpdateMode which is set per app, provides
greater flexibility around update frequency.When autoUpdateMode is set to
AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, this field has no
effect.The app auto update policy, which controls when automatic app
updates can be applied.
Possible string values are:
getter/setter pair
-
applications
↔ List<
ApplicationPolicy> ? -
Policy applied to apps.
getter/setter pair
- autoDateAndTimeZone ↔ String?
-
Whether auto date, time, and time zone are enabled on a company-owned
device.
getter/setter pair
- autoTimeRequired ↔ bool?
-
Whether auto time is required, which prevents the user from manually
setting the date and time.
getter/setter pair
- blockApplicationsEnabled ↔ bool?
-
Whether applications other than the ones configured in applications are
blocked from being installed.
getter/setter pair
- bluetoothConfigDisabled ↔ bool?
-
Whether configuring bluetooth is disabled.
getter/setter pair
- bluetoothContactSharingDisabled ↔ bool?
-
Whether bluetooth contact sharing is disabled.
getter/setter pair
- bluetoothDisabled ↔ bool?
-
Whether bluetooth is disabled.
getter/setter pair
- cameraAccess ↔ String?
-
Controls the use of the camera and whether the user has access to the
camera access toggle.
Possible string values are:
getter/setter pair
- cameraDisabled ↔ bool?
-
If camera_access is set to any value other than CAMERA_ACCESS_UNSPECIFIED,
this has no effect.
getter/setter pair
- cellBroadcastsConfigDisabled ↔ bool?
-
Whether configuring cell broadcast is disabled.
getter/setter pair
-
choosePrivateKeyRules
↔ List<
ChoosePrivateKeyRule> ? -
Rules for determining apps' access to private keys.
getter/setter pair
-
complianceRules
↔ List<
ComplianceRule> ? -
Rules declaring which mitigating actions to take when a device is not
compliant with its policy.
getter/setter pair
- createWindowsDisabled ↔ bool?
-
Whether creating windows besides app windows is disabled.
getter/setter pair
- credentialProviderPolicyDefault ↔ String?
-
Controls which apps are allowed to act as credential providers on Android
14 and above.
getter/setter pair
- credentialsConfigDisabled ↔ bool?
-
Whether configuring user credentials is disabled.
getter/setter pair
- crossProfilePolicies ↔ CrossProfilePolicies?
-
Cross-profile policies applied on the device.
getter/setter pair
- dataRoamingDisabled ↔ bool?
-
Whether roaming data services are disabled.
getter/setter pair
- debuggingFeaturesAllowed ↔ bool?
-
Whether the user is allowed to enable debugging features.
getter/setter pair
- defaultPermissionPolicy ↔ String?
-
The default permission policy for runtime permission requests.
Possible string values are:
getter/setter pair
- deviceConnectivityManagement ↔ DeviceConnectivityManagement?
-
Covers controls for device connectivity such as Wi-Fi, USB data access,
keyboard/mouse connections, and more.
getter/setter pair
- deviceOwnerLockScreenInfo ↔ UserFacingMessage?
-
The device owner information to be shown on the lock screen.
getter/setter pair
- deviceRadioState ↔ DeviceRadioState?
-
Covers controls for radio state such as Wi-Fi, bluetooth, and more.
getter/setter pair
- encryptionPolicy ↔ String?
-
Whether encryption is enabled
Possible string values are:
getter/setter pair
- ensureVerifyAppsEnabled ↔ bool?
-
Whether app verification is force-enabled.
getter/setter pair
- factoryResetDisabled ↔ bool?
-
Whether factory resetting from settings is disabled.
getter/setter pair
-
frpAdminEmails
↔ List<
String> ? -
Email addresses of device administrators for factory reset protection.
getter/setter pair
- funDisabled ↔ bool?
-
Whether the user is allowed to have fun.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- installAppsDisabled ↔ bool?
-
Whether user installation of apps is disabled.
getter/setter pair
- installUnknownSourcesAllowed ↔ bool?
-
This field has no effect.
getter/setter pair
- keyguardDisabled ↔ bool?
-
If true, this disables the Lock Screen
(https://source.android.com/docs/core/display/multi_display/lock-screen)
for primary and/or secondary displays.
getter/setter pair
-
keyguardDisabledFeatures
↔ List<
String> ? -
Disabled keyguard customizations, such as widgets.
getter/setter pair
- kioskCustomization ↔ KioskCustomization?
-
Settings controlling the behavior of a device in kiosk mode.
getter/setter pair
- kioskCustomLauncherEnabled ↔ bool?
-
Whether the kiosk custom launcher is enabled.
getter/setter pair
- locationMode ↔ String?
-
The degree of location detection enabled.
Possible string values are:
getter/setter pair
- longSupportMessage ↔ UserFacingMessage?
-
A message displayed to the user in the device administators settings
screen.
getter/setter pair
- maximumTimeToLock ↔ String?
-
Maximum time in milliseconds for user activity until the device locks.
getter/setter pair
- microphoneAccess ↔ String?
-
Controls the use of the microphone and whether the user has access to the
microphone access toggle.
getter/setter pair
- minimumApiLevel ↔ int?
-
The minimum allowed Android API level.
getter/setter pair
- mobileNetworksConfigDisabled ↔ bool?
-
Whether configuring mobile networks is disabled.
getter/setter pair
- modifyAccountsDisabled ↔ bool?
-
Whether adding or removing accounts is disabled.
getter/setter pair
- mountPhysicalMediaDisabled ↔ bool?
-
Whether the user mounting physical external media is disabled.
getter/setter pair
- name ↔ String?
-
The name of the policy in the form
enterprises/{enterpriseId}/policies/{policyId}.
getter/setter pair
- networkEscapeHatchEnabled ↔ bool?
-
Whether the network escape hatch is enabled.
getter/setter pair
- networkResetDisabled ↔ bool?
-
Whether resetting network settings is disabled.
getter/setter pair
-
oncCertificateProviders
↔ List<
OncCertificateProvider> ? -
This feature is not generally available.
getter/setter pair
-
openNetworkConfiguration
↔ Map<
String, Object?> ? -
Network configuration for the device.
getter/setter pair
- outgoingBeamDisabled ↔ bool?
-
Whether using NFC to beam data from apps is disabled.
getter/setter pair
- outgoingCallsDisabled ↔ bool?
-
Whether outgoing calls are disabled.
getter/setter pair
-
passwordPolicies
↔ List<
PasswordRequirements> ? -
Password requirement policies.
getter/setter pair
- passwordRequirements ↔ PasswordRequirements?
-
Password requirements.
getter/setter pair
-
permissionGrants
↔ List<
PermissionGrant> ? -
Explicit permission or group grants or denials for all apps.
getter/setter pair
- permittedAccessibilityServices ↔ PackageNameList?
-
Specifies permitted accessibility services.
getter/setter pair
- permittedInputMethods ↔ PackageNameList?
-
If present, only the input methods provided by packages in this list are
permitted.
getter/setter pair
-
persistentPreferredActivities
↔ List<
PersistentPreferredActivity> ? -
Default intent handler activities.
getter/setter pair
- personalUsagePolicies ↔ PersonalUsagePolicies?
-
Policies managing personal usage on a company-owned device.
getter/setter pair
- playStoreMode ↔ String?
-
This mode controls which apps are available to the user in the Play Store
and the behavior on the device when apps are removed from the policy.
Possible string values are:
getter/setter pair
-
policyEnforcementRules
↔ List<
PolicyEnforcementRule> ? -
Rules that define the behavior when a particular policy can not be applied
on device
getter/setter pair
- preferentialNetworkService ↔ String?
-
Controls whether preferential network service is enabled on the work
profile.
getter/setter pair
- printingPolicy ↔ String?
-
Controls whether printing is allowed.
getter/setter pair
- privateKeySelectionEnabled ↔ bool?
-
Allows showing UI on a device for a user to choose a private key alias if
there are no matching rules in ChoosePrivateKeyRules.
getter/setter pair
- recommendedGlobalProxy ↔ ProxyInfo?
-
The network-independent global HTTP proxy.
getter/setter pair
- removeUserDisabled ↔ bool?
-
Whether removing other users is disabled.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- safeBootDisabled ↔ bool?
-
Whether rebooting the device into safe boot is disabled.
getter/setter pair
- screenCaptureDisabled ↔ bool?
-
Whether screen capture is disabled.
getter/setter pair
-
setupActions
↔ List<
SetupAction> ? -
Action to take during the setup process.
getter/setter pair
- setUserIconDisabled ↔ bool?
-
Whether changing the user icon is disabled.
getter/setter pair
- setWallpaperDisabled ↔ bool?
-
Whether changing the wallpaper is disabled.
getter/setter pair
-
Whether location sharing is disabled.
getter/setter pair
- shortSupportMessage ↔ UserFacingMessage?
-
A message displayed to the user in the settings screen wherever
functionality has been disabled by the admin.
getter/setter pair
- skipFirstUseHintsEnabled ↔ bool?
-
Flag to skip hints on the first use.
getter/setter pair
- smsDisabled ↔ bool?
-
Whether sending and receiving SMS messages is disabled.
getter/setter pair
- statusBarDisabled ↔ bool?
-
Whether the status bar is disabled.
getter/setter pair
- statusReportingSettings ↔ StatusReportingSettings?
-
Status reporting settings
getter/setter pair
-
stayOnPluggedModes
↔ List<
String> ? -
The battery plugged in modes for which the device stays on.
getter/setter pair
- systemUpdate ↔ SystemUpdate?
-
The system update policy, which controls how OS updates are applied.
getter/setter pair
- tetheringConfigDisabled ↔ bool?
-
Whether configuring tethering and portable hotspots is disabled.
getter/setter pair
- uninstallAppsDisabled ↔ bool?
-
Whether user uninstallation of applications is disabled.
getter/setter pair
- unmuteMicrophoneDisabled ↔ bool?
-
If microphone_access is set to any value other than
MICROPHONE_ACCESS_UNSPECIFIED, this has no effect.
getter/setter pair
- usageLog ↔ UsageLog?
-
Configuration of device activity logging.
getter/setter pair
- usbFileTransferDisabled ↔ bool?
-
Whether transferring files over USB is disabled.
getter/setter pair
- usbMassStorageEnabled ↔ bool?
-
Whether USB storage is enabled.
getter/setter pair
- version ↔ String?
-
The version of the policy.
getter/setter pair
- vpnConfigDisabled ↔ bool?
-
Whether configuring VPN is disabled.
getter/setter pair
- wifiConfigDisabled ↔ bool?
-
Whether configuring Wi-Fi networks is disabled.
getter/setter pair
- wifiConfigsLockdownEnabled ↔ bool?
-
DEPRECATED - Use wifi_config_disabled.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited