Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/app/GrammaticalInflectionManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/GrammaticalInflectionManager#inhmethods)

# GrammaticalInflectionManager

*** ** * ** ***

` public class GrammaticalInflectionManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.GrammaticalInflectionManager |

<br />

*** ** * ** ***

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

## Summary

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/GrammaticalInflectionManager#getApplicationGrammaticalGender()() ` Returns the current grammatical gender for the calling app. |
| ` int` | ` https://developer.android.com/reference/android/app/GrammaticalInflectionManager#getSystemGrammaticalGender()() ` Allows privileged preloaded applications to get the system grammatical gender when set. |
| ` void` | ` https://developer.android.com/reference/android/app/GrammaticalInflectionManager#setRequestedApplicationGrammaticalGender(int)(int grammaticalGender) ` Sets the current grammatical gender for the calling app (keyed by package name and user ID retrieved from the calling pid). |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### getApplicationGrammaticalGender

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getApplicationGrammaticalGender ()
```

Returns the current grammatical gender for the calling app. A new value can be requested via `https://developer.android.com/reference/android/app/GrammaticalInflectionManager#setRequestedApplicationGrammaticalGender(int)` and will be updated with a new configuration change. The method always returns the value received with the last received configuration change.

<br />

| Returns ||
|---|---|
| `int` | the value of grammatical gender. Value is one of the following: - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_NOT_SPECIFIED` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_NEUTRAL` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_FEMININE` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_MASCULINE` |

**See also:**

- `https://developer.android.com/reference/android/content/res/Configuration#getGrammaticalGender()`

### getSystemGrammaticalGender

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSystemGrammaticalGender ()
```

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

Requires android.Manifest.permission.READ_SYSTEM_GRAMMATICAL_GENDER

<br />

| Returns ||
|---|---|
| `int` | The value of system grammatical gender only if the calling app has the permission, otherwise throwing an exception. Value is one of the following: - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_NOT_SPECIFIED` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_NEUTRAL` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_FEMININE` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_MASCULINE` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | If the caller does not have the required permission. |

**See also:**

- `https://developer.android.com/reference/android/content/res/Configuration#getGrammaticalGender()`

### setRequestedApplicationGrammaticalGender

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setRequestedApplicationGrammaticalGender (int grammaticalGender)
```

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](https://developer.android.com/guide/topics/resources/runtime-changes). The set grammatical gender are persisted across application restarts; they are backed up if the user has enabled Backup \& Restore.\`

<br />

| Parameters ||
|---|---|
| `grammaticalGender` | `int`: the terms of address the user preferred in an application. Value is one of the following: - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_NOT_SPECIFIED` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_NEUTRAL` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_FEMININE` - `https://developer.android.com/reference/android/content/res/Configuration#GRAMMATICAL_GENDER_MASCULINE` |

**See also:**

- `https://developer.android.com/reference/android/content/res/Configuration#getGrammaticalGender()`