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

Commit c026d54c authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge changes from topic "bubble_settings_wooo" into rvc-dev

* changes:
  Changes to enable bubble settings CTS
  Notification Bubble Button
  Make bubble settings a pref with an int rather than a bool
parents 1faa9600 0f99c3c2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -78,10 +78,9 @@ interface INotificationManager
    boolean shouldHideSilentStatusIcons(String callingPkg);
    void setHideSilentStatusIcons(boolean hide);

    void setBubblesAllowed(String pkg, int uid, boolean allowed);
    void setBubblesAllowed(String pkg, int uid, int bubblePreference);
    boolean areBubblesAllowed(String pkg);
    boolean areBubblesAllowedForPackage(String pkg, int uid);
    boolean hasUserApprovedBubblesForPackage(String pkg, int uid);
    int getBubblePreferenceForPackage(String pkg, int uid);

    void createNotificationChannelGroups(String pkg, in ParceledListSlice channelGroupList);
    void createNotificationChannels(String pkg, in ParceledListSlice channelsList);
+8 −13
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ public final class NotificationChannel implements Parcelable {
    private static final String ATT_FG_SERVICE_SHOWN = "fgservice";
    private static final String ATT_GROUP = "group";
    private static final String ATT_BLOCKABLE_SYSTEM = "blockable_system";
    private static final String ATT_ALLOW_BUBBLE = "can_bubble";
    private static final String ATT_ALLOW_BUBBLE = "allow_bubble";
    private static final String ATT_ORIG_IMP = "orig_imp";
    private static final String ATT_PARENT_CHANNEL = "parent";
    private static final String ATT_CONVERSATION_ID = "conv_id";
@@ -168,7 +168,7 @@ public final class NotificationChannel implements Parcelable {
            NotificationManager.IMPORTANCE_UNSPECIFIED;
    private static final boolean DEFAULT_DELETED = false;
    private static final boolean DEFAULT_SHOW_BADGE = true;
    private static final boolean DEFAULT_ALLOW_BUBBLE = true;
    private static final boolean DEFAULT_ALLOW_BUBBLE = false;

    @UnsupportedAppUsage
    private String mId;
@@ -545,15 +545,8 @@ public final class NotificationChannel implements Parcelable {
    }

    /**
     * Sets whether notifications posted to this channel can appear outside of the notification
     * shade, floating over other apps' content as a bubble.
     *
     * <p>This value will be ignored for channels that aren't allowed to pop on screen (that is,
     * channels whose {@link #getImportance() importance} is <
     * {@link NotificationManager#IMPORTANCE_HIGH}.</p>
     *
     * <p>Only modifiable before the channel is submitted to
     *      * {@link NotificationManager#createNotificationChannel(NotificationChannel)}.</p>
     * As of Android 11 this value is no longer respected.
     * @see #canBubble()
     * @see Notification#getBubbleMetadata()
     */
    public void setAllowBubbles(boolean allowBubbles) {
@@ -702,8 +695,10 @@ public final class NotificationChannel implements Parcelable {
    }

    /**
     * Returns whether notifications posted to this channel can display outside of the notification
     * shade, in a floating window on top of other apps.
     * Returns whether notifications posted to this channel are allowed to display outside of the
     * notification shade, in a floating window on top of other apps.
     *
     * @see Notification#getBubbleMetadata()
     */
    public boolean canBubble() {
        return mAllowBubbles;
+14 −1
Original line number Diff line number Diff line
@@ -452,6 +452,19 @@ public class NotificationManager {
     */
    public static final int IMPORTANCE_MAX = 5;

    /**
     * @hide
     */
    public static final int BUBBLE_PREFERENCE_NONE = 0;
    /**
     * @hide
     */
    public static final int BUBBLE_PREFERENCE_ALL = 1;
    /**
     * @hide
     */
    public static final int BUBBLE_PREFERENCE_SELECTED = 2;

    @UnsupportedAppUsage
    private static INotificationManager sService;

@@ -1213,7 +1226,7 @@ public class NotificationManager {


    /**
     * Sets whether notifications posted by this app can appear outside of the
     * Gets whether all notifications posted by this app can appear outside of the
     * notification shade, floating over other apps' content.
     *
     * <p>This value will be ignored for notifications that are posted to channels that do not
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ interface IStatusBarService
    void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply,
            in int notificationLocation, boolean modifiedBeforeSending);
    void onNotificationSettingsViewed(String key);
    void onNotificationBubbleChanged(String key, boolean isBubble);
    void onNotificationBubbleChanged(String key, boolean isBubble, int flags);
    void onBubbleNotificationSuppressionChanged(String key, boolean isSuppressed);
    void grantInlineReplyUriPermission(String key, in Uri uri, in UserHandle user, String packageName);
    void clearInlineReplyUriPermissions(String key);
+27 −9
Original line number Diff line number Diff line
@@ -20,11 +20,19 @@
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/notification_action_list_margin_top"
        android:layout_gravity="bottom">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingEnd="12dp"
            >

            <com.android.internal.widget.NotificationActionListLayout
                android:id="@+id/actions"
            android:layout_width="match_parent"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="@dimen/notification_action_list_height"
            android:paddingEnd="12dp"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:visibility="gone"
@@ -32,4 +40,14 @@
                >
                <!-- actions will be added here -->
            </com.android.internal.widget.NotificationActionListLayout>

            <ImageView
                android:id="@+id/bubble_button"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:layout_gravity="center_vertical|end"
                android:visibility="gone"
                android:scaleType="centerInside"
                />
    </LinearLayout>
</FrameLayout>
Loading