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

Commit 88c8813d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10844344 from db9f9d76 to udc-qpr1-release

Change-Id: I775911fff485c556a629ad7d3effa3ff1e54d52a
parents 221c394a db9f9d76
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import static android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES;
import static android.os.UserHandle.USER_CURRENT;
import static android.os.UserHandle.USER_NULL;

import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;
import static com.android.server.blob.BlobStoreConfig.INVALID_BLOB_ID;
import static com.android.server.blob.BlobStoreConfig.INVALID_BLOB_SIZE;
import static com.android.server.blob.BlobStoreConfig.LOGV;
@@ -1915,7 +1916,7 @@ public class BlobStoreManagerService extends SystemService {
        mStatsManager.setPullAtomCallback(
                FrameworkStatsLog.BLOB_INFO,
                null, // use default PullAtomMetadata values
                BackgroundThread.getExecutor(),
                DIRECT_EXECUTOR,
                mStatsCallbackImpl
        );
    }
+2 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.alarm;

import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;
import static com.android.internal.util.FrameworkStatsLog.ALARM_SCHEDULED__EXACT_ALARM_ALLOWED_REASON__ALLOW_LIST;
import static com.android.internal.util.FrameworkStatsLog.ALARM_SCHEDULED__EXACT_ALARM_ALLOWED_REASON__CHANGE_DISABLED;
import static com.android.internal.util.FrameworkStatsLog.ALARM_SCHEDULED__EXACT_ALARM_ALLOWED_REASON__LISTENER;
@@ -31,7 +32,6 @@ import android.app.StatsManager;
import android.content.Context;
import android.os.SystemClock;

import com.android.internal.os.BackgroundThread;
import com.android.internal.util.FrameworkStatsLog;

import java.util.function.Supplier;
@@ -51,7 +51,7 @@ class MetricsHelper {
    void registerPuller(Supplier<AlarmStore> alarmStoreSupplier) {
        final StatsManager statsManager = mContext.getSystemService(StatsManager.class);
        statsManager.setPullAtomCallback(FrameworkStatsLog.PENDING_ALARM_INFO, null,
                BackgroundThread.getExecutor(), (atomTag, data) -> {
                DIRECT_EXECUTOR, (atomTag, data) -> {
                    if (atomTag != FrameworkStatsLog.PENDING_ALARM_INFO) {
                        throw new UnsupportedOperationException("Unknown tag" + atomTag);
                    }
+2 −2
Original line number Diff line number Diff line
@@ -486,7 +486,7 @@ public class ServiceInfo extends ComponentInfo
     * Here is an example:
     * <pre>
     *  &lt;uses-permission
     *      android:name="android.permissions.FOREGROUND_SERVICE_SPECIAL_USE"
     *      android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
     *  /&gt;
     *  &lt;service
     *      android:name=".MySpecialForegroundService"
@@ -506,7 +506,7 @@ public class ServiceInfo extends ComponentInfo
     * in both platforms.
     * <pre>
     *  &lt;uses-permission
     *      android:name="android.permissions.FOREGROUND_SERVICE_SPECIAL_USE"
     *      android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
     *      android:maxSdkVersion="last_sdk_version_without_type_foo"
     *  /&gt;
     *  &lt;service
+48 −12
Original line number Diff line number Diff line
@@ -7397,19 +7397,26 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                }
                target = next;
            }
            if (!childIsHit) {
            if (!childIsHit && mFirstHoverTarget != null) {
                target = mFirstHoverTarget;
                final ArrayList<View> preorderedList = buildTouchDispatchChildList();
                while (notEmpty && target != null) {
                    final HoverTarget next = target.next;
                    final View hoveredView = target.child;

                    if (!isOnTop(child, hoveredView, preorderedList)) {
                        rect.set(hoveredView.mLeft, hoveredView.mTop, hoveredView.mRight,
                                hoveredView.mBottom);
                        matrix.mapRect(rect);
                        notEmpty = region.op(Math.round(rect.left), Math.round(rect.top),
                            Math.round(rect.right), Math.round(rect.bottom), Region.Op.DIFFERENCE);
                                Math.round(rect.right), Math.round(rect.bottom),
                                Region.Op.DIFFERENCE);
                    }
                    target = next;
                }
                if (preorderedList != null) {
                    preorderedList.clear();
                }
            }
        } else {
            TouchTarget target = mFirstTouchTarget;
@@ -7422,19 +7429,26 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                }
                target = next;
            }
            if (!childIsHit) {
            if (!childIsHit && mFirstTouchTarget != null) {
                target = mFirstTouchTarget;
                final ArrayList<View> preorderedList = buildOrderedChildList();
                while (notEmpty && target != null) {
                    final TouchTarget next = target.next;
                    final View touchedView = target.child;

                    if (!isOnTop(child, touchedView, preorderedList)) {
                        rect.set(touchedView.mLeft, touchedView.mTop, touchedView.mRight,
                                touchedView.mBottom);
                        matrix.mapRect(rect);
                        notEmpty = region.op(Math.round(rect.left), Math.round(rect.top),
                            Math.round(rect.right), Math.round(rect.bottom), Region.Op.DIFFERENCE);
                                Math.round(rect.right), Math.round(rect.bottom),
                                Region.Op.DIFFERENCE);
                    }
                    target = next;
                }
                if (preorderedList != null) {
                    preorderedList.clear();
                }
            }
        }

