[One (M7) Original Android Development] ess.boyer:
Trebuchet Hotseat Folders Disappearing after Trebuchet Restart

Hey all!

I'm running the bleeding edge version of PAC ROM, which in turn is using the latest & greatest CM 10.2. I am using Trebuchet as the launcher, but am having a problem with it. A few people have reported the issue on the PAC thread, but I have yet to see a developer (other than myself) comment on it, or any mention of the issue in this thread.

Basically, what happens, is you add icons to the Dock. You drag icons onto an icon to create a folder of icons. You restart Trebuchet, either by rebooting the phone, or going to the Trebuchet settings and causing a change to cause a restart, and when you view the home screen again, your icon folder has been wiped out and replaced with what was there by default.

Here is a section of log output that was started immediately prior to me restarting Trebuchet (I had already added some icons to a folder on the Dock) by going into Settings-> HomeScreen-> Dock -> toggle show divider

E/Trebuchet.LauncherModel( 4888): Error loading shortcut Item(id=18 type=2 conta
iner=-101 screen=0 cellX=0 cellY=0 spanX=1 spanY=1 dropPos=null) into cell (7-0:
0,0) occupied by ShortcutInfo(title=Phoneintent=Intent { act=android.intent.acti
on.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.di
aler/.DialtactsActivity }id=10 type=0 container=-101 screen=0 cellX=0 cellY=0 sp
anX=1 spanY=1 dropPos=null)
D/OpenGLRenderer( 4888): Enabling debug mode 0
I/ActivityManager( 537): Displayed com.cyanogenmod.trebuchet/.Launcher: +1s74ms

E/Trebuchet.LauncherModel( 4888): Error loading shortcut ShortcutInfo(title=Face
bookintent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.
LAUNCHER] flg=0x10200000 cmp=com.facebook.katana/.LoginActivity }id=19 type=0 co
ntainer=-101 screen=0 cellX=1 cellY=0 spanX=1 spanY=1 dropPos=null) into cell (7
-0:1,0) occupied by ShortcutInfo(title=Peopleintent=Intent { act=android.intent.
action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.androi
d.contacts/.activities.PeopleActivity }id=12 type=0 container=-101 screen=0 cell
X=1 cellY=0 spanX=1 spanY=1 dropPos=null)
E/Trebuchet.LauncherModel( 4888): Error loading shortcut Item(id=20 type=2 conta
iner=-101 screen=0 cellX=1 cellY=0 spanX=1 spanY=1 dropPos=null) into cell (7-0:
1,0) occupied by ShortcutInfo(title=Peopleintent=Intent { act=android.intent.act
ion.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.c
ontacts/.activities.PeopleActivity }id=12 type=0 container=-101 screen=0 cellX=1
cellY=0 spanX=1 spanY=1 dropPos=null)
E/Trebuchet.LauncherModel( 4888): Error loading shortcut Item(id=21 type=2 conta
iner=-101 screen=0 cellX=1 cellY=0 spanX=1 spanY=1 dropPos=null) into cell (7-0:
1,0) occupied by ShortcutInfo(title=Peopleintent=Intent { act=android.intent.act
ion.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.c
ontacts/.activities.PeopleActivity }id=12 type=0 container=-101 screen=0 cellX=1
cellY=0 spanX=1 spanY=1 dropPos=null)
E/Trebuchet.LauncherModel( 4888): Error loading shortcut Item(id=22 type=2 conta
iner=-101 screen=0 cellX=1 cellY=0 spanX=1 spanY=1 dropPos=null) into cell (7-0:
1,0) occupied by ShortcutInfo(title=Peopleintent=Intent { act=android.intent.act
ion.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.c
ontacts/.activities.PeopleActivity }id=12 type=0 container=-101 screen=0 cellX=1
cellY=0 spanX=1 spanY=1 dropPos=null)
D/android.widget.GridLayout( 4888): vertical constraints: y3-y0>=396, y3-y0<=372
, y3-y2<=156, y2-y1<=3 are inconsistent; permanently removing: y3-y0<=372.

I looked at the code for LauncherModel.java, and it seems like what's happening is the index for the icons is screwed up. Basically, when Trebuchet tries to recreate the folder after reboot, it thinks that there isn't enough room to create the icons. It seems to stem from the checkItemPlacement() method (lime 914). That's where the error messages are coming from. Something is off in that 3 dimensional array (!!!). My guess would be that some index is off somewhere, so that Trebuchet isn't creating the folder (container) for the icons to go into, so it thinks it's out of room, and thus discards them.

Anyway, I'm not setup to build CM (I'm on Windows) so I can't monkey around with this myself. If this is an issue in the CM repo, and not just in PAC's fork, I hope this will prove useful in tracking down the issue. I had to switch to Nova, because it was too annoying to have to re-add all my icons constantly.

Cheers,

Ess

[MENTION=1184673]LorD ClockaN[/MENTION] - Can you test this on your homebrew build when you get a second?