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
}
} 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
return false;
}
- boolean inUse = mPowerManager.isScreenOn()
- && (!mStatusBarKeyguardViewManager.isShowing()
- || mStatusBarKeyguardViewManager.isOccluded());
+ boolean inUse = mPowerManager.isScreenOn();
try {
inUse = inUse && !mDreamManager.isDreaming();
} catch (RemoteException e) {
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();
}
}
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()) {
@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();
}
mState = state;
mGroupManager.setStatusBarState(state);
+ mHeadsUpManager.setStatusBarState(state);
mFalsingManager.setStatusBarState(state);
mStatusBarWindowManager.setStatusBarState(state);
updateReportRejectedTouchVisibility();
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;
private boolean mIsObserving;
private boolean mRemoteInputActive;
private VisualStabilityManager mVisualStabilityManager;
+ private int mStatusBarState;
public HeadsUpManager(final Context context, View statusBarWindowView,
NotificationGroupManager groupManager) {
}
private boolean shouldHeadsUpBecomePinned(NotificationData.Entry entry) {
- return !mIsExpanded || hasFullScreenIntent(entry);
+ return mStatusBarState != StatusBarState.KEYGUARD
+ && !mIsExpanded || hasFullScreenIntent(entry);
}
private boolean hasFullScreenIntent(NotificationData.Entry entry) {
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.