Avoid IPC call with an empty array

Don't call setNotificationsShown() from status bar when notifications
are hiding. It should only be called when there's some new notification
to report as seen. This is just an optimization.

Bug: 21785854
Change-Id: I1f6024fea29694201284bd27d4b30460a62f0b57
This commit is contained in:
Amith Yamasani
2015-07-07 15:22:54 -07:00
parent 401aa9d807
commit 76495678a4

View File

@@ -3035,11 +3035,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
final int N = newlyVisible.size();
String[] newlyVisibleKeyAr = new String[N];
for (int i = 0; i < N; i++) {
newlyVisibleKeyAr[i] = newlyVisibleAr[i].key;
if (N > 0) {
String[] newlyVisibleKeyAr = new String[N];
for (int i = 0; i < N; i++) {
newlyVisibleKeyAr[i] = newlyVisibleAr[i].key;
}
setNotificationsShown(newlyVisibleKeyAr);
}
setNotificationsShown(newlyVisibleKeyAr);
}
// State logging