am 4c38fe36: Merge "Protect against bogus input for ListViews" into jb-dev

* commit '4c38fe369fee76b8d4fca5a7b0b8d81a96f0219f':
  Protect against bogus input for ListViews
This commit is contained in:
Adam Powell
2012-06-07 12:14:21 -07:00
committed by Android Git Automerger
2 changed files with 19 additions and 0 deletions

View File

@ -3351,6 +3351,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mPositionScroller.stop();
}
if (!mIsAttached) {
// Something isn't right.
// Since we rely on being attached to get data set change notifications,
// don't risk doing anything where we might try to resync and find things
// in a bogus state.
return false;
}
if (mFastScroller != null) {
boolean intercepted = mFastScroller.onTouchEvent(ev);
if (intercepted) {
@ -3846,6 +3854,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mPositionScroller.stop();
}
if (!mIsAttached) {
// Something isn't right.
// Since we rely on being attached to get data set change notifications,
// don't risk doing anything where we might try to resync and find things
// in a bogus state.
return false;
}
if (mFastScroller != null) {
boolean intercepted = mFastScroller.onInterceptTouchEvent(ev);
if (intercepted) {

View File

@ -88,6 +88,9 @@ public class ListMenuPresenter implements MenuPresenter, AdapterView.OnItemClick
}
}
mMenu = menu;
if (mAdapter != null) {
mAdapter.notifyDataSetChanged();
}
}
@Override