From ccd14fbcfe613eae71f0e00c39f38e5125749389 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 12 Aug 2014 18:53:24 +0200 Subject: Reset the notification expanded states on screen off To avoid having expanded notifications sticking around Bug: 16005498 Change-Id: Ib5b184fa7eb67ada85305e7ca4afad68a1514327 --- .../systemui/statusbar/ExpandableNotificationRow.java | 5 +++++ .../android/systemui/statusbar/phone/PhoneStatusBar.java | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'packages/SystemUI/src') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 0960c00..caee1aa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -150,6 +150,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { logExpansionEvent(true, wasExpanded); } + public void resetUserExpansion() { + mHasUserChangedExpansion = false; + mUserExpanded = false; + } + public boolean isUserLocked() { return mUserLocked; } 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 a2f8931..4758a1c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -113,7 +113,6 @@ import com.android.systemui.R; import com.android.systemui.doze.DozeService; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.qs.QSPanel; -import com.android.systemui.qs.QSTile; import com.android.systemui.statusbar.ActivatableNotificationView; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.CommandQueue; @@ -2923,6 +2922,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, notifyHeadsUpScreenOn(false); finishBarAnimations(); stopNotificationLogging(); + resetUserExpandedStates(); } else if (Intent.ACTION_SCREEN_ON.equals(action)) { mScreenOn = true; @@ -2951,6 +2951,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } }; + private void resetUserExpandedStates() { + ArrayList activeNotifications = mNotificationData.getActiveNotifications(); + final int notificationCount = activeNotifications.size(); + for (int i = 0; i < notificationCount; i++) { + NotificationData.Entry entry = activeNotifications.get(i); + if (entry.row != null) { + entry.row.resetUserExpansion(); + } + } + } + @Override protected void dismissKeyguardThenExecute(final OnDismissAction action) { if (mStatusBarKeyguardViewManager.isShowing()) { -- cgit v1.1