Loading packages/SystemUI/src/com/android/systemui/statusbar/HeadsUpStatusBarView.java +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout { if (mShowingEntry != null) { CharSequence text = entry.headsUpStatusBarText; if (entry.isSensitive()) { if (entry.isSensitive().getValue()) { text = entry.headsUpStatusBarTextPublic; } mTextView.setText(text); Loading packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,7 @@ constructor( } if (view is ExpandableNotificationRow) { // Only drag down on sensitive views, otherwise the ExpandHelper will take this return view.entry.isSensitive return view.entry.isSensitive.value } } return false Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +13 −8 Original line number Diff line number Diff line Loading @@ -76,6 +76,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; import kotlinx.coroutines.flow.MutableStateFlow; import kotlinx.coroutines.flow.StateFlow; import kotlinx.coroutines.flow.StateFlowKt; /** * Represents a notification that the system UI knows about * Loading Loading @@ -162,8 +166,8 @@ public final class NotificationEntry extends ListEntry { */ private boolean hasSentReply; private boolean mSensitive = true; private ListenerSet<OnSensitivityChangedListener> mOnSensitivityChangedListeners = private final MutableStateFlow<Boolean> mSensitive = StateFlowKt.MutableStateFlow(true); private final ListenerSet<OnSensitivityChangedListener> mOnSensitivityChangedListeners = new ListenerSet<>(); private boolean mPulseSupressed; Loading Loading @@ -934,6 +938,11 @@ public final class NotificationEntry extends ListEntry { return Objects.equals(n.category, category); } /** @see #setSensitive(boolean, boolean) */ public StateFlow<Boolean> isSensitive() { return mSensitive; } /** * Set this notification to be sensitive. * Loading @@ -942,8 +951,8 @@ public final class NotificationEntry extends ListEntry { */ public void setSensitive(boolean sensitive, boolean deviceSensitive) { getRow().setSensitive(sensitive, deviceSensitive); if (sensitive != mSensitive) { mSensitive = sensitive; if (sensitive != mSensitive.getValue()) { mSensitive.setValue(sensitive); for (NotificationEntry.OnSensitivityChangedListener listener : mOnSensitivityChangedListeners) { listener.onSensitivityChanged(this); Loading @@ -951,10 +960,6 @@ public final class NotificationEntry extends ListEntry { } } public boolean isSensitive() { return mSensitive; } /** Add a listener to be notified when the entry's sensitivity changes. */ public void addOnSensitivityChangedListener(OnSensitivityChangedListener listener) { mOnSensitivityChangedListeners.addIfAbsent(listener); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt +5 −5 Original line number Diff line number Diff line Loading @@ -39,13 +39,13 @@ import com.android.systemui.statusbar.notification.InflationException import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener import java.util.concurrent.ConcurrentHashMap import javax.inject.Inject import kotlin.coroutines.CoroutineContext import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.util.concurrent.ConcurrentHashMap import javax.inject.Inject import kotlin.coroutines.CoroutineContext /** * Inflates and updates icons associated with notifications Loading Loading @@ -206,7 +206,7 @@ constructor( private fun getIconDescriptors(entry: NotificationEntry): Pair<StatusBarIcon, StatusBarIcon> { val iconDescriptor = getIconDescriptor(entry, redact = false) val sensitiveDescriptor = if (entry.isSensitive) { if (entry.isSensitive.value) { getIconDescriptor(entry, redact = true) } else { iconDescriptor Loading Loading @@ -376,7 +376,7 @@ constructor( val isSmallIcon = iconDescriptor.icon.equals(entry.sbn.notification.smallIcon) return isImportantConversation(entry) && !isSmallIcon && (!usedInSensitiveContext || !entry.isSensitive) (!usedInSensitiveContext || !entry.isSensitive.value) } private fun isImportantConversation(entry: NotificationEntry): Boolean { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +1 −1 Original line number Diff line number Diff line Loading @@ -247,7 +247,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, CommandQu if (nowExpanded) { if (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) { mShadeTransitionController.goToLockedShade(clickedEntry.getRow()); } else if (clickedEntry.isSensitive() } else if (clickedEntry.isSensitive().getValue() && mDynamicPrivacyController.isInLockedDownShade()) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); mActivityStarter.dismissKeyguardThenExecute(() -> false /* dismissAction */ Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/HeadsUpStatusBarView.java +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout { if (mShowingEntry != null) { CharSequence text = entry.headsUpStatusBarText; if (entry.isSensitive()) { if (entry.isSensitive().getValue()) { text = entry.headsUpStatusBarTextPublic; } mTextView.setText(text); Loading
packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,7 @@ constructor( } if (view is ExpandableNotificationRow) { // Only drag down on sensitive views, otherwise the ExpandHelper will take this return view.entry.isSensitive return view.entry.isSensitive.value } } return false Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +13 −8 Original line number Diff line number Diff line Loading @@ -76,6 +76,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; import kotlinx.coroutines.flow.MutableStateFlow; import kotlinx.coroutines.flow.StateFlow; import kotlinx.coroutines.flow.StateFlowKt; /** * Represents a notification that the system UI knows about * Loading Loading @@ -162,8 +166,8 @@ public final class NotificationEntry extends ListEntry { */ private boolean hasSentReply; private boolean mSensitive = true; private ListenerSet<OnSensitivityChangedListener> mOnSensitivityChangedListeners = private final MutableStateFlow<Boolean> mSensitive = StateFlowKt.MutableStateFlow(true); private final ListenerSet<OnSensitivityChangedListener> mOnSensitivityChangedListeners = new ListenerSet<>(); private boolean mPulseSupressed; Loading Loading @@ -934,6 +938,11 @@ public final class NotificationEntry extends ListEntry { return Objects.equals(n.category, category); } /** @see #setSensitive(boolean, boolean) */ public StateFlow<Boolean> isSensitive() { return mSensitive; } /** * Set this notification to be sensitive. * Loading @@ -942,8 +951,8 @@ public final class NotificationEntry extends ListEntry { */ public void setSensitive(boolean sensitive, boolean deviceSensitive) { getRow().setSensitive(sensitive, deviceSensitive); if (sensitive != mSensitive) { mSensitive = sensitive; if (sensitive != mSensitive.getValue()) { mSensitive.setValue(sensitive); for (NotificationEntry.OnSensitivityChangedListener listener : mOnSensitivityChangedListeners) { listener.onSensitivityChanged(this); Loading @@ -951,10 +960,6 @@ public final class NotificationEntry extends ListEntry { } } public boolean isSensitive() { return mSensitive; } /** Add a listener to be notified when the entry's sensitivity changes. */ public void addOnSensitivityChangedListener(OnSensitivityChangedListener listener) { mOnSensitivityChangedListeners.addIfAbsent(listener); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt +5 −5 Original line number Diff line number Diff line Loading @@ -39,13 +39,13 @@ import com.android.systemui.statusbar.notification.InflationException import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener import java.util.concurrent.ConcurrentHashMap import javax.inject.Inject import kotlin.coroutines.CoroutineContext import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.util.concurrent.ConcurrentHashMap import javax.inject.Inject import kotlin.coroutines.CoroutineContext /** * Inflates and updates icons associated with notifications Loading Loading @@ -206,7 +206,7 @@ constructor( private fun getIconDescriptors(entry: NotificationEntry): Pair<StatusBarIcon, StatusBarIcon> { val iconDescriptor = getIconDescriptor(entry, redact = false) val sensitiveDescriptor = if (entry.isSensitive) { if (entry.isSensitive.value) { getIconDescriptor(entry, redact = true) } else { iconDescriptor Loading Loading @@ -376,7 +376,7 @@ constructor( val isSmallIcon = iconDescriptor.icon.equals(entry.sbn.notification.smallIcon) return isImportantConversation(entry) && !isSmallIcon && (!usedInSensitiveContext || !entry.isSensitive) (!usedInSensitiveContext || !entry.isSensitive.value) } private fun isImportantConversation(entry: NotificationEntry): Boolean { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +1 −1 Original line number Diff line number Diff line Loading @@ -247,7 +247,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, CommandQu if (nowExpanded) { if (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) { mShadeTransitionController.goToLockedShade(clickedEntry.getRow()); } else if (clickedEntry.isSensitive() } else if (clickedEntry.isSensitive().getValue() && mDynamicPrivacyController.isInLockedDownShade()) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); mActivityStarter.dismissKeyguardThenExecute(() -> false /* dismissAction */ Loading