am 8d9ca013: Fix monkey crash when tab==1 is requested in search mode
* commit '8d9ca013dbd0725dd04e6f3a0d9d138d19411832':
Fix monkey crash when tab==1 is requested in search mode
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 92152c8..1194a5e 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -854,9 +854,13 @@
private Fragment getFragment(int position) {
if (mTabPagerAdapterSearchMode) {
- if (position == 0) {
- return mAllFragment;
+ if (position != 0) {
+ // This has only been observed in monkey tests.
+ // Let's log this issue, but not crash
+ Log.w(TAG, "Request fragment at position=" + position + ", eventhough we " +
+ "are in search mode");
}
+ return mAllFragment;
} else {
if (position == TabState.FAVORITES) {
return mFavoritesFragment;