Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6acbe65 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add config to disable Bubbles" into tm-dev am: d421a513 am: 37517a39

parents 148fdaa8 37517a39
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -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" />
+10 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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) {
@@ -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();