Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3804,6 +3804,9 @@ <!-- True if the device supports running activities on secondary displays. --> <bool name="config_supportsMultiDisplay">true</bool> <!-- Indicates whether the device supports bubble notifications or not. --> <bool name="config_supportsBubble">true</bool> <!-- True if the device has no home screen. That is a launcher activity where the user can launch other applications from. --> <bool name="config_noHomeScreen">false</bool> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,7 @@ <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" /> <java-symbol type="bool" name="config_freeformWindowManagement" /> <java-symbol type="bool" name="config_supportsBubble" /> <java-symbol type="bool" name="config_supportsMultiWindow" /> <java-symbol type="bool" name="config_supportsSplitScreenMultiWindow" /> <java-symbol type="bool" name="config_supportsMultiDisplay" /> Loading services/core/java/com/android/server/notification/BubbleExtractor.java +10 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.res.Resources; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; Loading @@ -49,10 +50,15 @@ public class BubbleExtractor implements NotificationSignalExtractor { private ActivityManager mActivityManager; private Context mContext; boolean mSupportsBubble; public void initialize(Context context, NotificationUsageStats usageStats) { if (DBG) Slog.d(TAG, "Initializing " + getClass().getSimpleName() + "."); mContext = context; mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); mSupportsBubble = Resources.getSystem().getBoolean( com.android.internal.R.bool.config_supportsBubble); } public RankingReconsideration process(NotificationRecord record) { Loading Loading @@ -138,6 +144,10 @@ public class BubbleExtractor implements NotificationSignalExtractor { */ @VisibleForTesting boolean canPresentAsBubble(NotificationRecord r) { if (!mSupportsBubble) { return false; } Notification notification = r.getNotification(); Notification.BubbleMetadata metadata = notification.getBubbleMetadata(); String pkg = r.getSbn().getPackageName(); Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3804,6 +3804,9 @@ <!-- True if the device supports running activities on secondary displays. --> <bool name="config_supportsMultiDisplay">true</bool> <!-- Indicates whether the device supports bubble notifications or not. --> <bool name="config_supportsBubble">true</bool> <!-- True if the device has no home screen. That is a launcher activity where the user can launch other applications from. --> <bool name="config_noHomeScreen">false</bool> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,7 @@ <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" /> <java-symbol type="bool" name="config_freeformWindowManagement" /> <java-symbol type="bool" name="config_supportsBubble" /> <java-symbol type="bool" name="config_supportsMultiWindow" /> <java-symbol type="bool" name="config_supportsSplitScreenMultiWindow" /> <java-symbol type="bool" name="config_supportsMultiDisplay" /> Loading
services/core/java/com/android/server/notification/BubbleExtractor.java +10 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.res.Resources; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; Loading @@ -49,10 +50,15 @@ public class BubbleExtractor implements NotificationSignalExtractor { private ActivityManager mActivityManager; private Context mContext; boolean mSupportsBubble; public void initialize(Context context, NotificationUsageStats usageStats) { if (DBG) Slog.d(TAG, "Initializing " + getClass().getSimpleName() + "."); mContext = context; mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); mSupportsBubble = Resources.getSystem().getBoolean( com.android.internal.R.bool.config_supportsBubble); } public RankingReconsideration process(NotificationRecord record) { Loading Loading @@ -138,6 +144,10 @@ public class BubbleExtractor implements NotificationSignalExtractor { */ @VisibleForTesting boolean canPresentAsBubble(NotificationRecord r) { if (!mSupportsBubble) { return false; } Notification notification = r.getNotification(); Notification.BubbleMetadata metadata = notification.getBubbleMetadata(); String pkg = r.getSbn().getPackageName(); Loading