This page describes each app-impacting behavior change that was added to the
compatibility framework in Android 11 (API level 30). Use this list in
conjunction with the
[developer options and ADB commands](https://developer.android.com/guide/app-compatibility/test-debug) to
test and debug your app as you prepare to target Android 11.

### ADD_CONTENT_OBSERVER_FLAGS

**Change ID**: 150939131

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, there is a new public API overload
[`onChange(boolean, Uri, int)`](https://developer.android.com/reference/android/database/ContentObserver#onChange(boolean,%20android.net.Uri,%20int))
that includes an integer `flags` argument.

This new method is a public SDK alternative for apps that use the non-SDK
`onChange()` overloaded method that includes an integer `userId` argument.

### ADMIN_APP_PASSWORD_COMPLEXITY

**Change ID**: 123562444

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For admin apps targeting Android 11, throw an error whenever an
app sets a password requirement that is not relevant to the currently assigned
password quality. For example, when the password quality is set to
[`DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED`](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#PASSWORD_QUALITY_UNSPECIFIED),
an app would not be able to set a minimum password length. In this case, before
trying to set the minimum password length, the app should first call the
[`setPasswordQuality()`](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setPasswordQuality(android.content.ComponentName,%20int))
method and only then call the
[`setPasswordMinimumLength()`](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setPasswordMinimumLength(android.content.ComponentName,%20int))
method.

In addition, when an admin app targeting Android 11 lowers the
password quality, any existing password requirements that no longer apply are
reset to their default values.

### APP_DATA_DIRECTORY_ISOLATION

**Change ID**: 143937733

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Apps that target Android 11 can no longer access files in private
data directories of *any* app, regardless of the other app's target SDK version.

To learn more, see [Access to private
directories](https://developer.android.com/about/versions/11/privacy/storage#other-private-dirs).

### APN_READING_PERMISSION_CHANGE_ID

**Change ID**: 124107808

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, accessing the APN database now
requires the [`Manifest.permission.WRITE_APN_SETTINGS`](https://developer.android.com/reference/android/Manifest.permission#WRITE_APN_SETTINGS)
permission.

To learn more about this change, see [Restricted read access to APN
database](https://developer.android.com/about/versions/11/behavior-changes-11#apn-database-restrictions).

### BACKGROUND_RATIONALE_CHANGE_ID

**Change ID**: 147316723

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Apps must now provide a valid rationale every time they request to access the
device's location in the background.

To learn more about this change, see the guide on how to [Access background
location in Android 11](https://developer.android.com/about/versions/11/privacy/location#background-location)
that discusses privacy changes related to location in Android 11.

### CALLBACK_ON_CLEAR_CHANGE

**Change ID**: 119147584

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Whenever
[`Editor.clear`](https://developer.android.com/reference/android/content/SharedPreferences.Editor#clear())
is called, a callback is now made to
[`OnSharedPreferenceChangeListener.onSharedPreferenceChanged`](https://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged(android.content.SharedPreferences,%20java.lang.String))
with a `null` key.

To learn more about this change, see [Callback changes for
OnSharedPreferenceChangeListener](https://developer.android.com/about/versions/11/behavior-changes-11#sharedpreferences-listener).

### CALLBACK_ON_MORE_ERROR_CODE_CHANGE

**Change ID**: 130595455

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

The error codes are now expanded for [`updateAvailableNetworks(List,
Executor,
Consumer)`](https://developer.android.com/reference/android/telephony/TelephonyManager#updateAvailableNetworks(java.util.List%3Candroid.telephony.AvailableNetworkInfo%3E,%20java.util.concurrent.Executor,%20java.util.function.Consumer%3Cjava.lang.Integer%3E))
and [`setPreferredOpportunisticDataSubscription(int, boolean, Executor,
Consumer)`](https://developer.android.com/reference/android/telephony/TelephonyManager#setPreferredOpportunisticDataSubscription(int,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer%3Cjava.lang.Integer%3E)).

### CALL_BACK_ON_CHANGED_LISTENER_WITH_SWITCHED_OP_CHANGE

**Change ID**: 148180766

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

This is a subtle behavior change to [`startWatchingMode(String, String,
AppOpsManager.OnOpChangedListener)`](https://developer.android.com/reference/android/app/AppOpsManager#startWatchingMode(java.lang.String,%20java.lang.String,%20android.app.AppOpsManager.OnOpChangedListener)).
Before this change the system called back for the switched op. After the change
the system will call back for the actually requested op or all switched ops if
no op is specified.

### CAMERA_MICROPHONE_CAPABILITY_CHANGE_ID

**Change ID**: 136219221

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, foreground services only receive
camera and microphone while-in-use capabilities when the
[`R.attr.foregroundServiceType`](https://developer.android.com/reference/android/R.attr#foregroundServiceType)
is configured as
[`ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA`](https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_CAMERA)
and
[`ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE`](https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE)
respectively in the manifest file. On earlier versions of Android, foreground
services automatically received camera and microphone capabilities.

To learn more about this change, see [Foreground service types in
Android 11](https://developer.android.com/about/versions/11/privacy/foreground-services).

### CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK

**Change ID**: 128611929

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Apps can no longer post custom toasts in the background. However, apps can still
post toasts using the [`Toast.makeText(Context, CharSequence,
int)`](https://developer.android.com/reference/android/widget/Toast#makeText(android.content.Context,%20java.lang.CharSequence,%20int))
method and its variants while in the background.

To learn more about this change, see [Custom toast views are
blocked](https://developer.android.com/about/versions/11/behavior-changes-11#custom-toast-views-blocked).

### CHANGE_RESTRICT_SAW_INTENT

**Change ID**: 135920175

**Default state**: This change can't be toggled. It is only logged by the
compatibility framework.

Intents using the `android.settings.MANAGE_APP_OVERLAY_PERMISSION` action and
the `package` data URI scheme no longer direct the user to an app-specific
screen for managing the associated permission. Instead, the user is directed to
a screen where they can manage all the apps that have requested the permission.
| **Caution:** This change applies to all apps when they run on Android 11, regardless of `targetSdkVersion`. Even though you can't toggle this change on or off, you should test your app's compatibility with this change. To learn more about this change, see [MANAGE_OVERLAY_PERMISSION intents always bring user to system permissions
| screen](https://developer.android.com/about/versions/11/privacy/permissions#manage_overlay).

### CHANGE_TEXT_TOASTS_IN_THE_SYSTEM

**Change ID**: 147798919

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Text toasts are now rendered by the SystemUI instead of in-app. This prevents
apps from circumventing restrictions on posting custom toasts in the background.

### DEFAULT_SCOPED_STORAGE

**Change ID**: 149924527

**Default state**: Enabled for all apps.

All apps targeting Android 11 now use [scoped
storage](https://developer.android.com/training/data-storage#scoped-storage) by default and can no longer
[opt out of scoped
storage](https://developer.android.com/training/data-storage/compatibility#opt-out-scoped-storage).

However, you can test your app without scoped storage, regardless of your app's
target SDK version and manifest flag values, by toggling this change off.
| **Important:** When toggling this change off for app testing, you must also disable [`FORCE_ENABLE_SCOPED_STORAGE`](https://developer.android.com/about/versions/11/reference/compat-framework-changes#force_enable_scoped_storage) (if it is not already disabled) to restore the legacy storage behavior.

To learn
more about the changes to scoped storage in Android 11, see the
[Scoped storage](https://developer.android.com/about/versions/11/privacy/storage#scoped-storage) section on the
page about changes to Android storage in Android 11.

### EMPTY_INTENT_ACTION_CATEGORY

**Change ID**: 151163173

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, the system now throws an error if
an intent filter's [`action`](https://developer.android.com/guide/topics/manifest/action-element) or
[`category`](https://developer.android.com/guide/topics/manifest/category-element) is an empty string. A bug
in the platform before Android 11 allowed this case to pass
through without throwing an error. Note that this does not include cases when
the attribute is null or missing, as that has always thrown an error.

### FILTER_APPLICATION_QUERY

**Change ID**: 135549675

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Apps now need to declare the packages and intents they intend to use before they
can get details about other apps on a device. Such declarations must be made
using the `<queries>` tag in the app's manifest.

To learn more about how to query and interact with other installed apps in
Android 11, see the [package
visibility](https://developer.android.com/about/versions/11/privacy/package-visibility) privacy page.

### FORCE_ENABLE_SCOPED_STORAGE

**Change ID**: Value: 132649864

**Default state**: Disabled for all apps.

All apps targeting Android 11 now use [scoped
storage](https://developer.android.com/training/data-storage#scoped-storage) by default and can no longer
[opt out of scoped
storage](https://developer.android.com/training/data-storage/compatibility#opt-out-scoped-storage).

However, if your app still targets Android 10 (API level 29) or lower, you can
test your app with scoped storage, regardless of your app's target SDK version
and manifest flag values, by toggling this change on.
| **Important:** When toggling this change on for app testing, you must also enable [`DEFAULT_SCOPED_STORAGE`](https://developer.android.com/about/versions/11/reference/compat-framework-changes#default_scoped_storage) if it is not already enabled.

To learn
more about the changes to scoped storage in Android 11, see the
[Scoped storage](https://developer.android.com/about/versions/11/privacy/storage#scoped-storage) section on the
page about changes to Android storage in Android 11.

### GET_DATA_CONNECTION_STATE_R_VERSION

**Change ID**: 148535736

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

To check the SDK version for
`PreciseDataConnectionState#getDataConnectionState`.

### GET_DATA_STATE_R_VERSION

**Change ID**: 148534348

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

To check the SDK version for
[`getDataState()`](https://developer.android.com/reference/android/telephony/TelephonyManager#getDataState()).

### GET_PROVIDER_SECURITY_EXCEPTIONS

**Change ID**: 150935354

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11 (API level 30) or higher,
[`getProvider(String)`](https://developer.android.com/reference/android/location/LocationManager#getProvider(java.lang.String))
no longer throws any security exceptions.

### GET_TARGET_SDK_VERSION_CODE_CHANGE

**Change ID**: 145147528

**Default state**: Enabled for apps that target Android 10 (API level 29) or
higher.

To check the SDK version for the `SmsManager.sendResolverResult()` method.
| **Note:** This change is currently included in the compatibility framework, but affects an SDK version check for a previous Android release. It can be safely ignored.

### GWP_ASAN

**Change ID**: 135634846

**Default state**: Disabled for all apps.

Enables sampled native memory bug detection in apps.

To learn more about this change, see the [GWP-ASan guide](https://developer.android.com/ndk/guides/gwp-asan).

### HIDE_MAXTARGETSDK_P_HIDDEN_APIS

**Change ID**: 149997251

**Default state**: Enabled for apps that target Android 10 (API level 29) or
higher.

For apps targeting Android 10 (API level 29) or higher, removes access to all
non-SDK interfaces that are part of the [`max-target-p` (`greylist-max-p`)
list](https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces#list-names)
for Android 10 (API level 29).

### HIDE_MAXTARGETSDK_Q_HIDDEN_APIS

**Change ID**: 149994052

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11 (API level 30) or higher, removes access to all
non-SDK interfaces that are part of the [`max-target-q` (`greylist-max-q`)
list](https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces#list-names)
for Android 11 (API level 30).

To learn more about this change, see [non-SDK interfaces that are now blocked in
Android 11](https://developer.android.com/about/versions/11/non-sdk-11#new-blocked).

### LISTEN_CODE_CHANGE

**Change ID**: 147600208

**Default state**: Enabled for apps that target Android 10 (API level 29) or
higher.

To check the SDK version for [`TelephonyManager.listen(PhoneStateListener,
int)`](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)).
| **Note:** This change is currently included in the compatibility framework, but affects an SDK version check for a previous Android release. It can be safely ignored.

### MISSING_APP_TAG

**Change ID**: 150776642

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, an error is now thrown when an
app's manifest file is missing an [`application`](https://developer.android.com/guide/topics/manifest/application-element)
or [`instrumentation`](https://developer.android.com/guide/topics/manifest/instrumentation-element) tag.

### NATIVE_HEAP_POINTER_TAGGING

**Change ID**: 135754954

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, native heap allocations now have a
non-zero tag in the most significant byte.

To learn more, see [Heap pointer
tagging](https://developer.android.com/about/versions/11/behavior-changes-11#heap-pointer-tagging).

### PHONE_STATE_LISTENER_LIMIT_CHANGE_ID

**Change ID**: 150880553

**Default state**: Enabled for all apps.

For apps targeting Android 11, there is now a limit on the number
of [`PhoneStateListener`](https://developer.android.com/reference/android/telephony/PhoneStateListener)
objects any process may register via [`TelephonyManager.listen(PhoneStateListener, int)`](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)).
The default limit is 50, which may be changed by remote device config updates.
This limit is enforced using an
[`IllegalStateException`](https://developer.android.com/reference/java/lang/IllegalStateException)
thrown by `TelephonyManager.listen(PhoneStateListener, int)` when the
offending process attempts to register one too many listeners.

### PREVENT_META_REFLECTION_BLACKLIST_ACCESS

**Change ID**: 142365358

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Apps targeting Android 11 can no longer use an extra layer of
reflection to access non-SDK interfaces that are restricted.

### PROCESS_CAPABILITY_CHANGE_ID

**Change ID**: 136274596

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, the flag
[`Context.BIND_INCLUDE_CAPABILITIES`](https://developer.android.com/reference/android/content/Context#BIND_INCLUDE_CAPABILITIES)
can now be used to pass while-in-use capabilities from the client process to a
bound service.

### REMOVE_ANDROID_TEST_BASE

**Change ID**: 133396946

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For apps targeting Android 11, the `android.test.base` library
has been removed if the app does not depend on `android.test.runner` (as it
depends on classes from the `android.test.base` library).

### REQUEST_ACCESSIBILITY_BUTTON_CHANGE

**Change ID**: 136293963

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

For accessibility services targeting Android 11, the
[`FLAG_REQUEST_ACCESSIBILITY_BUTTON`](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FLAG_REQUEST_ACCESSIBILITY_BUTTON)
flag must now be specified in the accessibility service metadata file.
Otherwise, the flag is ignored.

To learn more about this change, see [Declare accessibility button usage in
metadata file](https://developer.android.com/about/versions/11/behavior-changes-11#a11y-button-usage).

### RESOURCES_ARSC_COMPRESSED

**Change ID**: 132742131

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Apps targeting Android 11 (API level 30) can't be installed if they
contain a *compressed* `resources.arsc` file or if this file is not aligned on
a 4-byte boundary.

To learn more about this change, see [Compressed resource
files](https://developer.android.com/about/versions/11/behavior-changes-11#compressed-resource-file).

### RESTRICT_STORAGE_ACCESS_FRAMEWORK

**Change ID**: 141600225

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

If your app targets Android 11 and uses the [Storage Access
Framework (SAF)](https://developer.android.com/guide/topics/providers/document-provider), you can no longer
access certain directories using the
[`ACTION_OPEN_DOCUMENT`](https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT)
and
[`ACTION_OPEN_DOCUMENT_TREE`](https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT_TREE)
intent actions. To learn more about these changes, see the [Document access
restrictions section](https://developer.android.com/about/versions/11/privacy/storage#file-directory-restrictions)
on the page that discusses privacy updates related to storage in
Android 11.

### SELINUX_LATEST_CHANGES

**Change ID**: 143539591

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

This change gates apps access to the untrusted_app_R-targetSDk SELinux domain.
This is one of the foundational changes in the compatibility framework that
allow apps to toggle other changes that are gated by `targetSdkVersion` without
changing their app's `targetSDKVersion`. For this reason, you should not disable
this change for an app that targets Android 11, or the app will
not function.

This change has no effect for apps that use a shared user ID.

### THROW_SECURITY_EXCEPTIONS

**Change ID**: 147340954

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Prior to Android 11, a [`SecurityException`](https://developer.android.com/reference/java/lang/SecurityException)
would only be thrown by `setEnabled` APIs for a permission error. In
Android 11 this no longer holds true, and a `SecurityException`
can be thrown for any number of reasons, none of which are exposed to the
caller.

To maintain existing API behavior, if a legacy permission failure or actor
enforcement failure occurs for an app that does not target
Android 11, the exception is coerced into an
[`IllegalStateException`](https://developer.android.com/reference/java/lang/IllegalStateException) that
existed in the source prior to Android 11.

### USE_SET_LOCATION_ENABLED

**Change ID**: 117835097

**Default state**: Enabled for apps that target Android 11 (API level 30) or
higher.

Admin apps targeting Android 11 can no longer use
[`DevicePolicyManager.setSecureSetting(ComponentName, String, String)`](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setSecureSetting(android.content.ComponentName,%20java.lang.String,%20java.lang.String))
to change the deprecated [`Settings.Secure.LOCATION_MODE`](https://developer.android.com/reference/android/provider/Settings.Secure#LOCATION_MODE)
setting. Instead they should use [`DevicePolicyManager.setLocationEnabled(ComponentName, boolean)`](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setLocationEnabled(android.content.ComponentName,%20boolean)).