diff options
author | Chris Wren <cwren@android.com> | 2015-06-24 17:54:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-24 17:54:23 +0000 |
commit | ccba036dd37a99c3beaf1cdf58665109c4931b19 (patch) | |
tree | d110ba975877c061a42c162f903e10a79645c173 /packages | |
parent | 521db337f3aa4e72e047b00aa5bee086be2b0434 (diff) | |
parent | 1689594851a6dd985cff69913e7f4bc548062808 (diff) | |
download | frameworks_base-ccba036dd37a99c3beaf1cdf58665109c4931b19.zip frameworks_base-ccba036dd37a99c3beaf1cdf58665109c4931b19.tar.gz frameworks_base-ccba036dd37a99c3beaf1cdf58665109c4931b19.tar.bz2 |
Merge "don't clear notification effects in response to peeks" into mnc-dev
Diffstat (limited to 'packages')
6 files changed, 37 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 9d6204c..8d20772 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1617,8 +1617,9 @@ public abstract class BaseStatusBar extends SystemUI implements protected void handleVisibleToUserChanged(boolean visibleToUser) { try { if (visibleToUser) { - boolean clearNotificationEffects = mShowLockscreenNotifications || - (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED); + boolean clearNotificationEffects = !isPanelFullyCollapsed() && + (mShowLockscreenNotifications || + (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED)); mBarService.onPanelRevealed(clearNotificationEffects); } else { mBarService.onPanelHidden(); @@ -1629,6 +1630,19 @@ public abstract class BaseStatusBar extends SystemUI implements } /** + * Clear Buzz/Beep/Blink. + */ + public void clearNotificationEffects() { + try { + mBarService.clearNotificationEffects(); + } catch (RemoteException e) { + // Won't fail unless the world has ended. + } + } + + protected abstract boolean isPanelFullyCollapsed(); + + /** * Cancel this notification and tell the StatusBarManagerService / NotificationManagerService * about the failure. * diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java index 10c35af..df8c7fa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java @@ -114,6 +114,7 @@ public class HeadsUpTouchHelper implements Gefingerpoken { / mPanel.getMaxPanelHeight()); mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight + mNotificationsTopPadding); + mPanel.clearNotificattonEffects(); mHeadsUpManager.unpinAll(); return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index c30cb34..cf0d670 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -2340,4 +2340,8 @@ public class NotificationPanelView extends PanelView implements public void setPanelScrimMinFraction(float minFraction) { mBar.panelScrimMinFractionChanged(minFraction); } + + public void clearNotificattonEffects() { + mStatusBar.clearNotificationEffects(); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java index cf553ec..e1a400d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -28,6 +28,8 @@ import java.util.ArrayList; public abstract class PanelBar extends FrameLayout { public static final boolean DEBUG = false; public static final String TAG = PanelBar.class.getSimpleName(); + private static final boolean SPEW = false; + public static final void LOG(String fmt, Object... args) { if (!DEBUG) return; Log.v(TAG, String.format(fmt, args)); @@ -167,7 +169,7 @@ public abstract class PanelBar extends FrameLayout { public void panelExpansionChanged(PanelView panel, float frac, boolean expanded) { boolean fullyClosed = true; PanelView fullyOpenedPanel = null; - if (DEBUG) LOG("panelExpansionChanged: start state=%d panel=%s", mState, panel.getName()); + if (SPEW) LOG("panelExpansionChanged: start state=%d panel=%s", mState, panel.getName()); mPanelExpandedFractionSum = 0f; for (PanelView pv : mPanels) { pv.setVisibility(expanded ? View.VISIBLE : View.INVISIBLE); @@ -180,7 +182,7 @@ public abstract class PanelBar extends FrameLayout { fullyClosed = false; final float thisFrac = pv.getExpandedFraction(); mPanelExpandedFractionSum += thisFrac; - if (DEBUG) LOG("panelExpansionChanged: -> %s: f=%.1f", pv.getName(), thisFrac); + if (SPEW) LOG("panelExpansionChanged: -> %s: f=%.1f", pv.getName(), thisFrac); if (panel == pv) { if (thisFrac == 1f) fullyOpenedPanel = panel; } @@ -195,7 +197,7 @@ public abstract class PanelBar extends FrameLayout { onAllPanelsCollapsed(); } - if (DEBUG) LOG("panelExpansionChanged: end state=%d [%s%s ]", mState, + if (SPEW) LOG("panelExpansionChanged: end state=%d [%s%s ]", mState, (fullyOpenedPanel!=null)?" fullyOpened":"", fullyClosed?" fullyClosed":""); } @@ -241,7 +243,7 @@ public abstract class PanelBar extends FrameLayout { } public void onExpandingFinished() { - + if (DEBUG) LOG("onExpandingFinished"); } public void onClosingFinished() { 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 9e6dd7e..7f87485 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3290,6 +3290,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, return mState; } + @Override + protected boolean isPanelFullyCollapsed() { + return mNotificationPanel.isFullyCollapsed(); + } + public void showKeyguard() { if (mLaunchTransitionFadingAway) { mNotificationPanel.animate().cancel(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java index a5684a4..920b682 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java @@ -125,6 +125,11 @@ public class TvStatusBar extends BaseStatusBar { } @Override + protected boolean isPanelFullyCollapsed() { + return false; + } + + @Override protected int getMaxKeyguardNotifications() { return 0; } |