![]() In the scoped storage environment, app-specific directories on external storage are becoming private from other apps. Starting from Android 11, the only way for Viber to access non-media files created by other apps is by using the Storage Access Framework document picker, which they had already utilized in a different part of their app.Īpp-specific files within external storage The updated storage runtime permission gives read access only to the images, videos and audio files that are available through MediaProvider. However, to reduce the complexity of migration, Viber decided to keep their own top level directory for Android 10 and below, storing only the media files that are not exposed to the device’s Gallery app, while for Android 11 and above this directory is used in read-only mode to provide backward compatibility.Īnother use case that Viber has been refining is sharing files in the chats. ![]() With scoped storage, saving app files to a top level directory became an anti-pattern, so Viber has followed best practices to update their implementation to store media files from the chats only in locations that are accessible in scoped storage. Previously, Viber created and consumed files in a custom top level directory and depended on file path access. This change gives users additional control over the content included in their Viber messages.“ said Anton Novikov and Sergey Kozlov from Viber.Īccessing files outside of app-specific directory Because chats may contain private images or videos, it’s important to give users the ability to hide these files from the gallery. We also added a new ‘Save to gallery’ option allowing users to choose to make their photos readable by other apps or not. “This addition supports our efforts to provide our users with the best security and privacy solutions we can provide supported by the Android OS, users will benefit from this added security later without needing to opt-in. This change will help Viber provide more granular control to their users: The other notable update is related to changes in the storage permissions model: Apps in scoped storage have unrestricted access to their app-specific directories on external storage and can contribute to well-defined media collections without requesting a runtime permission. Private media files are stored in the app-specific directory on external storage and are accessed via the internal ContentProvider. This way, the files are accessible in a device gallery, and can be read by other apps with the storage permission. In order to adjust their app experience to scoped storage, Viber now contributes public media files to well-defined media collections using the MediaStore API. Therefore Viber invoked the requestLegacyExternalStorage flag to temporarily opt-out of scoped storage on Android 10 until the app was fully compatible. Viber needed to evaluate the differences between the existing app's storage model and updated platform guidelines, followed by gradual application changes to work with files in scoped storage. ![]() Scoped storage changes the way that apps store and access files on a device's external storage. Let’s take a look at key platform changes that affected the legacy Viber implementation. In this article, we’ll share how Viber handled the migration to scoped storage, focusing on what they did to optimize working with media files and other data in the app.Īndroid’s storage model has evolved to adapt to changing privacy considerations, leading to the changes in the storage system APIs. Due to Viber's complexity, the team opted to incrementally implement the changes that were required to comply with scoped storage. Scoped storage was introduced in Android 10 with further improvements in Android 11 to provide better protection to app and user data on a platform level. We believe the modern scoped storage paradigm provides this foundation for app developers and users. Viber aims to give its users an easy, fast, reliable and secure communication platform by providing an intuitive interface and operating with files in a privacy-preserving way. Authored by Kseniia Shumelchyk from Google and Anton Novikov, Sergey Kozlov from Viber.Īs a messaging app, Viber needs to store, process and share a significant amount of data. This blogpost is a collaboration between Google and Viber.
0 Comments
Leave a Reply. |