Package Visibility
In a somewhat surprising move, Android 11 introduces a new privacy change: app isolation. Apps can no longer directly communicate with other apps, or even know that other apps exist, except in fairly limited ways.
In this chapter, we will explore more about what this means for you and your app.
The Way Things Were
Once upon a time — otherwise known as “before Android 11” — all apps were visible to all other apps. The data of those apps might be private, but the apps themselves were not. And one app could communicate with another app, via any exposed IPC interface, so long as permissions were met.
The quintessential example of this is a launcher. To provide the list (or grid or whatever) of icons for launchable activities, a launcher can call queryIntentActivities()
on PackageManager
, asking for all activities that have a MAIN
/LAUNCHER
<intent-filter>
. PackageManager
would return a list of matching activities, and the launcher would use that to populate its UI. And, when the user chooses an activity to start, the launcher would be able to call startActivity()
on an Intent
identifying that activity.
Even without PackageManager
, you might still have your app communicate with other apps. For example, an upcoming chapter has a sample with two apps that communicate via a bound service and a pair of Messenger
objects. The client side of the pair can call bindService()
to bind to the service offered by the other app. So long as any permissions are met (e.g., android:permission
attribute on the <service>
element), that binding would be allowed.
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.