Merge "Fixed that silent notifications weren't showing on AOD" into qt-r1-dev
am: 2738aa3f79
Change-Id: Ie5be54dffcfb61dfc6ea71bcd960634202dc8265
This commit is contained in:
@@ -4,7 +4,6 @@ import android.content.Context;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -32,7 +31,6 @@ import com.android.systemui.statusbar.notification.NotificationUtils;
|
|||||||
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||||
import com.android.systemui.tuner.TunerService;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -58,7 +56,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
private final KeyguardBypassController mBypassController;
|
private final KeyguardBypassController mBypassController;
|
||||||
private final DozeParameters mDozeParameters;
|
private final DozeParameters mDozeParameters;
|
||||||
|
|
||||||
private boolean mShowSilentOnLockscreen = true;
|
|
||||||
private int mIconSize;
|
private int mIconSize;
|
||||||
private int mIconHPadding;
|
private int mIconHPadding;
|
||||||
private int mIconTint = Color.WHITE;
|
private int mIconTint = Color.WHITE;
|
||||||
@@ -101,11 +98,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
|
|
||||||
initializeNotificationAreaViews(context);
|
initializeNotificationAreaViews(context);
|
||||||
reloadAodColor();
|
reloadAodColor();
|
||||||
|
|
||||||
TunerService tunerService = Dependency.get(TunerService.class);
|
|
||||||
tunerService.addTunable((key, newValue) -> {
|
|
||||||
mShowSilentOnLockscreen = "1".equals(newValue);
|
|
||||||
}, Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected View inflateIconArea(LayoutInflater inflater) {
|
protected View inflateIconArea(LayoutInflater inflater) {
|
||||||
@@ -238,7 +230,7 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean shouldShowNotificationIcon(NotificationEntry entry,
|
protected boolean shouldShowNotificationIcon(NotificationEntry entry,
|
||||||
boolean showAmbient, boolean showLowPriority, boolean hideDismissed,
|
boolean showAmbient, boolean hideDismissed,
|
||||||
boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hideCenteredIcon,
|
boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hideCenteredIcon,
|
||||||
boolean hidePulsing, boolean onlyShowCenteredIcon) {
|
boolean hidePulsing, boolean onlyShowCenteredIcon) {
|
||||||
|
|
||||||
@@ -257,9 +249,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
if (hideCurrentMedia && entry.key.equals(mMediaManager.getMediaNotificationKey())) {
|
if (hideCurrentMedia && entry.key.equals(mMediaManager.getMediaNotificationKey())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!showLowPriority && !entry.isHighPriority()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!entry.isTopLevelChild()) {
|
if (!entry.isTopLevelChild()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -297,7 +286,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
private void updateShelfIcons() {
|
private void updateShelfIcons() {
|
||||||
updateIconsForLayout(entry -> entry.expandedIcon, mShelfIcons,
|
updateIconsForLayout(entry -> entry.expandedIcon, mShelfIcons,
|
||||||
true /* showAmbient */,
|
true /* showAmbient */,
|
||||||
true /* showLowPriority */,
|
|
||||||
false /* hideDismissed */,
|
false /* hideDismissed */,
|
||||||
false /* hideRepliedMessages */,
|
false /* hideRepliedMessages */,
|
||||||
false /* hideCurrentMedia */,
|
false /* hideCurrentMedia */,
|
||||||
@@ -309,7 +297,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
public void updateStatusBarIcons() {
|
public void updateStatusBarIcons() {
|
||||||
updateIconsForLayout(entry -> entry.icon, mNotificationIcons,
|
updateIconsForLayout(entry -> entry.icon, mNotificationIcons,
|
||||||
false /* showAmbient */,
|
false /* showAmbient */,
|
||||||
true /* showLowPriority */,
|
|
||||||
true /* hideDismissed */,
|
true /* hideDismissed */,
|
||||||
true /* hideRepliedMessages */,
|
true /* hideRepliedMessages */,
|
||||||
false /* hideCurrentMedia */,
|
false /* hideCurrentMedia */,
|
||||||
@@ -321,7 +308,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
private void updateCenterIcon() {
|
private void updateCenterIcon() {
|
||||||
updateIconsForLayout(entry -> entry.centeredIcon, mCenteredIcon,
|
updateIconsForLayout(entry -> entry.centeredIcon, mCenteredIcon,
|
||||||
false /* showAmbient */,
|
false /* showAmbient */,
|
||||||
true /* showLowPriority */,
|
|
||||||
false /* hideDismissed */,
|
false /* hideDismissed */,
|
||||||
false /* hideRepliedMessages */,
|
false /* hideRepliedMessages */,
|
||||||
false /* hideCurrentMedia */,
|
false /* hideCurrentMedia */,
|
||||||
@@ -333,7 +319,6 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
public void updateAodNotificationIcons() {
|
public void updateAodNotificationIcons() {
|
||||||
updateIconsForLayout(entry -> entry.aodIcon, mAodIcons,
|
updateIconsForLayout(entry -> entry.aodIcon, mAodIcons,
|
||||||
false /* showAmbient */,
|
false /* showAmbient */,
|
||||||
mShowSilentOnLockscreen /* showLowPriority */,
|
|
||||||
true /* hideDismissed */,
|
true /* hideDismissed */,
|
||||||
true /* hideRepliedMessages */,
|
true /* hideRepliedMessages */,
|
||||||
true /* hideCurrentMedia */,
|
true /* hideCurrentMedia */,
|
||||||
@@ -353,7 +338,7 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
* @param hidePulsing should pulsing notifications be hidden
|
* @param hidePulsing should pulsing notifications be hidden
|
||||||
*/
|
*/
|
||||||
private void updateIconsForLayout(Function<NotificationEntry, StatusBarIconView> function,
|
private void updateIconsForLayout(Function<NotificationEntry, StatusBarIconView> function,
|
||||||
NotificationIconContainer hostLayout, boolean showAmbient, boolean showLowPriority,
|
NotificationIconContainer hostLayout, boolean showAmbient,
|
||||||
boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia,
|
boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia,
|
||||||
boolean hideCenteredIcon, boolean hidePulsing, boolean onlyShowCenteredIcon) {
|
boolean hideCenteredIcon, boolean hidePulsing, boolean onlyShowCenteredIcon) {
|
||||||
ArrayList<StatusBarIconView> toShow = new ArrayList<>(
|
ArrayList<StatusBarIconView> toShow = new ArrayList<>(
|
||||||
@@ -364,7 +349,7 @@ public class NotificationIconAreaController implements DarkReceiver,
|
|||||||
View view = mNotificationScrollLayout.getChildAt(i);
|
View view = mNotificationScrollLayout.getChildAt(i);
|
||||||
if (view instanceof ExpandableNotificationRow) {
|
if (view instanceof ExpandableNotificationRow) {
|
||||||
NotificationEntry ent = ((ExpandableNotificationRow) view).getEntry();
|
NotificationEntry ent = ((ExpandableNotificationRow) view).getEntry();
|
||||||
if (shouldShowNotificationIcon(ent, showAmbient, showLowPriority, hideDismissed,
|
if (shouldShowNotificationIcon(ent, showAmbient, hideDismissed,
|
||||||
hideRepliedMessages, hideCurrentMedia, hideCenteredIcon, hidePulsing,
|
hideRepliedMessages, hideCurrentMedia, hideCenteredIcon, hidePulsing,
|
||||||
onlyShowCenteredIcon)) {
|
onlyShowCenteredIcon)) {
|
||||||
StatusBarIconView iconView = function.apply(ent);
|
StatusBarIconView iconView = function.apply(ent);
|
||||||
|
|||||||
Reference in New Issue
Block a user