Bug 538303 - Debug View wrong selection if activated by breakpoint

If a breakpoint is hit when the Debug View is not active, the Debug View
is activated. In some cases, this leads to a bad selection and expanded
state.

When the Debug View is activated, either by a breakpoint or by a user,
a state is saved in ViewerStateTracker. This state is cancelled by
TreeModelContentProvider on breakpoint hit, however without removing
COLLAPSED delta states. As such, applying the state later on will lead
to a collapsed thread, if the state had a collapsed flag for that
thread. This "overwrites" a thread selected by suspend handling.

This change should ensure that COLLAPSED thread state in
ViewerStateTracker is cleared when an expand is handled, regardless if
the tree had to be expanded or was expanded already by another
operation.

Change-Id: I7c43b8317081747c6d8e85020e7040e928c4f39b
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
3 files changed