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

Commit f2a81c58 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6841706 from 933f16e5 to rvc-qpr1-release

Change-Id: I79c128bba494443b64e408f265786a6e4a33063f
parents febe4a22 933f16e5
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -3863,6 +3863,17 @@ message LmkStateChanged {
 *      system/core/lmkd/lmkd.c
 */
message LmkKillOccurred {
    enum Reason {
        UNKNOWN = 0;
        PRESSURE_AFTER_KILL = 1;
        NOT_RESPONDING = 2;
        LOW_SWAP_AND_THRASHING = 3;
        LOW_MEM_AND_SWAP = 4;
        LOW_MEM_AND_THRASHING = 5;
        DIRECT_RECL_AND_THRASHING = 6;
        LOW_MEM_AND_SWAP_UTIL = 7;
    }

    // The uid if available. -1 means not available.
    optional int32 uid = 1 [(is_uid) = true];

@@ -3892,6 +3903,15 @@ message LmkKillOccurred {

    // Min oom adj score considered by lmkd.
    optional int32 min_oom_score = 10;

    // Free physical memory on device at LMK time.
    optional int32 free_mem_kb = 11;

    // Free swap on device at LMK time.
    optional int32 free_swap_kb = 12;

    // What triggered the LMK event.
    optional Reason reason = 13;
}

/*
+8 −0
Original line number Diff line number Diff line
@@ -5151,10 +5151,18 @@ public class Notification implements Parcelable
            bindHeaderChronometerAndTime(contentView, p);
            bindProfileBadge(contentView, p);
            bindAlertedIcon(contentView, p);
            bindActivePermissions(contentView, p);
            bindExpandButton(contentView, p);
            mN.mUsesStandardHeader = true;
        }

        private void bindActivePermissions(RemoteViews contentView, StandardTemplateParams p) {
            int color = getNeutralColor(p);
            contentView.setDrawableTint(R.id.camera, false, color, PorterDuff.Mode.SRC_ATOP);
            contentView.setDrawableTint(R.id.mic, false, color, PorterDuff.Mode.SRC_ATOP);
            contentView.setDrawableTint(R.id.overlay, false, color, PorterDuff.Mode.SRC_ATOP);
        }

        private void bindExpandButton(RemoteViews contentView, StandardTemplateParams p) {
            int color = isColorized(p) ? getPrimaryTextColor(p) : getSecondaryTextColor(p);
            contentView.setDrawableTint(R.id.expand_button, false, color,
+25 −0
Original line number Diff line number Diff line
@@ -52,11 +52,13 @@ public class NotificationHeaderView extends ViewGroup {
    private View mHeaderText;
    private View mSecondaryHeaderText;
    private OnClickListener mExpandClickListener;
    private OnClickListener mAppOpsListener;
    private HeaderTouchListener mTouchListener = new HeaderTouchListener();
    private LinearLayout mTransferChip;
    private NotificationExpandButton mExpandButton;
    private CachingIconView mIcon;
    private View mProfileBadge;
    private View mAppOps;
    private boolean mExpanded;
    private boolean mShowExpandButtonAtEnd;
    private boolean mShowWorkBadgeAtEnd;
@@ -113,6 +115,7 @@ public class NotificationHeaderView extends ViewGroup {
        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);
        mAppOps = findViewById(com.android.internal.R.id.app_ops);
    }

    @Override
@@ -140,6 +143,7 @@ public class NotificationHeaderView extends ViewGroup {
            // Icons that should go at the end
            if ((child == mExpandButton && mShowExpandButtonAtEnd)
                    || child == mProfileBadge
                    || child == mAppOps
                    || child == mTransferChip) {
                iconWidth += lp.leftMargin + lp.rightMargin + child.getMeasuredWidth();
            } else {
@@ -204,6 +208,7 @@ public class NotificationHeaderView extends ViewGroup {
            // Icons that should go at the end
            if ((child == mExpandButton && mShowExpandButtonAtEnd)
                    || child == mProfileBadge
                    || child == mAppOps
                    || child == mTransferChip) {
                if (end == getMeasuredWidth()) {
                    layoutRight = end - mContentEndMargin;
@@ -272,10 +277,22 @@ public class NotificationHeaderView extends ViewGroup {
    }

    private void updateTouchListener() {
        if (mExpandClickListener == null && mAppOpsListener == null) {
            setOnTouchListener(null);
            return;
        }
        setOnTouchListener(mTouchListener);
        mTouchListener.bindTouchRects();
    }

    /**
     * Sets onclick listener for app ops icons.
     */
    public void setAppOpsOnClickListener(OnClickListener l) {
        mAppOpsListener = l;
        updateTouchListener();
    }

    @Override
    public void setOnClickListener(@Nullable OnClickListener l) {
        mExpandClickListener = l;
@@ -363,6 +380,7 @@ public class NotificationHeaderView extends ViewGroup {

        private final ArrayList<Rect> mTouchRects = new ArrayList<>();
        private Rect mExpandButtonRect;
        private Rect mAppOpsRect;
        private int mTouchSlop;
        private boolean mTrackGesture;
        private float mDownX;
@@ -375,6 +393,8 @@ public class NotificationHeaderView extends ViewGroup {
            mTouchRects.clear();
            addRectAroundView(mIcon);
            mExpandButtonRect = addRectAroundView(mExpandButton);
            mAppOpsRect = addRectAroundView(mAppOps);
            setTouchDelegate(new TouchDelegate(mAppOpsRect, mAppOps));
            addWidthRect();
            mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
        }
@@ -435,6 +455,11 @@ public class NotificationHeaderView extends ViewGroup {
                    break;
                case MotionEvent.ACTION_UP:
                    if (mTrackGesture) {
                        if (mAppOps.isVisibleToUser() && (mAppOpsRect.contains((int) x, (int) y)
                                || mAppOpsRect.contains((int) mDownX, (int) mDownY))) {
                            mAppOps.performClick();
                            return true;
                        }
                        mExpandButton.performClick();
                    }
                    break;
+4 −4
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.view.View;
import android.view.ViewDebug;
import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
@@ -306,9 +307,6 @@ public class ProgressBar extends View {
        setMax(a.getInt(R.styleable.ProgressBar_max, mMax));

        setProgress(a.getInt(R.styleable.ProgressBar_progress, mProgress));
        // onProgressRefresh() is only called when the progress changes. So we should set
        // stateDescription during initialization here.
        super.setStateDescription(formatStateDescription(mProgress));

        setSecondaryProgress(a.getInt(
                R.styleable.ProgressBar_secondaryProgress, mSecondaryProgress));
@@ -1601,7 +1599,8 @@ public class ProgressBar extends View {
    }

    void onProgressRefresh(float scale, boolean fromUser, int progress) {
        if (mCustomStateDescription == null) {
        if (AccessibilityManager.getInstance(mContext).isEnabled()
                && mCustomStateDescription == null) {
            super.setStateDescription(formatStateDescription(mProgress));
        }
    }
@@ -2325,6 +2324,7 @@ public class ProgressBar extends View {
                    AccessibilityNodeInfo.RangeInfo.RANGE_TYPE_INT, getMin(), getMax(),
                    getProgress());
            info.setRangeInfo(rangeInfo);
            info.setStateDescription(formatStateDescription(mProgress));
        }
    }

+44 −0
Original line number Diff line number Diff line
@@ -167,6 +167,8 @@ public class ConversationLayout extends FrameLayout
    private int mFacePileProtectionWidthExpanded;
    private boolean mImportantConversation;
    private TextView mUnreadBadge;
    private ViewGroup mAppOps;
    private Rect mAppOpsTouchRect = new Rect();
    private float mMinTouchSize;
    private Icon mConversationIcon;
    private Icon mShortcutIcon;
@@ -208,6 +210,7 @@ public class ConversationLayout extends FrameLayout
        mConversationIconView = findViewById(R.id.conversation_icon);
        mConversationIconContainer = findViewById(R.id.conversation_icon_container);
        mIcon = findViewById(R.id.icon);
        mAppOps = findViewById(com.android.internal.R.id.app_ops);
        mMinTouchSize = 48 * getResources().getDisplayMetrics().density;
        mImportanceRingView = findViewById(R.id.conversation_icon_badge_ring);
        mConversationIconBadge = findViewById(R.id.conversation_icon_badge);
@@ -1163,6 +1166,47 @@ public class ConversationLayout extends FrameLayout
                }
            });
        }
        if (mAppOps.getWidth() > 0) {

            // Let's increase the touch size of the app ops view if it's here
            mAppOpsTouchRect.set(
                    mAppOps.getLeft(),
                    mAppOps.getTop(),
                    mAppOps.getRight(),
                    mAppOps.getBottom());
            for (int i = 0; i < mAppOps.getChildCount(); i++) {
                View child = mAppOps.getChildAt(i);
                if (child.getVisibility() == GONE) {
                    continue;
                }
                // Make sure each child has at least a minTouchSize touch target around it
                float childTouchLeft = child.getLeft() + child.getWidth() / 2.0f
                        - mMinTouchSize / 2.0f;
                float childTouchRight = childTouchLeft + mMinTouchSize;
                mAppOpsTouchRect.left = (int) Math.min(mAppOpsTouchRect.left,
                        mAppOps.getLeft() + childTouchLeft);
                mAppOpsTouchRect.right = (int) Math.max(mAppOpsTouchRect.right,
                        mAppOps.getLeft() + childTouchRight);
            }

            // Increase the height
            int heightIncrease = 0;
            if (mAppOpsTouchRect.height() < mMinTouchSize) {
                heightIncrease = (int) Math.ceil((mMinTouchSize - mAppOpsTouchRect.height())
                        / 2.0f);
            }
            mAppOpsTouchRect.inset(0, -heightIncrease);

            // Let's adjust the hitrect since app ops isn't a direct child
            ViewGroup viewGroup = (ViewGroup) mAppOps.getParent();
            while (viewGroup != this) {
                mAppOpsTouchRect.offset(viewGroup.getLeft(), viewGroup.getTop());
                viewGroup = (ViewGroup) viewGroup.getParent();
            }
            //
            // Extend the size of the app opps to be at least 48dp
            setTouchDelegate(new TouchDelegate(mAppOpsTouchRect, mAppOps));
        }
    }

    public MessagingLinearLayout getMessagingLinearLayout() {
Loading