Added in API level 34

GrammaticalInflectionManager


open class GrammaticalInflectionManager

This class allow applications to control granular grammatical inflection settings (such as per-app grammatical gender).

Summary

Public methods
open Int

Returns the current grammatical gender for the calling app.

open Int

Allows privileged preloaded applications to get the system grammatical gender when set.

open Unit

Sets the current grammatical gender for the calling app (keyed by package name and user ID retrieved from the calling pid).

Public methods

getApplicationGrammaticalGender

Added in API level 34
open fun getApplicationGrammaticalGender(): Int

Returns the current grammatical gender for the calling app. A new value can be requested via setRequestedApplicationGrammaticalGender(int) and will be updated with a new configuration change. The method always returns the value received with the last received configuration change.

getSystemGrammaticalGender

Added in API level 35
open fun getSystemGrammaticalGender(): Int

Allows privileged preloaded applications to get the system grammatical gender when set.
Requires android.Manifest.permission.READ_SYSTEM_GRAMMATICAL_GENDER

Exceptions
java.lang.SecurityException If the caller does not have the required permission.

setRequestedApplicationGrammaticalGender

Added in API level 34
open fun setRequestedApplicationGrammaticalGender(grammaticalGender: Int): Unit

Sets the current grammatical gender for the calling app (keyed by package name and user ID retrieved from the calling pid).

Note: Changes to app grammatical gender will result in a configuration change (and potentially an Activity re-creation) being applied to the specified application. For more information, see the section on handling configuration changes. The set grammatical gender are persisted across application restarts; they are backed up if the user has enabled Backup & Restore.`