Android 11 Behavior Changes
Behavior changes for all apps
In this communication, we will explain the various Android 11 (version R and API Level 30) behavioral changes that are observed when apps use Android Target SDK version 30 and run on Android 11 (or later) devices.
Background location Access
Apps that run on Android 11 (API level 30, or later) devices must already have access to foreground location before requesting for background location access. If an app requests both foreground and background location access simultaneously, the system denies background location access by default. For more information, refer Background Location updates
Package Visibility Updates
Android 11 introduces restrictions on how apps query and interact with other apps installed on a device. Apps must use the <queries> element to define other packages that the app wants to interact with.
Manage device storage
Starting in Android 11, apps that use the scoped storage model can access only their own app-specific cache files. If your app needs to manage device storage, follow the instructions on how to query free space.
1.Check for free space by invoking the ACTION_MANAGE_STORAGE intent action.
2.If there isn’t enough free space on the device, prompt the user to give your app consent to clear all caches. To do so, invoke the ACTION_CLEAR_APP_CACHE intent action.
When apps that run on Android 11 (API level 30, or later) devices are not in use for a few months, to protect sensitive data, the system automatically resets the runtime permissions granted by the user to the app. This action is effectively similar to a user denying permissions to the app from the System Settings.
Top privacy changes
Restricted access to location, camera, and microphone
Android 11 (API level 30) introduces limitations to when a foreground service can access the device’s location, camera, or microphone. When your app starts a foreground service while the app is running in the background, the foreground service has the following limitations:
1). Unless the user has granted the ACCESS_BACKGROUND_LOCATION permission to your app, the foreground service cannot access location.
2). The foreground service cannot access the microphone or camera.