Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +50 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,13 @@ package com.android.systemui.statusbar; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_AMBIENT; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_FULL_SCREEN_INTENT; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_LIGHTS; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_NOTIFICATION_LIST; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR; import android.app.AppGlobals; import android.app.AppOpsManager; import android.app.Notification; Loading Loading @@ -445,20 +452,47 @@ public class NotificationData { return Ranking.VISIBILITY_NO_OVERRIDE; } public boolean shouldSuppressScreenOff(String key) { public boolean shouldSuppressFullScreenIntent(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_FULL_SCREEN_INTENT) != 0; } return false; } public boolean shouldSuppressPeek(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_PEEK) != 0; } return false; } public boolean shouldSuppressStatusBar(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF) != 0; & SUPPRESSED_EFFECT_STATUS_BAR) != 0; } return false; } public boolean shouldSuppressScreenOn(String key) { public boolean shouldSuppressAmbient(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_ON) != 0; & SUPPRESSED_EFFECT_AMBIENT) != 0; } return false; } public boolean shouldSuppressNotificationList(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_NOTIFICATION_LIST) != 0; } return false; } Loading Loading @@ -576,6 +610,14 @@ public class NotificationData { return true; } if (mEnvironment.isDozing() && shouldSuppressAmbient(sbn.getKey())) { return true; } if (!mEnvironment.isDozing() && shouldSuppressNotificationList(sbn.getKey())) { return true; } if (!StatusBar.ENABLE_CHILD_NOTIFICATIONS && mGroupManager.isChildInGroupWithSummary(sbn)) { return true; Loading Loading @@ -670,5 +712,9 @@ public class NotificationData { public boolean isNotificationForCurrentProfiles(StatusBarNotification sbn); public String getCurrentMediaNotificationKey(); public NotificationGroupManager getGroupManager(); /** * @return true iff the device is dozing */ boolean isDozing(); } } packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java +4 −7 Original line number Diff line number Diff line Loading @@ -304,11 +304,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. return true; } if (mPowerManager.isInteractive()) { return mNotificationData.shouldSuppressScreenOn(key); } else { return mNotificationData.shouldSuppressScreenOff(key); } return mNotificationData.shouldSuppressFullScreenIntent(key); } private void inflateViews(NotificationData.Entry entry, ViewGroup parent) { Loading Loading @@ -849,12 +845,13 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. return false; } if (!mPresenter.isDozing() && mNotificationData.shouldSuppressScreenOn(sbn.getKey())) { if (!mPresenter.isDozing() && mNotificationData.shouldSuppressPeek(sbn.getKey())) { if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); return false; } if (mPresenter.isDozing() && mNotificationData.shouldSuppressScreenOff(sbn.getKey())) { // Peeking triggers an ambient display pulse, so disable peek is ambient is active if (mPresenter.isDozing() && mNotificationData.shouldSuppressAmbient(sbn.getKey())) { if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); return false; } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java +0 −5 Original line number Diff line number Diff line Loading @@ -100,11 +100,6 @@ public interface NotificationPresenter extends NotificationData.Environment, */ void updateNotificationViews(); /** * @return true iff the device is dozing */ boolean isDozing(); /** * Returns the maximum number of notifications to show while locked. * Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ public class NotificationIconAreaController implements DarkReceiver { } // showAmbient == show in shade but not shelf if (!showAmbient && notificationData.shouldSuppressScreenOn(entry.key)) { if (!showAmbient && notificationData.shouldSuppressStatusBar(entry.key)) { return false; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −0 Original line number Diff line number Diff line Loading @@ -4603,6 +4603,7 @@ public class StatusBar extends SystemUI implements DemoMode, if (mAmbientIndicationContainer instanceof DozeReceiver) { ((DozeReceiver) mAmbientIndicationContainer).setDozing(mDozing); } mEntryManager.updateNotifications(); updateDozingState(); updateReportRejectedTouchVisibility(); Trace.endSection(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +50 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,13 @@ package com.android.systemui.statusbar; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_AMBIENT; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_FULL_SCREEN_INTENT; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_LIGHTS; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_NOTIFICATION_LIST; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR; import android.app.AppGlobals; import android.app.AppOpsManager; import android.app.Notification; Loading Loading @@ -445,20 +452,47 @@ public class NotificationData { return Ranking.VISIBILITY_NO_OVERRIDE; } public boolean shouldSuppressScreenOff(String key) { public boolean shouldSuppressFullScreenIntent(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_FULL_SCREEN_INTENT) != 0; } return false; } public boolean shouldSuppressPeek(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_PEEK) != 0; } return false; } public boolean shouldSuppressStatusBar(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF) != 0; & SUPPRESSED_EFFECT_STATUS_BAR) != 0; } return false; } public boolean shouldSuppressScreenOn(String key) { public boolean shouldSuppressAmbient(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_ON) != 0; & SUPPRESSED_EFFECT_AMBIENT) != 0; } return false; } public boolean shouldSuppressNotificationList(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return (mTmpRanking.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_NOTIFICATION_LIST) != 0; } return false; } Loading Loading @@ -576,6 +610,14 @@ public class NotificationData { return true; } if (mEnvironment.isDozing() && shouldSuppressAmbient(sbn.getKey())) { return true; } if (!mEnvironment.isDozing() && shouldSuppressNotificationList(sbn.getKey())) { return true; } if (!StatusBar.ENABLE_CHILD_NOTIFICATIONS && mGroupManager.isChildInGroupWithSummary(sbn)) { return true; Loading Loading @@ -670,5 +712,9 @@ public class NotificationData { public boolean isNotificationForCurrentProfiles(StatusBarNotification sbn); public String getCurrentMediaNotificationKey(); public NotificationGroupManager getGroupManager(); /** * @return true iff the device is dozing */ boolean isDozing(); } }
packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java +4 −7 Original line number Diff line number Diff line Loading @@ -304,11 +304,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. return true; } if (mPowerManager.isInteractive()) { return mNotificationData.shouldSuppressScreenOn(key); } else { return mNotificationData.shouldSuppressScreenOff(key); } return mNotificationData.shouldSuppressFullScreenIntent(key); } private void inflateViews(NotificationData.Entry entry, ViewGroup parent) { Loading Loading @@ -849,12 +845,13 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. return false; } if (!mPresenter.isDozing() && mNotificationData.shouldSuppressScreenOn(sbn.getKey())) { if (!mPresenter.isDozing() && mNotificationData.shouldSuppressPeek(sbn.getKey())) { if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); return false; } if (mPresenter.isDozing() && mNotificationData.shouldSuppressScreenOff(sbn.getKey())) { // Peeking triggers an ambient display pulse, so disable peek is ambient is active if (mPresenter.isDozing() && mNotificationData.shouldSuppressAmbient(sbn.getKey())) { if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); return false; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java +0 −5 Original line number Diff line number Diff line Loading @@ -100,11 +100,6 @@ public interface NotificationPresenter extends NotificationData.Environment, */ void updateNotificationViews(); /** * @return true iff the device is dozing */ boolean isDozing(); /** * Returns the maximum number of notifications to show while locked. * Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ public class NotificationIconAreaController implements DarkReceiver { } // showAmbient == show in shade but not shelf if (!showAmbient && notificationData.shouldSuppressScreenOn(entry.key)) { if (!showAmbient && notificationData.shouldSuppressStatusBar(entry.key)) { return false; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −0 Original line number Diff line number Diff line Loading @@ -4603,6 +4603,7 @@ public class StatusBar extends SystemUI implements DemoMode, if (mAmbientIndicationContainer instanceof DozeReceiver) { ((DozeReceiver) mAmbientIndicationContainer).setDozing(mDozing); } mEntryManager.updateNotifications(); updateDozingState(); updateReportRejectedTouchVisibility(); Trace.endSection(); Loading