@@ -927,17 +927,41 @@ class ApplicationPolicy
927927 # @return [String]
928928 attr_accessor :preferential_network_id
929929
930+ # Optional. Roles the app has.Apps having certain roles can be exempted from
931+ # power and background execution restrictions, suspension and hibernation on
932+ # Android 14 and above. The user control can also be disallowed for apps with
933+ # certain roles on Android 11 and above. Refer to the documentation of each
934+ # RoleType for more details.The app is notified about the roles that are set for
935+ # it if the app has a notification receiver service with . The app is notified
936+ # whenever its roles are updated or after the app is installed when it has
937+ # nonempty list of roles. The app can use this notification to bootstrap itself
938+ # after the installation. See Integrate with the AMAPI SDK (https://developers.
939+ # google.com/android/management/sdk-integration) and Manage app roles (https://
940+ # developers.google.com/android/management/app-roles) guides for more details on
941+ # the requirements for the service.For the exemptions to be applied and the app
942+ # to be notified about the roles, the signing key certificate fingerprint of the
943+ # app on the device must match one of the signing key certificate fingerprints
944+ # obtained from Play Store or one of the entries in ApplicationPolicy.
945+ # signingKeyCerts. Otherwise, a NonComplianceDetail with
946+ # APP_SIGNING_CERT_MISMATCH is reported.There must not be duplicate roles with
947+ # the same roleType. Multiple apps cannot hold a role with the same roleType. A
948+ # role with type ROLE_TYPE_UNSPECIFIED is not allowed.
949+ # Corresponds to the JSON property `roles`
950+ # @return [Array<Google::Apis::AndroidmanagementV1::Role>]
951+ attr_accessor :roles
952+
930953 # Optional. Signing key certificates of the app.This field is required in the
931954 # following cases: The app has installType set to CUSTOM (i.e. a custom app).
932- # The app has extensionConfig set (i.e. an extension app) but ExtensionConfig.
933- # signingKeyFingerprintsSha256 (deprecated) is not set and the app does not
934- # exist on the Play Store.If this field is not set for a custom app, the policy
935- # is rejected. If it is not set when required for a non-custom app, a
936- # NonComplianceDetail with INVALID_VALUE is reported.For other cases, this field
937- # is optional and the signing key certificates obtained from Play Store are used.
938- # See following policy settings to see how this field is used:
955+ # The app has roles set to a nonempty list and the app does not exist on the
956+ # Play Store. The app has extensionConfig set (i.e. an extension app) but
957+ # ExtensionConfig.signingKeyFingerprintsSha256 (deprecated) is not set and the
958+ # app does not exist on the Play Store.If this field is not set for a custom app,
959+ # the policy is rejected. If it is not set when required for a non-custom app,
960+ # a NonComplianceDetail with INVALID_VALUE is reported.For other cases, this
961+ # field is optional and the signing key certificates obtained from Play Store
962+ # are used.See following policy settings to see how this field is used:
939963 # choosePrivateKeyRules ApplicationPolicy.InstallType.CUSTOM ApplicationPolicy.
940- # extensionConfig
964+ # extensionConfig ApplicationPolicy.roles
941965 # Corresponds to the JSON property `signingKeyCerts`
942966 # @return [Array<Google::Apis::AndroidmanagementV1::ApplicationSigningKeyCert>]
943967 attr_accessor :signing_key_certs
@@ -982,6 +1006,7 @@ def update!(**args)
9821006 @package_name = args [ :package_name ] if args . key? ( :package_name )
9831007 @permission_grants = args [ :permission_grants ] if args . key? ( :permission_grants )
9841008 @preferential_network_id = args [ :preferential_network_id ] if args . key? ( :preferential_network_id )
1009+ @roles = args [ :roles ] if args . key? ( :roles )
9851010 @signing_key_certs = args [ :signing_key_certs ] if args . key? ( :signing_key_certs )
9861011 @user_control_settings = args [ :user_control_settings ] if args . key? ( :user_control_settings )
9871012 @work_profile_widgets = args [ :work_profile_widgets ] if args . key? ( :work_profile_widgets )
@@ -6229,6 +6254,25 @@ def update!(**args)
62296254 end
62306255 end
62316256
6257+ # Role an app can have.
6258+ class Role
6259+ include Google ::Apis ::Core ::Hashable
6260+
6261+ # Required. The type of the role an app can have.
6262+ # Corresponds to the JSON property `roleType`
6263+ # @return [String]
6264+ attr_accessor :role_type
6265+
6266+ def initialize ( **args )
6267+ update! ( **args )
6268+ end
6269+
6270+ # Update properties of this object
6271+ def update! ( **args )
6272+ @role_type = args [ :role_type ] if args . key? ( :role_type )
6273+ end
6274+ end
6275+
62326276 # Controls for the screen brightness settings.
62336277 class ScreenBrightnessSettings
62346278 include Google ::Apis ::Core ::Hashable
0 commit comments