Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +6 −9 Original line number Diff line number Diff line Loading @@ -700,10 +700,11 @@ public class BubbleController implements ConfigurationController.ConfigurationLi @Override public void onPendingEntryAdded(NotificationEntry entry) { boolean previouslyUserCreated = mUserCreatedBubbles.contains(entry.getKey()); BubbleExperimentConfig.adjustForExperiments(mContext, entry, previouslyUserCreated); boolean wasAdjusted = BubbleExperimentConfig.adjustForExperiments( mContext, entry, previouslyUserCreated); if (mNotificationInterruptionStateProvider.shouldBubbleUp(entry) && canLaunchInActivityView(mContext, entry)) { && (canLaunchInActivityView(mContext, entry) || wasAdjusted)) { updateBubble(entry); } } Loading @@ -711,10 +712,11 @@ public class BubbleController implements ConfigurationController.ConfigurationLi @Override public void onPreEntryUpdated(NotificationEntry entry) { boolean previouslyUserCreated = mUserCreatedBubbles.contains(entry.getKey()); BubbleExperimentConfig.adjustForExperiments(mContext, entry, previouslyUserCreated); boolean wasAdjusted = BubbleExperimentConfig.adjustForExperiments( mContext, entry, previouslyUserCreated); boolean shouldBubble = mNotificationInterruptionStateProvider.shouldBubbleUp(entry) && canLaunchInActivityView(mContext, entry); && (canLaunchInActivityView(mContext, entry) || wasAdjusted); if (!shouldBubble && mBubbleData.hasBubbleWithKey(entry.getKey())) { // It was previously a bubble but no longer a bubble -- lets remove it removeBubble(entry.getKey(), DISMISS_NO_LONGER_BUBBLE); Loading Loading @@ -1022,11 +1024,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi PendingIntent intent = entry.getBubbleMetadata() != null ? entry.getBubbleMetadata().getIntent() : null; return canLaunchIntentInActivityView(context, entry, intent); } static boolean canLaunchIntentInActivityView(Context context, NotificationEntry entry, PendingIntent intent) { if (intent == null) { Log.w(TAG, "Unable to create bubble -- no intent: " + entry.getKey()); return false; Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java +6 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_MANIFEST; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED; import static com.android.systemui.bubbles.BubbleController.canLaunchIntentInActivityView; import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_EXPERIMENTS; import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; Loading Loading @@ -107,8 +106,10 @@ public class BubbleExperimentConfig { * If {@link #allowAnyNotifToBubble(Context)} is true, this method creates and adds * {@link android.app.Notification.BubbleMetadata} to the notification entry as long as * the notification has necessary info for BubbleMetadata. * * @return whether an adjustment was made. */ static void adjustForExperiments(Context context, NotificationEntry entry, static boolean adjustForExperiments(Context context, NotificationEntry entry, boolean previouslyUserCreated) { Notification.BubbleMetadata metadata = null; boolean addedMetadata = false; Loading Loading @@ -176,7 +177,9 @@ public class BubbleExperimentConfig { Log.d(TAG, "Setting FLAG_BUBBLE for: " + entry.getKey()); } entry.setFlagBubble(true); return true; } return addedMetadata; } static Notification.BubbleMetadata createFromNotif(Context context, NotificationEntry entry) { Loading @@ -193,7 +196,7 @@ public class BubbleExperimentConfig { ? notification.getLargeIcon() : notification.getSmallIcon(); } if (canLaunchIntentInActivityView(context, entry, intent)) { if (intent != null) { return new Notification.BubbleMetadata.Builder() .setDesiredHeight(BUBBLE_HEIGHT) .setIcon(icon) Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +6 −9 Original line number Diff line number Diff line Loading @@ -700,10 +700,11 @@ public class BubbleController implements ConfigurationController.ConfigurationLi @Override public void onPendingEntryAdded(NotificationEntry entry) { boolean previouslyUserCreated = mUserCreatedBubbles.contains(entry.getKey()); BubbleExperimentConfig.adjustForExperiments(mContext, entry, previouslyUserCreated); boolean wasAdjusted = BubbleExperimentConfig.adjustForExperiments( mContext, entry, previouslyUserCreated); if (mNotificationInterruptionStateProvider.shouldBubbleUp(entry) && canLaunchInActivityView(mContext, entry)) { && (canLaunchInActivityView(mContext, entry) || wasAdjusted)) { updateBubble(entry); } } Loading @@ -711,10 +712,11 @@ public class BubbleController implements ConfigurationController.ConfigurationLi @Override public void onPreEntryUpdated(NotificationEntry entry) { boolean previouslyUserCreated = mUserCreatedBubbles.contains(entry.getKey()); BubbleExperimentConfig.adjustForExperiments(mContext, entry, previouslyUserCreated); boolean wasAdjusted = BubbleExperimentConfig.adjustForExperiments( mContext, entry, previouslyUserCreated); boolean shouldBubble = mNotificationInterruptionStateProvider.shouldBubbleUp(entry) && canLaunchInActivityView(mContext, entry); && (canLaunchInActivityView(mContext, entry) || wasAdjusted); if (!shouldBubble && mBubbleData.hasBubbleWithKey(entry.getKey())) { // It was previously a bubble but no longer a bubble -- lets remove it removeBubble(entry.getKey(), DISMISS_NO_LONGER_BUBBLE); Loading Loading @@ -1022,11 +1024,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi PendingIntent intent = entry.getBubbleMetadata() != null ? entry.getBubbleMetadata().getIntent() : null; return canLaunchIntentInActivityView(context, entry, intent); } static boolean canLaunchIntentInActivityView(Context context, NotificationEntry entry, PendingIntent intent) { if (intent == null) { Log.w(TAG, "Unable to create bubble -- no intent: " + entry.getKey()); return false; Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java +6 −3 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_MANIFEST; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED; import static com.android.systemui.bubbles.BubbleController.canLaunchIntentInActivityView; import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_EXPERIMENTS; import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; Loading Loading @@ -107,8 +106,10 @@ public class BubbleExperimentConfig { * If {@link #allowAnyNotifToBubble(Context)} is true, this method creates and adds * {@link android.app.Notification.BubbleMetadata} to the notification entry as long as * the notification has necessary info for BubbleMetadata. * * @return whether an adjustment was made. */ static void adjustForExperiments(Context context, NotificationEntry entry, static boolean adjustForExperiments(Context context, NotificationEntry entry, boolean previouslyUserCreated) { Notification.BubbleMetadata metadata = null; boolean addedMetadata = false; Loading Loading @@ -176,7 +177,9 @@ public class BubbleExperimentConfig { Log.d(TAG, "Setting FLAG_BUBBLE for: " + entry.getKey()); } entry.setFlagBubble(true); return true; } return addedMetadata; } static Notification.BubbleMetadata createFromNotif(Context context, NotificationEntry entry) { Loading @@ -193,7 +196,7 @@ public class BubbleExperimentConfig { ? notification.getLargeIcon() : notification.getSmallIcon(); } if (canLaunchIntentInActivityView(context, entry, intent)) { if (intent != null) { return new Notification.BubbleMetadata.Builder() .setDesiredHeight(BUBBLE_HEIGHT) .setIcon(icon) Loading