Android. What is by default value for exported of components which has IntentFilter in Android lower 12?

506 views Asked by At

When apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. But when apps targeting 11 or lower and in Manifest for component no set exported what is the default value for exported ? My all components with intent filter are exported ?

1

There are 1 answers

0
CommonsWare On BEST ANSWER

For <activity>, <service>, and <receiver>, the default android:exported value is true if the component has an <intent-filter>, false, otherwise.

For example, here is the documentation for android:exported on <service>:

The default value depends on whether the service contains intent filters. The absence of any filters means that it can be invoked only by specifying its exact class name. This implies that the service is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "false". On the other hand, the presence of at least one filter implies that the service is intended for external use, so the default value is "true".