Set a good example - don't export ExamplePlugin

Plugins should never be exported because this would allow other
packages installed on the device to attempt to launch it via
Context#startService which can crash SystemUI.

By default, if a service has an intent-filter, exported is set to true.
Therefore, we must explicitly set exported=false.

Test: n/a
Bug: 142012333
Change-Id: Iaf4191ee3006cc07eb0309f068854c103683e99d
This commit is contained in:
Beverly
2019-10-30 16:34:16 -04:00
committed by Beverly Tai
parent aa88bb6bac
commit 8cf4996fdf

View File

@@ -22,14 +22,16 @@
<application>
<activity android:name=".PluginSettings"
android:label="@string/plugin_label">
android:label="@string/plugin_label"
android:exported="false">
<intent-filter>
<action android:name="com.android.systemui.action.PLUGIN_SETTINGS" />
</intent-filter>
</activity>
<service android:name=".SampleOverlayPlugin"
android:label="@string/plugin_label">
android:label="@string/plugin_label"
android:exported="false">
<intent-filter>
<action android:name="com.android.systemui.action.PLUGIN_OVERLAY" />
</intent-filter>