summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorRobert Burns <burnsra@gmail.com>2012-09-23 16:57:23 -0400
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-19 01:26:17 +0000
commit10c87c304d54becd1640551305f560f29d420217 (patch)
treee716bd88685d24e327d7a555e3fa1cbef4d172f7 /src/com
parentf58804beac90f466254d668e043bbba69068f2ee (diff)
downloadpackages_apps_trebuchet-10c87c304d54becd1640551305f560f29d420217.zip
packages_apps_trebuchet-10c87c304d54becd1640551305f560f29d420217.tar.gz
packages_apps_trebuchet-10c87c304d54becd1640551305f560f29d420217.tar.bz2
Fix shortcut intent when all homescreens are full
This patch fixes issue 6218 as outlined at the URL below: http://code.google.com/p/cyanogenmod/issues/detail?id=6218 To reproduce the issue completely fill all available homescreens and try to add a shortcut as follows: - open "People" application - select a contact - using context menu, choose "Place on Home screen" - go to home screen to see crash Change-Id: Iab43db930a3fb305cae4baaa24100d5d16d7b96b
Diffstat (limited to 'src/com')
-rw-r--r--src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java b/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
index 847189c..422c9e7 100644
--- a/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
@@ -141,9 +141,9 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
final int screenDefault = PreferencesProvider.Interface.Homescreen.getDefaultHomescreen(context, screenCount / 2);
final int screen = (screenDefault >= screenCount) ? screenCount / 2 : screenDefault;
- for (int i = 0; i < (2 * Launcher.MAX_SCREEN_COUNT) + 1 && !found; ++i) {
+ for (int i = 0; i <= (2 * screenCount) + 1 && !found; ++i) {
int si = screen + (int) ((i / 2f) + 0.5f) * ((i % 2 == 1) ? 1 : -1);
- if (0 <= si && si < Launcher.MAX_SCREEN_COUNT) {
+ if (0 <= si && si < screenCount) {
found = installShortcut(context, data, items, name, intent, si, exists, sp,
result);
}