summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-03-25 17:49:36 -0700
committerPaul Kocialkowski <contact@paulk.fr>2015-08-25 18:12:59 +0200
commita6de323672a3d3e3e5510cf47a4cd1d61118ba98 (patch)
treea80dff589f3b34e77974aba91db02bbfcd079e27 /core
parentbe640cae67b534624d6b45b71bb43f25f8f84226 (diff)
downloadframeworks_base-a6de323672a3d3e3e5510cf47a4cd1d61118ba98.zip
frameworks_base-a6de323672a3d3e3e5510cf47a4cd1d61118ba98.tar.gz
frameworks_base-a6de323672a3d3e3e5510cf47a4cd1d61118ba98.tar.bz2
Fix issue #8470131: Process thrash kills battery
Protect app widget broadcasts from abuse. In this case the app was sending an APPWIDGET_UPDATE broadcast without specifying a target, which (a) should not be allowed (you should not be able to send updates to other apps), and (b) resulted in every single potential app widget in the system being launched... which was about 75 of them. Change-Id: I9d48733610ce6d5a7c32e69a3e06b9f33bd79a34 Signed-off-by: Dianne Hackborn <hackbod@google.com> Tested-by: Moritz Bandemer <replicant@posteo.mx>
Diffstat (limited to 'core')
-rw-r--r--core/java/android/appwidget/AppWidgetManager.java17
-rw-r--r--core/res/AndroidManifest.xml5
2 files changed, 18 insertions, 4 deletions
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java
index 6b1c3e2..1f7d1ba 100644
--- a/core/java/android/appwidget/AppWidgetManager.java
+++ b/core/java/android/appwidget/AppWidgetManager.java
@@ -48,8 +48,8 @@ public class AppWidgetManager {
static final String TAG = "AppWidgetManager";
/**
- * Send this from your {@link AppWidgetHost} activity when you want to pick an AppWidget to display.
- * The AppWidget picker activity will be launched.
+ * Activity action to launch from your {@link AppWidgetHost} activity when you want to
+ * pick an AppWidget to display. The AppWidget picker activity will be launched.
* <p>
* You must supply the following extras:
* <table>
@@ -88,8 +88,8 @@ public class AppWidgetManager {
ACTION_KEYGUARD_APPWIDGET_PICK = "android.appwidget.action.KEYGUARD_APPWIDGET_PICK";
/**
- * Send this from your {@link AppWidgetHost} activity when you want to bind an AppWidget to
- * display and bindAppWidgetIdIfAllowed returns false.
+ * Activity action to launch from your {@link AppWidgetHost} activity when you want to bind
+ * an AppWidget to display and bindAppWidgetIdIfAllowed returns false.
* <p>
* You must supply the following extras:
* <table>
@@ -268,6 +268,9 @@ public class AppWidgetManager {
/**
* Sent when the custom extras for an AppWidget change.
*
+ * <p class="note">This is a protected intent that can only be sent
+ * by the system.
+ *
* @see AppWidgetProvider#onAppWidgetOptionsChanged
* AppWidgetProvider.onAppWidgetOptionsChanged(Context context,
* AppWidgetManager appWidgetManager, int appWidgetId, Bundle newExtras)
@@ -284,6 +287,9 @@ public class AppWidgetManager {
/**
* Sent when an instance of an AppWidget is removed from the last host.
*
+ * <p class="note">This is a protected intent that can only be sent
+ * by the system.
+ *
* @see AppWidgetProvider#onEnabled AppWidgetProvider.onEnabled(Context context)
*/
public static final String ACTION_APPWIDGET_DISABLED = "android.appwidget.action.APPWIDGET_DISABLED";
@@ -293,6 +299,9 @@ public class AppWidgetManager {
* This broadcast is sent at boot time if there is a AppWidgetHost installed with
* an instance for this provider.
*
+ * <p class="note">This is a protected intent that can only be sent
+ * by the system.
+ *
* @see AppWidgetProvider#onEnabled AppWidgetProvider.onEnabled(Context context)
*/
public static final String ACTION_APPWIDGET_ENABLED = "android.appwidget.action.APPWIDGET_ENABLED";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 1da99ad..7485962 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -75,6 +75,11 @@
<protected-broadcast android:name="android.app.action.ENTER_DESK_MODE" />
<protected-broadcast android:name="android.app.action.EXIT_DESK_MODE" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_UPDATE_OPTIONS" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_DELETED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_DISABLED" />
+ <protected-broadcast android:name="android.appwidget.action.APPWIDGET_ENABLED" />
+
<protected-broadcast android:name="android.backup.intent.RUN" />
<protected-broadcast android:name="android.backup.intent.CLEAR" />
<protected-broadcast android:name="android.backup.intent.INIT" />