summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2015-07-07 15:22:54 -0700
committerAmith Yamasani <yamasani@google.com>2015-07-07 15:27:12 -0700
commit76495678a4e685f031f532aa8c8e902f54cb5624 (patch)
treebf9abc7e67540d4e18de21b412a8b5956cdc9596 /packages
parent401aa9d807bdc568f26cd40bfc96d26449267678 (diff)
downloadframeworks_base-76495678a4e685f031f532aa8c8e902f54cb5624.zip
frameworks_base-76495678a4e685f031f532aa8c8e902f54cb5624.tar.gz
frameworks_base-76495678a4e685f031f532aa8c8e902f54cb5624.tar.bz2
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
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index a637e24..135e2d2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -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