Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +7 −23 Original line number Original line Diff line number Diff line Loading @@ -687,13 +687,7 @@ public abstract class BaseStatusBar extends SystemUI implements setHeadsUpUser(newUserId); setHeadsUpUser(newUserId); } } private void setHeadsUpUser(int newUserId) { protected abstract void setHeadsUpUser(int newUserId); mHeadsUpManager.setUser(newUserId); } public boolean isHeadsUp(String key) { return mHeadsUpManager.isHeadsUp(key); } @Override // NotificationData.Environment @Override // NotificationData.Environment public boolean isNotificationForCurrentProfiles(StatusBarNotification n) { public boolean isNotificationForCurrentProfiles(StatusBarNotification n) { Loading Loading @@ -1578,7 +1572,7 @@ public abstract class BaseStatusBar extends SystemUI implements mCurrentUserId); mCurrentUserId); dismissKeyguardThenExecute(new OnDismissAction() { dismissKeyguardThenExecute(new OnDismissAction() { public boolean onDismiss() { public boolean onDismiss() { if (mHeadsUpManager.isHeadsUp(mNotificationKey)) { if (mHeadsUpManager != null && mHeadsUpManager.isHeadsUp(mNotificationKey)) { // Release the HUN notification to the shade. // Release the HUN notification to the shade. // // // In most cases, when FLAG_AUTO_CANCEL is set, the notification will // In most cases, when FLAG_AUTO_CANCEL is set, the notification will Loading Loading @@ -1941,20 +1935,8 @@ public abstract class BaseStatusBar extends SystemUI implements setAreThereNotifications(); setAreThereNotifications(); } } private void updateHeadsUp(String key, Entry entry, boolean shouldInterrupt, protected abstract void updateHeadsUp(String key, Entry entry, boolean shouldInterrupt, boolean alertAgain) { boolean alertAgain); final boolean wasHeadsUp = isHeadsUp(key); if (wasHeadsUp) { mHeadsUpManager.updateNotification(entry, alertAgain); if (!shouldInterrupt) { // We don't want this to be interrupting anymore, lets remove it mHeadsUpManager.removeNotification(key); } } else if (shouldInterrupt && alertAgain) { // This notification was updated to be a heads-up, show it! mHeadsUpManager.showNotification(entry); } } private void logUpdate(Entry oldEntry, Notification n) { private void logUpdate(Entry oldEntry, Notification n) { StatusBarNotification oldNotification = oldEntry.notification; StatusBarNotification oldNotification = oldEntry.notification; Loading Loading @@ -2075,7 +2057,7 @@ public abstract class BaseStatusBar extends SystemUI implements return false; return false; } } if (mHeadsUpManager.isSnoozed(sbn.getPackageName())) { if (isSnoozedPackage(sbn)) { return false; return false; } } Loading Loading @@ -2109,6 +2091,8 @@ public abstract class BaseStatusBar extends SystemUI implements return interrupt; return interrupt; } } protected abstract boolean isSnoozedPackage(StatusBarNotification sbn); public void setInteracting(int barWindow, boolean interacting) { public void setInteracting(int barWindow, boolean interacting) { // hook for subclasses // hook for subclasses } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +29 −0 Original line number Original line Diff line number Diff line Loading @@ -1867,6 +1867,35 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } protected void updateHeadsUp(String key, Entry entry, boolean shouldInterrupt, boolean alertAgain) { final boolean wasHeadsUp = isHeadsUp(key); if (wasHeadsUp) { mHeadsUpManager.updateNotification(entry, alertAgain); if (!shouldInterrupt) { // We don't want this to be interrupting anymore, lets remove it mHeadsUpManager.removeNotification(key); } } else if (shouldInterrupt && alertAgain) { // This notification was updated to be a heads-up, show it! mHeadsUpManager.showNotification(entry); } } protected void setHeadsUpUser(int newUserId) { if (mHeadsUpManager != null) { mHeadsUpManager.setUser(newUserId); } } public boolean isHeadsUp(String key) { return mHeadsUpManager.isHeadsUp(key); } protected boolean isSnoozedPackage(StatusBarNotification sbn) { return mHeadsUpManager.isSnoozed(sbn.getPackageName()); } /** /** * All changes to the status bar and notifications funnel through here and are batched. * All changes to the status bar and notifications funnel through here and are batched. */ */ Loading packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +13 −2 Original line number Original line Diff line number Diff line Loading @@ -20,8 +20,6 @@ import android.os.IBinder; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification; import android.view.View; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIcon; import com.android.systemui.statusbar.ActivatableNotificationView; import com.android.systemui.statusbar.ActivatableNotificationView; Loading Loading @@ -166,4 +164,17 @@ public class TvStatusBar extends BaseStatusBar { @Override @Override public void appTransitionStarting(long startTime, long duration) { public void appTransitionStarting(long startTime, long duration) { } } @Override protected void updateHeadsUp(String key, NotificationData.Entry entry, boolean shouldInterrupt, boolean alertAgain) { } @Override protected void setHeadsUpUser(int newUserId) { } protected boolean isSnoozedPackage(StatusBarNotification sbn) { return false; } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +7 −23 Original line number Original line Diff line number Diff line Loading @@ -687,13 +687,7 @@ public abstract class BaseStatusBar extends SystemUI implements setHeadsUpUser(newUserId); setHeadsUpUser(newUserId); } } private void setHeadsUpUser(int newUserId) { protected abstract void setHeadsUpUser(int newUserId); mHeadsUpManager.setUser(newUserId); } public boolean isHeadsUp(String key) { return mHeadsUpManager.isHeadsUp(key); } @Override // NotificationData.Environment @Override // NotificationData.Environment public boolean isNotificationForCurrentProfiles(StatusBarNotification n) { public boolean isNotificationForCurrentProfiles(StatusBarNotification n) { Loading Loading @@ -1578,7 +1572,7 @@ public abstract class BaseStatusBar extends SystemUI implements mCurrentUserId); mCurrentUserId); dismissKeyguardThenExecute(new OnDismissAction() { dismissKeyguardThenExecute(new OnDismissAction() { public boolean onDismiss() { public boolean onDismiss() { if (mHeadsUpManager.isHeadsUp(mNotificationKey)) { if (mHeadsUpManager != null && mHeadsUpManager.isHeadsUp(mNotificationKey)) { // Release the HUN notification to the shade. // Release the HUN notification to the shade. // // // In most cases, when FLAG_AUTO_CANCEL is set, the notification will // In most cases, when FLAG_AUTO_CANCEL is set, the notification will Loading Loading @@ -1941,20 +1935,8 @@ public abstract class BaseStatusBar extends SystemUI implements setAreThereNotifications(); setAreThereNotifications(); } } private void updateHeadsUp(String key, Entry entry, boolean shouldInterrupt, protected abstract void updateHeadsUp(String key, Entry entry, boolean shouldInterrupt, boolean alertAgain) { boolean alertAgain); final boolean wasHeadsUp = isHeadsUp(key); if (wasHeadsUp) { mHeadsUpManager.updateNotification(entry, alertAgain); if (!shouldInterrupt) { // We don't want this to be interrupting anymore, lets remove it mHeadsUpManager.removeNotification(key); } } else if (shouldInterrupt && alertAgain) { // This notification was updated to be a heads-up, show it! mHeadsUpManager.showNotification(entry); } } private void logUpdate(Entry oldEntry, Notification n) { private void logUpdate(Entry oldEntry, Notification n) { StatusBarNotification oldNotification = oldEntry.notification; StatusBarNotification oldNotification = oldEntry.notification; Loading Loading @@ -2075,7 +2057,7 @@ public abstract class BaseStatusBar extends SystemUI implements return false; return false; } } if (mHeadsUpManager.isSnoozed(sbn.getPackageName())) { if (isSnoozedPackage(sbn)) { return false; return false; } } Loading Loading @@ -2109,6 +2091,8 @@ public abstract class BaseStatusBar extends SystemUI implements return interrupt; return interrupt; } } protected abstract boolean isSnoozedPackage(StatusBarNotification sbn); public void setInteracting(int barWindow, boolean interacting) { public void setInteracting(int barWindow, boolean interacting) { // hook for subclasses // hook for subclasses } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +29 −0 Original line number Original line Diff line number Diff line Loading @@ -1867,6 +1867,35 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } protected void updateHeadsUp(String key, Entry entry, boolean shouldInterrupt, boolean alertAgain) { final boolean wasHeadsUp = isHeadsUp(key); if (wasHeadsUp) { mHeadsUpManager.updateNotification(entry, alertAgain); if (!shouldInterrupt) { // We don't want this to be interrupting anymore, lets remove it mHeadsUpManager.removeNotification(key); } } else if (shouldInterrupt && alertAgain) { // This notification was updated to be a heads-up, show it! mHeadsUpManager.showNotification(entry); } } protected void setHeadsUpUser(int newUserId) { if (mHeadsUpManager != null) { mHeadsUpManager.setUser(newUserId); } } public boolean isHeadsUp(String key) { return mHeadsUpManager.isHeadsUp(key); } protected boolean isSnoozedPackage(StatusBarNotification sbn) { return mHeadsUpManager.isSnoozed(sbn.getPackageName()); } /** /** * All changes to the status bar and notifications funnel through here and are batched. * All changes to the status bar and notifications funnel through here and are batched. */ */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +13 −2 Original line number Original line Diff line number Diff line Loading @@ -20,8 +20,6 @@ import android.os.IBinder; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification; import android.view.View; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIcon; import com.android.systemui.statusbar.ActivatableNotificationView; import com.android.systemui.statusbar.ActivatableNotificationView; Loading Loading @@ -166,4 +164,17 @@ public class TvStatusBar extends BaseStatusBar { @Override @Override public void appTransitionStarting(long startTime, long duration) { public void appTransitionStarting(long startTime, long duration) { } } @Override protected void updateHeadsUp(String key, NotificationData.Entry entry, boolean shouldInterrupt, boolean alertAgain) { } @Override protected void setHeadsUpUser(int newUserId) { } protected boolean isSnoozedPackage(StatusBarNotification sbn) { return false; } } }