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

Commit 39743908 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Remove Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL flag"

parents 527e407e c2eb0503
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -8935,12 +8935,6 @@ public final class Settings {
        public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
                "packages_to_clear_data_before_full_restore";
        /**
         * Setting to determine whether to use the new notification priority handling features.
         * @hide
         */
        public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model";
        /**
         * How often to check for location access.
         * @hide
+24 −32
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.view;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
@@ -54,7 +55,6 @@ public class NotificationHeaderView extends ViewGroup {
    private CachingIconView mIcon;
    private View mProfileBadge;
    private View mFeedbackIcon;
    private boolean mShowExpandButtonAtEnd;
    private boolean mShowWorkBadgeAtEnd;
    private int mHeaderTextMarginEnd;
    private Drawable mBackground;
@@ -86,7 +86,8 @@ public class NotificationHeaderView extends ViewGroup {
        this(context, attrs, defStyleAttr, 0);
    }

    public NotificationHeaderView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    public NotificationHeaderView(Context context, AttributeSet attrs, int defStyleAttr,
            int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        Resources res = getResources();
        mChildMinWidth = res.getDimensionPixelSize(R.dimen.notification_header_shrink_min_width);
@@ -102,13 +103,14 @@ public class NotificationHeaderView extends ViewGroup {
    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mAppName = findViewById(com.android.internal.R.id.app_name_text);
        mHeaderText = findViewById(com.android.internal.R.id.header_text);
        mSecondaryHeaderText = findViewById(com.android.internal.R.id.header_text_secondary);
        mExpandButton = findViewById(com.android.internal.R.id.expand_button);
        mIcon = findViewById(com.android.internal.R.id.icon);
        mProfileBadge = findViewById(com.android.internal.R.id.profile_badge);
        mFeedbackIcon = findViewById(com.android.internal.R.id.feedback);
        mAppName = findViewById(R.id.app_name_text);
        mHeaderText = findViewById(R.id.header_text);
        mSecondaryHeaderText = findViewById(R.id.header_text_secondary);
        mExpandButton = findViewById(R.id.expand_button);
        mIcon = findViewById(R.id.icon);
        mProfileBadge = findViewById(R.id.profile_badge);
        mFeedbackIcon = findViewById(R.id.feedback);
        setClipToPadding(false);
    }

    @Override
@@ -134,9 +136,7 @@ public class NotificationHeaderView extends ViewGroup {
                    lp.topMargin + lp.bottomMargin, lp.height);
            child.measure(childWidthSpec, childHeightSpec);
            // Icons that should go at the end
            if ((child == mExpandButton && mShowExpandButtonAtEnd)
                    || child == mProfileBadge
                    || child == mFeedbackIcon) {
            if (child == mExpandButton || child == mProfileBadge || child == mFeedbackIcon) {
                iconWidth += lp.leftMargin + lp.rightMargin + child.getMeasuredWidth();
            } else {
                totalWidth += lp.leftMargin + lp.rightMargin + child.getMeasuredWidth();
@@ -198,9 +198,7 @@ public class NotificationHeaderView extends ViewGroup {
            int top = (int) (getPaddingTop() + (ownHeight - childHeight) / 2.0f);
            int bottom = top + childHeight;
            // Icons that should go at the end
            if ((child == mExpandButton && mShowExpandButtonAtEnd)
                    || child == mProfileBadge
                    || child == mFeedbackIcon) {
            if (child == mExpandButton || child == mProfileBadge || child == mFeedbackIcon) {
                if (end == getMeasuredWidth()) {
                    layoutRight = end - mContentEndMargin;
                } else {
@@ -227,7 +225,7 @@ public class NotificationHeaderView extends ViewGroup {

    @Override
    public LayoutParams generateLayoutParams(AttributeSet attrs) {
        return new ViewGroup.MarginLayoutParams(getContext(), attrs);
        return new MarginLayoutParams(getContext(), attrs);
    }

    /**
@@ -256,7 +254,7 @@ public class NotificationHeaderView extends ViewGroup {
    }

    @Override
    protected boolean verifyDrawable(Drawable who) {
    protected boolean verifyDrawable(@NonNull Drawable who) {
        return super.verifyDrawable(who) || who == mBackground;
    }

@@ -292,25 +290,16 @@ public class NotificationHeaderView extends ViewGroup {
        updateTouchListener();
    }

    /**
     * Sets whether or not the work badge appears at the end of the NotificationHeaderView.
     * The expand button will always be closer to the end.
     */
    public void setShowWorkBadgeAtEnd(boolean showWorkBadgeAtEnd) {
        if (showWorkBadgeAtEnd != mShowWorkBadgeAtEnd) {
            setClipToPadding(!showWorkBadgeAtEnd);
            mShowWorkBadgeAtEnd = showWorkBadgeAtEnd;
        }
    }

    /**
     * Sets whether or not the expand button appears at the end of the NotificationHeaderView. If
     * both this and {@link #setShowWorkBadgeAtEnd(boolean)} have been set to true, then the
     * expand button will appear closer to the end than the work badge.
     */
    public void setShowExpandButtonAtEnd(boolean showExpandButtonAtEnd) {
        if (showExpandButtonAtEnd != mShowExpandButtonAtEnd) {
            setClipToPadding(!showExpandButtonAtEnd);
            mShowExpandButtonAtEnd = showExpandButtonAtEnd;
        }
    }

    /**
     * Sets the margin end for the text portion of the header, excluding right-aligned elements
     * @param headerTextMarginEnd margin size
@@ -331,7 +320,10 @@ public class NotificationHeaderView extends ViewGroup {
        return mHeaderTextMarginEnd;
    }

    public class HeaderTouchListener implements View.OnTouchListener {
    /**
     * Handles clicks on the header based on the region tapped.
     */
    public class HeaderTouchListener implements OnTouchListener {

        private final ArrayList<Rect> mTouchRects = new ArrayList<>();
        private Rect mExpandButtonRect;
+0 −1
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@ public class SecureSettings {
        Settings.Secure.CHARGING_VIBRATION_ENABLED,
        Settings.Secure.ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS,
        Settings.Secure.ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS,
        Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL,
        Settings.Secure.TRUST_AGENTS_EXTEND_UNLOCK,
        Settings.Secure.UI_NIGHT_MODE,
        Settings.Secure.DARK_THEME_CUSTOM_START_TIME,
+0 −1
Original line number Diff line number Diff line
@@ -206,7 +206,6 @@ public class SecureSettingsValidators {
                Secure.ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.TRUST_AGENTS_EXTEND_UNLOCK, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE, JSON_OBJECT_VALIDATOR);
        VALIDATORS.put(Secure.LOCK_SCREEN_WHEN_TRUST_LOST, BOOLEAN_VALIDATOR);
+0 −3
Original line number Diff line number Diff line
@@ -387,9 +387,6 @@
         off-screen. -->
    <bool name="config_fadeDependingOnAmountSwiped">false</bool>

    <!-- Whether or not to show the expand button at the end of the notification header. -->
    <bool name="config_showNotificationExpandButtonAtEnd">false</bool>

    <!-- Whether or the notifications should be clipped to be reduced in height if it has been
         scrolled to the top of the screen. -->
    <bool name="config_clipNotificationScrollToTop">true</bool>
Loading