Allowing heads-up notifications now on the lock screen
am: ab24dc9f29
Change-Id: I7677c513dba5d787e44bdd73b3cc5d9c004305f5
This commit is contained in:
@@ -2295,7 +2295,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
|
||||
@@ -2550,9 +2552,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) {
|
||||
@@ -2591,7 +2591,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
@@ -1514,11 +1514,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();
|
||||
|
||||
@@ -4504,6 +4504,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
mState = state;
|
||||
mGroupManager.setStatusBarState(state);
|
||||
mHeadsUpManager.setStatusBarState(state);
|
||||
mFalsingManager.setStatusBarState(state);
|
||||
mStatusBarWindowManager.setStatusBarState(state);
|
||||
updateReportRejectedTouchVisibility();
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user