diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl index 30232da96e906..84ddd9f0cf7f0 100644 --- a/core/java/android/app/INotificationManager.aidl +++ b/core/java/android/app/INotificationManager.aidl @@ -50,9 +50,6 @@ interface INotificationManager void setPackagePriority(String pkg, int uid, int priority); int getPackagePriority(String pkg, int uid); - void setPackagePeekable(String pkg, int uid, boolean peekable); - boolean getPackagePeekable(String pkg, int uid); - void setPackageVisibilityOverride(String pkg, int uid, int visibility); int getPackageVisibilityOverride(String pkg, int uid); diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 390c280e6b8d8..4e6548b7bb173 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -837,13 +837,6 @@ public class Notification implements Parcelable */ public static final String EXTRA_PEOPLE = "android.people"; - /** - * {@link #extras} key: used to provide hints about the appropriateness of - * displaying this notification as a heads-up notification. - * @hide - */ - public static final String EXTRA_AS_HEADS_UP = "headsup"; - /** * Allow certain system-generated notifications to appear before the device is provisioned. * Only available to notifications coming from the android package. @@ -887,32 +880,6 @@ public class Notification implements Parcelable */ public static final String EXTRA_BUILDER_APPLICATION_INFO = "android.appInfo"; - /** - * Value for {@link #EXTRA_AS_HEADS_UP} that indicates this notification should not be - * displayed in the heads up space. - * - *

- * If this notification has a {@link #fullScreenIntent}, then it will always launch the - * full-screen intent when posted. - *

- * @hide - */ - public static final int HEADS_UP_NEVER = 0; - - /** - * Default value for {@link #EXTRA_AS_HEADS_UP} that indicates this notification may be - * displayed as a heads up. - * @hide - */ - public static final int HEADS_UP_ALLOWED = 1; - - /** - * Value for {@link #EXTRA_AS_HEADS_UP} that indicates this notification is a - * good candidate for display as a heads up. - * @hide - */ - public static final int HEADS_UP_REQUESTED = 2; - private Icon mSmallIcon; private Icon mLargeIcon; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index d3d9bef0b7036..f8ab35fe0991a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -2161,13 +2161,10 @@ public abstract class BaseStatusBar extends SystemUI implements boolean isHighPriority = sbn.getScore() >= INTERRUPTION_THRESHOLD; boolean isFullscreen = notification.fullScreenIntent != null; boolean hasTicker = mHeadsUpTicker && !TextUtils.isEmpty(notification.tickerText); - boolean isAllowed = notification.extras.getInt(Notification.EXTRA_AS_HEADS_UP, - Notification.HEADS_UP_ALLOWED) != Notification.HEADS_UP_NEVER; boolean accessibilityForcesLaunch = isFullscreen && mAccessibilityManager.isTouchExplorationEnabled(); boolean justLaunchedFullScreenIntent = entry.hasJustLaunchedFullScreenIntent(); boolean interrupt = (isFullscreen || (isHighPriority && (isNoisy || hasTicker))) - && isAllowed && !accessibilityForcesLaunch && !justLaunchedFullScreenIntent && mPowerManager.isScreenOn() diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index fd1e9dd1f465b..4424838bf612f 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1223,19 +1223,6 @@ public class NotificationManagerService extends SystemService { return mRankingHelper.getPackagePriority(pkg, uid); } - @Override - public void setPackagePeekable(String pkg, int uid, boolean peekable) { - checkCallerIsSystem(); - - mRankingHelper.setPackagePeekable(pkg, uid, peekable); - } - - @Override - public boolean getPackagePeekable(String pkg, int uid) { - checkCallerIsSystem(); - return mRankingHelper.getPackagePeekable(pkg, uid); - } - @Override public void setPackageVisibilityOverride(String pkg, int uid, int visibility) { checkCallerIsSystem(); @@ -2157,14 +2144,6 @@ public class NotificationManagerService extends SystemService { notification.priority = Notification.PRIORITY_HIGH; } } - // force no heads up per package config - if (!mRankingHelper.getPackagePeekable(pkg, callingUid)) { - if (notification.extras == null) { - notification.extras = new Bundle(); - } - notification.extras.putInt(Notification.EXTRA_AS_HEADS_UP, - Notification.HEADS_UP_NEVER); - } // 1. initial score: buckets of 10, around the app [-20..20] final int score = notification.priority * NOTIFICATION_PRIORITY_MULTIPLIER; diff --git a/services/core/java/com/android/server/notification/RankingConfig.java b/services/core/java/com/android/server/notification/RankingConfig.java index 803db10cd03f6..aea137bc79233 100644 --- a/services/core/java/com/android/server/notification/RankingConfig.java +++ b/services/core/java/com/android/server/notification/RankingConfig.java @@ -20,10 +20,6 @@ public interface RankingConfig { void setPackagePriority(String packageName, int uid, int priority); - boolean getPackagePeekable(String packageName, int uid); - - void setPackagePeekable(String packageName, int uid, boolean peekable); - int getPackageVisibilityOverride(String packageName, int uid); void setPackageVisibilityOverride(String packageName, int uid, int visibility); diff --git a/services/core/java/com/android/server/notification/RankingHelper.java b/services/core/java/com/android/server/notification/RankingHelper.java index 66381f5ac09a3..f8b661fc5365b 100644 --- a/services/core/java/com/android/server/notification/RankingHelper.java +++ b/services/core/java/com/android/server/notification/RankingHelper.java @@ -49,11 +49,9 @@ public class RankingHelper implements RankingConfig { private static final String ATT_NAME = "name"; private static final String ATT_UID = "uid"; private static final String ATT_PRIORITY = "priority"; - private static final String ATT_PEEKABLE = "peekable"; private static final String ATT_VISIBILITY = "visibility"; private static final int DEFAULT_PRIORITY = Notification.PRIORITY_DEFAULT; - private static final boolean DEFAULT_PEEKABLE = true; private static final int DEFAULT_VISIBILITY = NotificationListenerService.Ranking.VISIBILITY_NO_OVERRIDE; @@ -141,7 +139,6 @@ public class RankingHelper implements RankingConfig { if (TAG_PACKAGE.equals(tag)) { int uid = safeInt(parser, ATT_UID, Record.UNKNOWN_UID); int priority = safeInt(parser, ATT_PRIORITY, DEFAULT_PRIORITY); - boolean peekable = safeBool(parser, ATT_PEEKABLE, DEFAULT_PEEKABLE); int vis = safeInt(parser, ATT_VISIBILITY, DEFAULT_VISIBILITY); String name = parser.getAttributeValue(null, ATT_NAME); @@ -167,9 +164,6 @@ public class RankingHelper implements RankingConfig { if (priority != DEFAULT_PRIORITY) { r.priority = priority; } - if (peekable != DEFAULT_PEEKABLE) { - r.peekable = peekable; - } if (vis != DEFAULT_VISIBILITY) { r.visibility = vis; } @@ -200,8 +194,7 @@ public class RankingHelper implements RankingConfig { final int N = mRecords.size(); for (int i = N - 1; i >= 0; i--) { final Record r = mRecords.valueAt(i); - if (r.priority == DEFAULT_PRIORITY && r.peekable == DEFAULT_PEEKABLE - && r.visibility == DEFAULT_VISIBILITY) { + if (r.priority == DEFAULT_PRIORITY && r.visibility == DEFAULT_VISIBILITY) { mRecords.remove(i); } } @@ -223,9 +216,6 @@ public class RankingHelper implements RankingConfig { if (r.priority != DEFAULT_PRIORITY) { out.attribute(null, ATT_PRIORITY, Integer.toString(r.priority)); } - if (r.peekable != DEFAULT_PEEKABLE) { - out.attribute(null, ATT_PEEKABLE, Boolean.toString(r.peekable)); - } if (r.visibility != DEFAULT_VISIBILITY) { out.attribute(null, ATT_VISIBILITY, Integer.toString(r.visibility)); } @@ -347,22 +337,6 @@ public class RankingHelper implements RankingConfig { updateConfig(); } - @Override - public boolean getPackagePeekable(String packageName, int uid) { - final Record r = mRecords.get(recordKey(packageName, uid)); - return r != null ? r.peekable : DEFAULT_PEEKABLE; - } - - @Override - public void setPackagePeekable(String packageName, int uid, boolean peekable) { - if (peekable == getPackagePeekable(packageName, uid)) { - return; - } - getOrCreateRecord(packageName, uid).peekable = peekable; - removeDefaultRecords(); - updateConfig(); - } - @Override public int getPackageVisibilityOverride(String packageName, int uid) { final Record r = mRecords.get(recordKey(packageName, uid)); @@ -415,10 +389,6 @@ public class RankingHelper implements RankingConfig { pw.print(" priority="); pw.print(Notification.priorityToString(r.priority)); } - if (r.peekable != DEFAULT_PEEKABLE) { - pw.print(" peekable="); - pw.print(r.peekable); - } if (r.visibility != DEFAULT_VISIBILITY) { pw.print(" visibility="); pw.print(Notification.visibilityToString(r.visibility)); @@ -460,7 +430,6 @@ public class RankingHelper implements RankingConfig { String pkg; int uid = UNKNOWN_UID; int priority = DEFAULT_PRIORITY; - boolean peekable = DEFAULT_PEEKABLE; int visibility = DEFAULT_VISIBILITY; }