summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2016-12-21 18:23:11 +0100
committer Selim Cinek <cinek@google.com> 2017-01-12 01:08:09 +0000
commitab24dc9f290a58e6af2ff20c46301637dfd21a55 (patch)
treed42f346689309c11678f2bb3798b5f76c904d750
parentadd9526b1dd91360d0413296f2dbcb2053480162 (diff)
Allowing heads-up notifications now on the lock screen
In order to isolate notifications properly from their group and in order to allow them to visually reorder, we now allow heads up notifications on the lock screen. Merged-In: I1d04a92e66ae92ecee4f8ee23b218c2b167dadd4 Change-Id: I1d04a92e66ae92ecee4f8ee23b218c2b167dadd4 Test: existing tests pass Test: add heads up on lockscreen Test: heads up group child on lockscreen Bug: 33773401
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java9
4 files changed, 19 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index dda82c695107..4824a3945ccd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -2291,7 +2291,9 @@ public abstract class BaseStatusBar extends SystemUI implements
}
} else {
boolean wasGone = entry.row.getVisibility() == View.GONE;
- entry.row.setVisibility(View.VISIBLE);
+ if (wasGone) {
+ entry.row.setVisibility(View.VISIBLE);
+ }
if (!childNotification && !entry.row.isRemoved()) {
if (wasGone) {
// notify the scroller of a child addition
@@ -2546,9 +2548,7 @@ public abstract class BaseStatusBar extends SystemUI implements
return false;
}
- boolean inUse = mPowerManager.isScreenOn()
- && (!mStatusBarKeyguardViewManager.isShowing()
- || mStatusBarKeyguardViewManager.isOccluded());
+ boolean inUse = mPowerManager.isScreenOn();
try {
inUse = inUse && !mDreamManager.isDreaming();
} catch (RemoteException e) {
@@ -2587,7 +2587,9 @@ public abstract class BaseStatusBar extends SystemUI implements
if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey());
return false;
} else {
- return true;
+ // we only allow head-up on the lockscreen if it doesn't have a fullscreen intent
+ return !mStatusBarKeyguardViewManager.isShowing()
+ || mStatusBarKeyguardViewManager.isOccluded();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index b5036ffb95f7..f54af4437cdd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -1215,7 +1215,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
return getMinHeight();
} else if (mIsSummaryWithChildren && !mOnKeyguard) {
return mChildrenContainer.getIntrinsicHeight();
- } else if (mIsHeadsUp || mHeadsupDisappearRunning) {
+ } else if (!mOnKeyguard && (mIsHeadsUp || mHeadsupDisappearRunning)) {
if (isPinned() || mHeadsupDisappearRunning) {
return getPinnedHeadsUpHeight(true /* atLeastMinHeight */);
} else if (isExpanded()) {
@@ -1513,11 +1513,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
@Override
public int getMinHeight() {
- if (mIsHeadsUp && mHeadsUpManager.isTrackingHeadsUp()) {
+ if (!mOnKeyguard && mIsHeadsUp && mHeadsUpManager.isTrackingHeadsUp()) {
return getPinnedHeadsUpHeight(false /* atLeastMinHeight */);
} else if (mIsSummaryWithChildren && !isGroupExpanded() && !mShowingPublic) {
return mChildrenContainer.getMinHeight();
- } else if (mIsHeadsUp) {
+ } else if (!mOnKeyguard && mIsHeadsUp) {
return mHeadsUpHeight;
}
NotificationContentView showingLayout = getShowingLayout();
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 bb5e69cdd95f..b6bcf4238863 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -4524,6 +4524,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
mState = state;
mGroupManager.setStatusBarState(state);
+ mHeadsUpManager.setStatusBarState(state);
mFalsingManager.setStatusBarState(state);
mStatusBarWindowManager.setStatusBarState(state);
updateReportRejectedTouchVisibility();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java
index 0b3231eb96c6..edca70443c5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java
@@ -34,6 +34,7 @@ import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationData;
+import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
@@ -109,6 +110,7 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL
private boolean mIsObserving;
private boolean mRemoteInputActive;
private VisualStabilityManager mVisualStabilityManager;
+ private int mStatusBarState;
public HeadsUpManager(final Context context, View statusBarWindowView,
NotificationGroupManager groupManager) {
@@ -216,7 +218,8 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL
}
private boolean shouldHeadsUpBecomePinned(NotificationData.Entry entry) {
- return !mIsExpanded || hasFullScreenIntent(entry);
+ return mStatusBarState != StatusBarState.KEYGUARD
+ && !mIsExpanded || hasFullScreenIntent(entry);
}
private boolean hasFullScreenIntent(NotificationData.Entry entry) {
@@ -623,6 +626,10 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL
mVisualStabilityManager = visualStabilityManager;
}
+ public void setStatusBarState(int statusBarState) {
+ mStatusBarState = statusBarState;
+ }
+
/**
* This represents a notification and how long it is in a heads up mode. It also manages its
* lifecycle automatically when created.