Android 11 Privacy Changes

Tram Ho

1. Learn the overview of Scoped Storage.

Scoped Storage has been released since the early days of testing on Android 10. It was born to restrict access to memory (READ_EXTERNAL_STORAGE) from developers. This change was originally expected to apply to devices from Android 10 and up, but due to objections from developers, Scoped Storage is only applicable to Target API 29 (Android 10) apps. But with Android 11, Scoped Storage has been reapplied and there is no plan to change from Google.

Applications that deploy Scoped Storage can only access the application’s directory or files that the application creates. You will have restricted access to system memory, but with files in your application directory you can access and modify without permission.

Why should I apply Scoped Storage?

Instead of developers being able to apply for easy data system access, Scoped Storage provides certain limitations that make data inaccessible. Developers will use APIS storage to access the required folders.

2. Android 11 Privacy Updates

1. Storage

App target API 29 can still request requestLegacyExternalStorage = true permission, but when the app target Android 11, the system will ignore this permission. Now your application must execute Scoped Storage and migrate app data to Scoped Storage-compatible folders.

Note: The targets API 30 application cannot access directories via File Path , but will pass Uri

** Media file access **

Android 11 provides a number of methods to get User permissions to make accessing and managing Media Files easier.

createWriteRequest()

Allows the app to have write access to certain groups of media files

createFavoriteRequest()

Move the folder to the favorites list of the device

createTrashRequest()

Move the folder to the device’trash, the folder will be permanently deleted after a certain period of time. However, we can remove them from trash

createDeleteRequest()

Permanently delete folders

** Access to data from other apps **

Target API 30 applications could not access the directory path of other applications. Even if those applications target API 27 or lower.

** Access to directories **

You no longer use the action ACTION_OPEN_DOCUMENT_TREE to access the following directories:

  • The root directory of internal storage
  • The root directory of each SD card that the vendor considers to be trusted
  • Download folder

2. Permission

** One-time permission **

From Android 11 onwards, when apps ask for permission related to location, microphone, or camera. Dialog for permission will display the Only this time option to accept the right to use 1 time

** Auto-reset permissions from unused apps **

From Android 11 and up, the user data protection system automatically resets permissions previously granted when the app has been inactive for several months.

** Permission dialog visibility **

From Android 11 onwards, when the user clicks “Deny” in the dialog asking for permission more than once during the time the app is installed, this action will be implied as “Don’t ask again” and the dialog won’t show the next times.

3. Phone numbers

Android 11 has changed the permissions related to the phone, permissions used to access the phone number From Android 11 onwards, to access the Phone Number permission, the application must apply for READ_PHONE_NUMBERS permission instead of READ_PHONE_STATE permission.

  • The getLine1Number() appears in both TelephonyManager and TelecomManager classes
  • The getMsisdn () method is not supported in the TelephonyManager class
Share the news now

Source : Viblo