Fix crash after screen rotation in group view.
Test
Manual:
* view group
* rotate screen
* switch back to main contacts list
* verify that the app doesn't crash.
Bug 32312692
Change-Id: I5f467d23f1c6eff75ded31795f3430ef71c7b535
diff --git a/src/com/android/contacts/common/util/AccountFilterUtil.java b/src/com/android/contacts/common/util/AccountFilterUtil.java
index b89e8b9..96c5113 100644
--- a/src/com/android/contacts/common/util/AccountFilterUtil.java
+++ b/src/com/android/contacts/common/util/AccountFilterUtil.java
@@ -219,7 +219,8 @@
public static String getActionBarTitleForFilter(Context context, ContactListFilter filter) {
if (filter.filterType == ContactListFilter.FILTER_TYPE_DEVICE_CONTACTS) {
return context.getString(R.string.account_phone);
- } else if (!TextUtils.isEmpty(filter.accountName)) {
+ } else if (filter.filterType == ContactListFilter.FILTER_TYPE_ACCOUNT &&
+ !TextUtils.isEmpty(filter.accountName)) {
return getActionBarTitleForAccount(context, filter);
}
return context.getString(R.string.contactsList);