summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Burns <burnsra@gmail.com>2012-09-23 16:57:23 -0400
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-09-25 02:48:03 -0400
commita874dfa1879159524581256da8a4687d64a9ee6e (patch)
tree40b4afa91b431dd7b2bbbadeac5f83afeb9d3116 /src
parentdadfb1f50f4eec32e92b6316cfdffaecdebfa7e7 (diff)
downloadandroid_packages_apps_Trebuchet-a874dfa1879159524581256da8a4687d64a9ee6e.tar.gz
android_packages_apps_Trebuchet-a874dfa1879159524581256da8a4687d64a9ee6e.tar.bz2
android_packages_apps_Trebuchet-a874dfa1879159524581256da8a4687d64a9ee6e.zip
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')
-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 e95efde6f..9f6143092 100644
--- a/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
+++ b/src/com/cyanogenmod/trebuchet/InstallShortcutReceiver.java
@@ -142,9 +142,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);
}