@@ -7444,6 +7458,28 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        return notEmpty;
    }

    /**
     * Return true if the given {@code view} is drawn on top of the {@code otherView}.
     * Both the {@code view} and {@code otherView} must be children of this ViewGroup.
     * Otherwise, the returned value is meaningless.
     */
    private boolean isOnTop(View view, View otherView, ArrayList<View> preorderedList) {
        final int childrenCount = mChildrenCount;
        final boolean customOrder = preorderedList == null && isChildrenDrawingOrderEnabled();
        final View[] children = mChildren;
        for (int i = childrenCount - 1; i >= 0; i--) {
            final int childIndex = getAndVerifyPreorderedIndex(childrenCount, i, customOrder);
            final View child = getAndVerifyPreorderedView(preorderedList, children, childIndex);
            if (child == view) {
                return true;
            }
            if (child == otherView) {
                return false;
            }
        }
        // Can't find the view and otherView in the children list. Return value is meaningless.
        return false;
    }

    private static void applyOpToRegionByBounds(Region region, View view, Region.Op op) {
        final int[] locationInWindow = new int[2];
+22 −0
Original line number Diff line number Diff line
@@ -587,6 +587,9 @@ public final class ViewRootImpl implements ViewParent,
    @NonNull Display mDisplay;
    final String mBasePackageName;

    // If we would like to keep a particular eye on the corresponding package.
    final boolean mExtraDisplayListenerLogging;

    final int[] mTmpLocation = new int[2];

    final TypedValue mTmpValue = new TypedValue();
@@ -1136,6 +1139,8 @@ public final class ViewRootImpl implements ViewParent,
        mWindowLayout = windowLayout;
        mDisplay = display;
        mBasePackageName = context.getBasePackageName();
        final String name = DisplayProperties.debug_vri_package().orElse(null);
        mExtraDisplayListenerLogging = !TextUtils.isEmpty(name) && name.equals(mBasePackageName);
        mThread = Thread.currentThread();
        mLocation = new WindowLeaked(null);
        mLocation.fillInStackTrace();
@@ -1577,6 +1582,10 @@ public final class ViewRootImpl implements ViewParent,
                // We should update mAttachInfo.mDisplayState after registerDisplayListener
                // because displayState might be changed before registerDisplayListener.
                mAttachInfo.mDisplayState = mDisplay.getState();
                if (mExtraDisplayListenerLogging) {
                    Slog.i(mTag, "(" + mBasePackageName + ") Initial DisplayState: "
                            + mAttachInfo.mDisplayState, new Throwable());
                }
                if ((res & WindowManagerGlobal.ADD_FLAG_USE_BLAST) != 0) {
                    mUseBLASTAdapter = true;
                }
@@ -1661,6 +1670,9 @@ public final class ViewRootImpl implements ViewParent,
     * Register any kind of listeners if setView was success.
     */
    private void registerListeners() {
        if (mExtraDisplayListenerLogging) {
            Slog.i(mTag, "Register listeners: " + mBasePackageName);
        }
        mAccessibilityManager.addAccessibilityStateChangeListener(
                mAccessibilityInteractionConnectionManager, mHandler);
        mAccessibilityManager.addHighTextContrastStateChangeListener(
@@ -1686,6 +1698,9 @@ public final class ViewRootImpl implements ViewParent,
        DisplayManagerGlobal
                .getInstance()
                .unregisterDisplayListener(mDisplayListener);
        if (mExtraDisplayListenerLogging) {
            Slog.w(mTag, "Unregister listeners: " + mBasePackageName, new Throwable());
        }
    }

    private void setTag() {
@@ -2093,9 +2108,16 @@ public final class ViewRootImpl implements ViewParent,
    private final DisplayListener mDisplayListener = new DisplayListener() {
        @Override
        public void onDisplayChanged(int displayId) {
            if (mExtraDisplayListenerLogging) {
                Slog.i(mTag, "Received onDisplayChanged - " + mView);
            }
            if (mView != null && mDisplay.getDisplayId() == displayId) {
                final int oldDisplayState = mAttachInfo.mDisplayState;
                final int newDisplayState = mDisplay.getState();
                if (mExtraDisplayListenerLogging) {
                    Slog.i(mTag, "DisplayState - old: " + oldDisplayState
                            + ", new: " + newDisplayState);
                }
                if (oldDisplayState != newDisplayState) {
                    mAttachInfo.mDisplayState = newDisplayState;
                    pokeDrawLockIfNeeded();
Loading