Add an exported flag in manifest

With b/150232615, we will need an explicit value set for the exported
flag when intent filters are present, as the default behavior is
changing for future versions. This change adds the value reflecting the
previous default to the manifest.

These changes were made using an automated tool, the xml file may be
reformatted slightly creating a larger diff. The only "real" change is
the addition of "android:exported" to activities, services, and
receivers that have one or more intent-filters.

Bug: 150232615
Bug: 158198882
Test: TH
Exempt-From-Owner-Approval: mechanical refactoring
Change-Id: I083a7bcab968c881f7cdff7152a249691ffac316
This commit is contained in:
Ashwini Oruganti 2020-06-04 17:47:09 -07:00 committed by Rajeev Kumar
parent 7fa1c8a25d
commit aa902e859b
6 changed files with 92 additions and 70 deletions

View File

@ -86,6 +86,7 @@
<receiver <receiver
android:name="com.android.launcher3.InstallShortcutReceiver" android:name="com.android.launcher3.InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT" android:permission="com.android.launcher.permission.INSTALL_SHORTCUT"
android:exported="true"
android:enabled="@bool/enable_install_shortcut_api" > android:enabled="@bool/enable_install_shortcut_api" >
<intent-filter> <intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" /> <action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
@ -94,14 +95,16 @@
<!-- Intent received when a session is committed --> <!-- Intent received when a session is committed -->
<receiver <receiver
android:name="com.android.launcher3.SessionCommitReceiver" > android:name="com.android.launcher3.SessionCommitReceiver"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.content.pm.action.SESSION_COMMITTED" /> <action android:name="android.content.pm.action.SESSION_COMMITTED" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<!-- Intent received used to initialize a restored widget --> <!-- Intent received used to initialize a restored widget -->
<receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver" > <receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED"/> <action android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED"/>
</intent-filter> </intent-filter>
@ -117,6 +120,7 @@
android:name="com.android.launcher3.notification.NotificationListener" android:name="com.android.launcher3.notification.NotificationListener"
android:label="@string/notification_dots_service_title" android:label="@string/notification_dots_service_title"
android:enabled="@bool/notification_dots_enabled" android:enabled="@bool/notification_dots_enabled"
android:exported="true"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"> android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter> <intent-filter>
<action android:name="android.service.notification.NotificationListenerService" /> <action android:name="android.service.notification.NotificationListenerService" />
@ -130,6 +134,7 @@
android:theme="@style/AppItemActivityTheme" android:theme="@style/AppItemActivityTheme"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:autoRemoveFromRecents="true" android:autoRemoveFromRecents="true"
android:exported="true"
android:label="@string/action_add_to_workspace" > android:label="@string/action_add_to_workspace" >
<intent-filter> <intent-filter>
<action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" /> <action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" />
@ -165,6 +170,7 @@
android:name="com.android.launcher3.settings.SettingsActivity" android:name="com.android.launcher3.settings.SettingsActivity"
android:label="@string/settings_button_text" android:label="@string/settings_button_text"
android:theme="@style/HomeSettingsTheme" android:theme="@style/HomeSettingsTheme"
android:exported="true"
android:autoRemoveFromRecents="true"> android:autoRemoveFromRecents="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" /> <action android:name="android.intent.action.APPLICATION_PREFERENCES" />
@ -187,6 +193,7 @@
android:name="com.android.launcher3.secondarydisplay.SecondaryDisplayLauncher" android:name="com.android.launcher3.secondarydisplay.SecondaryDisplayLauncher"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:launchMode="singleTop" android:launchMode="singleTop"
android:exported="true"
android:enabled="true"> android:enabled="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -53,6 +53,7 @@
android:resizeableActivity="true" android:resizeableActivity="true"
android:resumeWhilePausing="true" android:resumeWhilePausing="true"
android:taskAffinity="" android:taskAffinity=""
android:exported="true"
android:enabled="true"> android:enabled="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -53,6 +53,7 @@
android:resizeableActivity="true" android:resizeableActivity="true"
android:resumeWhilePausing="true" android:resumeWhilePausing="true"
android:taskAffinity="" android:taskAffinity=""
android:exported="true"
android:enabled="true"> android:enabled="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -17,8 +17,8 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.android.launcher3"> package="com.android.launcher3">
@ -32,8 +32,7 @@
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
<uses-permission android:name="${packageName}.permission.HOTSEAT_EDU" /> <uses-permission android:name="${packageName}.permission.HOTSEAT_EDU" />
<application <application android:backupAgent="com.android.launcher3.LauncherBackupAgent"
android:backupAgent="com.android.launcher3.LauncherBackupAgent"
android:fullBackupOnly="true" android:fullBackupOnly="true"
android:fullBackupContent="@xml/backupscheme" android:fullBackupContent="@xml/backupscheme"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
@ -44,10 +43,10 @@
android:restoreAnyVersion="true" android:restoreAnyVersion="true"
android:supportsRtl="true"> android:supportsRtl="true">
<service <service android:name="com.android.quickstep.TouchInteractionService"
android:name="com.android.quickstep.TouchInteractionService"
android:permission="android.permission.STATUS_BAR_SERVICE" android:permission="android.permission.STATUS_BAR_SERVICE"
android:directBootAware="true" > android:directBootAware="true"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.QUICKSTEP_SERVICE"/> <action android:name="android.intent.action.QUICKSTEP_SERVICE"/>
</intent-filter> </intent-filter>
@ -66,8 +65,7 @@
android:taskAffinity=""/> android:taskAffinity=""/>
<!-- Content provider to settings search. The autority should be same as the packageName --> <!-- Content provider to settings search. The autority should be same as the packageName -->
<provider <provider android:name="com.android.quickstep.LauncherSearchIndexablesProvider"
android:name="com.android.quickstep.LauncherSearchIndexablesProvider"
android:authorities="${packageName}" android:authorities="${packageName}"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:multiprocess="true" android:multiprocess="true"
@ -79,32 +77,28 @@
</provider> </provider>
<!-- FileProvider used for sharing images. --> <!-- FileProvider used for sharing images. -->
<provider <provider android:name="androidx.core.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${packageName}.overview.fileprovider" android:authorities="${packageName}.overview.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/overview_file_provider_paths"/> android:resource="@xml/overview_file_provider_paths"/>
</provider> </provider>
<service <service android:name="com.android.launcher3.uioverrides.dynamicui.WallpaperManagerCompatVL$ColorExtractionService"
android:name="com.android.launcher3.uioverrides.dynamicui.WallpaperManagerCompatVL$ColorExtractionService"
tools:node="remove"/> tools:node="remove"/>
<activity <activity android:name="com.android.launcher3.proxy.ProxyActivityStarter"
android:name="com.android.launcher3.proxy.ProxyActivityStarter"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:launchMode="singleTask" android:launchMode="singleTask"
android:clearTaskOnLaunch="true" android:clearTaskOnLaunch="true"
android:exported="false"/> android:exported="false"/>
<activity <activity android:name="com.android.quickstep.interaction.GestureSandboxActivity"
android:name="com.android.quickstep.interaction.GestureSandboxActivity"
android:autoRemoveFromRecents="true" android:autoRemoveFromRecents="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:screenOrientation="portrait"> android:screenOrientation="portrait"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.android.quickstep.action.GESTURE_SANDBOX"/> <action android:name="com.android.quickstep.action.GESTURE_SANDBOX"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>

