summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2019-07-23 18:44:07 -0700
committerSelim Cinek <cinek@google.com>2019-07-23 18:44:07 -0700
commitabcc201afb105d57d234e6fdd88b2e77ceed7707 (patch)
tree82629a172a58493ae20262364cf1e9e3f6ce9d3c
parent2738aa3f79041f8be9183dcc35c9e0220f6829d8 (diff)
Not asking for the password when dragging down and bypass
Instead we'll just keep them in there looking like locked notifications. Fixes: 138225058 Test: add notifications, enable dynamic privacy, drag down Change-Id: Ica49035ba3fe655c145f81be962817ddd294c48d
-rw-r--r--core/java/android/app/Notification.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java3
4 files changed, 13 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f66448f518c8..ceadd8510e44 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5437,10 +5437,11 @@ public class Notification implements Parcelable
/**
* Construct a RemoteViews for the display in public contexts like on the lockscreen.
*
+ * @param isLowPriority is this notification low priority
* @hide
*/
@UnsupportedAppUsage
- public RemoteViews makePublicContentView() {
+ public RemoteViews makePublicContentView(boolean isLowPriority) {
if (mN.publicVersion != null) {
final Builder builder = recoverBuilder(mContext, mN.publicVersion);
return builder.createContentView();
@@ -5467,7 +5468,11 @@ public class Notification implements Parcelable
}
mN.extras = publicExtras;
RemoteViews view;
- view = makeNotificationHeader();
+ StandardTemplateParams params = mParams.reset().fillTextsFrom(this);
+ if (isLowPriority) {
+ params.forceDefaultColor();
+ }
+ view = makeNotificationHeader(params);
view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true);
mN.extras = savedBundle;
mN.mLargeIcon = largeIcon;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
index d057a1d2f20b..48a82957bf1e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
@@ -349,7 +349,7 @@ public class NotificationContentInflater {
}
if ((reInflateFlags & FLAG_CONTENT_VIEW_PUBLIC) != 0) {
- result.newPublicView = builder.makePublicContentView();
+ result.newPublicView = builder.makePublicContentView(isLowPriority);
}
result.packageContext = packageContext;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 9e3d74b138fa..3dae283e4b7e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -5668,6 +5668,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
// The bottom might change because we're using the final actual height of the view
mAnimateBottomOnLayout = true;
}
+ // Let's update the footer once the notifications have been updated (in the next frame)
+ post(this::updateFooter);
}
public void setOnPulseHeightChangedListener(Runnable listener) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index d93dc950a077..f6467d61c332 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -3563,6 +3563,9 @@ public class StatusBar extends SystemUI implements DemoMode,
userAllowsPrivateNotificationsInPublic(mLockscreenUserManager.getCurrentUserId())
|| !mLockscreenUserManager.shouldShowLockscreenNotifications()
|| mFalsingManager.shouldEnforceBouncer();
+ if (mKeyguardBypassController.getBypassEnabled()) {
+ fullShadeNeedsBouncer = false;
+ }
if (mLockscreenUserManager.isLockscreenPublicMode(userId) && fullShadeNeedsBouncer) {
mStatusBarStateController.setLeaveOpenOnKeyguardHide(true);
showBouncerIfKeyguard();