Merge "Fix position of gentle notif header after dismiss peoplehub"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java
index 8e9a051e..2761689 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java
@@ -249,10 +249,8 @@
}
}
- if (adjustPeopleHubVisibilityAndPosition(lastPersonIndex)) {
- // make room for peopleHub
- firstGentleNotifIndex++;
- }
+ // make room for peopleHub
+ firstGentleNotifIndex += adjustPeopleHubVisibilityAndPosition(lastPersonIndex);
adjustGentleHeaderVisibilityAndPosition(firstGentleNotifIndex);
@@ -296,7 +294,7 @@
}
}
- private boolean adjustPeopleHubVisibilityAndPosition(int lastPersonIndex) {
+ private int adjustPeopleHubVisibilityAndPosition(int lastPersonIndex) {
final boolean showPeopleHeader = mPeopleHubVisible
&& mNumberOfSections > 2
&& mStatusBarStateController.getState() != StatusBarState.KEYGUARD;
@@ -307,6 +305,7 @@
if (!showPeopleHeader) {
if (currentlyVisible) {
mParent.removeView(mPeopleHubView);
+ return -1;
}
} else {
mPeopleHubView.unDismiss();
@@ -317,7 +316,7 @@
mPeopleHubView.setTransientContainer(null);
}
mParent.addView(mPeopleHubView, targetIndex);
- return true;
+ return 1;
} else if (currentHubIndex != targetIndex) {
if (currentHubIndex < targetIndex) {
targetIndex--;
@@ -325,7 +324,7 @@
mParent.changeViewPosition(mPeopleHubView, targetIndex);
}
}
- return false;
+ return 0;
}
/**