View File

@ -29,6 +29,7 @@
<receiver <receiver
android:name="com.android.launcher3.testcomponent.AppWidgetNoConfig" android:name="com.android.launcher3.testcomponent.AppWidgetNoConfig"
android:exported="true"
android:label="No Config"> android:label="No Config">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/> <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
@ -39,6 +40,7 @@
<receiver <receiver
android:name="com.android.launcher3.testcomponent.AppWdigetHidden" android:name="com.android.launcher3.testcomponent.AppWdigetHidden"
android:exported="true"
android:label="Hidden widget"> android:label="Hidden widget">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/> <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
@ -49,6 +51,7 @@
<receiver <receiver
android:name="com.android.launcher3.testcomponent.AppWidgetWithConfig" android:name="com.android.launcher3.testcomponent.AppWidgetWithConfig"
android:exported="true"
android:label="With Config"> android:label="With Config">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/> <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
@ -58,12 +61,14 @@
</receiver> </receiver>
<activity <activity
android:name="com.android.launcher3.testcomponent.WidgetConfigActivity"> android:name="com.android.launcher3.testcomponent.WidgetConfigActivity"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.android.launcher3.testcomponent.CustomShortcutConfigActivity"> <activity android:name="com.android.launcher3.testcomponent.CustomShortcutConfigActivity"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT" /> <action android:name="android.intent.action.CREATE_SHORTCUT" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -72,6 +77,7 @@
<activity <activity
android:name="com.android.launcher3.testcomponent.RequestPinItemActivity" android:name="com.android.launcher3.testcomponent.RequestPinItemActivity"
android:icon="@drawable/test_drawable_pin_item" android:icon="@drawable/test_drawable_pin_item"
android:exported="true"
android:label="Test Pin Item"> android:label="Test Pin Item">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -102,6 +108,7 @@
android:stateNotNeeded="true" android:stateNotNeeded="true"
android:taskAffinity="" android:taskAffinity=""
android:theme="@android:style/Theme.DeviceDefault.Light" android:theme="@android:style/Theme.DeviceDefault.Light"
android:exported="true"
android:windowSoftInputMode="adjustPan"> android:windowSoftInputMode="adjustPan">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -114,6 +121,7 @@
<activity <activity
android:name="com.android.launcher3.testcomponent.BaseTestingActivity" android:name="com.android.launcher3.testcomponent.BaseTestingActivity"
android:label="LauncherTestApp" android:label="LauncherTestApp"
android:exported="true"
android:taskAffinity="com.android.launcher3.testcomponent.Affinity1"> android:taskAffinity="com.android.launcher3.testcomponent.Affinity1">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -128,6 +136,7 @@
</activity> </activity>
<activity-alias android:name="Activity2" <activity-alias android:name="Activity2"
android:label="TestActivity2" android:label="TestActivity2"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -136,6 +145,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity3" <activity-alias android:name="Activity3"
android:label="TestActivity3" android:label="TestActivity3"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -144,6 +154,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity4" <activity-alias android:name="Activity4"
android:label="TestActivity4" android:label="TestActivity4"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -152,6 +163,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity5" <activity-alias android:name="Activity5"
android:label="TestActivity5" android:label="TestActivity5"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -160,6 +172,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity6" <activity-alias android:name="Activity6"
android:label="TestActivity6" android:label="TestActivity6"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -168,6 +181,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity7" <activity-alias android:name="Activity7"
android:label="TestActivity7" android:label="TestActivity7"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -176,6 +190,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity8" <activity-alias android:name="Activity8"
android:label="TestActivity8" android:label="TestActivity8"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -184,6 +199,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity9" <activity-alias android:name="Activity9"
android:label="TestActivity9" android:label="TestActivity9"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -192,6 +208,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity10" <activity-alias android:name="Activity10"
android:label="TestActivity10" android:label="TestActivity10"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -200,6 +217,7 @@
</activity-alias> </activity-alias>
<activity-alias android:name="Activity11" <activity-alias android:name="Activity11"
android:label="TestActivity11" android:label="TestActivity11"
android:exported="true"
android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>

View File

@ -26,6 +26,7 @@
<activity <activity
android:name="Activity1" android:name="Activity1"
android:icon="@mipmap/ic_launcher1" android:icon="@mipmap/ic_launcher1"
android:exported="true"
android:label="Aardwolf"> android:label="Aardwolf">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>