diff options
author | Romain Guy <romainguy@android.com> | 2009-06-17 10:20:34 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-06-17 10:20:34 -0700 |
commit | 51ed5b9bc05c6eb37dcb3fe38fa021f1044c0f88 (patch) | |
tree | 81c86f27621af9ba019863deda4bee83f3653917 /src/com/android | |
parent | ded9ec91f6623d2566e1b2439ab302b6451e1657 (diff) | |
download | android_packages_apps_Trebuchet-51ed5b9bc05c6eb37dcb3fe38fa021f1044c0f88.tar.gz android_packages_apps_Trebuchet-51ed5b9bc05c6eb37dcb3fe38fa021f1044c0f88.tar.bz2 android_packages_apps_Trebuchet-51ed5b9bc05c6eb37dcb3fe38fa021f1044c0f88.zip |
Adds checks in Home's broadcast receivers to handle only known actions.
Previously, Home would handle any action sent directly to its broadcast
receivers as if it was an UNINSTALL/INSTALL_SHORTCUT action.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher/InstallShortcutReceiver.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher/UninstallShortcutReceiver.java | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher/InstallShortcutReceiver.java b/src/com/android/launcher/InstallShortcutReceiver.java index fd2789ceb..7c727a86f 100644 --- a/src/com/android/launcher/InstallShortcutReceiver.java +++ b/src/com/android/launcher/InstallShortcutReceiver.java @@ -24,9 +24,16 @@ import android.database.Cursor; import android.widget.Toast; public class InstallShortcutReceiver extends BroadcastReceiver { + private static final String ACTION_INSTALL_SHORTCUT = + "com.android.launcher.action.INSTALL_SHORTCUT"; + private final int[] mCoordinates = new int[2]; public void onReceive(Context context, Intent data) { + if (!ACTION_INSTALL_SHORTCUT.equals(data.getAction())) { + return; + } + int screen = Launcher.getScreen(); if (!installShortcut(context, data, screen)) { diff --git a/src/com/android/launcher/UninstallShortcutReceiver.java b/src/com/android/launcher/UninstallShortcutReceiver.java index bf718156c..3bcdcbe58 100644 --- a/src/com/android/launcher/UninstallShortcutReceiver.java +++ b/src/com/android/launcher/UninstallShortcutReceiver.java @@ -27,7 +27,14 @@ import android.widget.Toast; import java.net.URISyntaxException; public class UninstallShortcutReceiver extends BroadcastReceiver { + private static final String ACTION_UNINSTALL_SHORTCUT = + "com.android.launcher.action.UNINSTALL_SHORTCUT"; + public void onReceive(Context context, Intent data) { + if (!ACTION_UNINSTALL_SHORTCUT.equals(data.getAction())) { + return; + } + Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT); String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME); boolean duplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true); |