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

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

Merge cherrypicks of [8709890, 8710035, 8710036, 8710037, 8710038, 8709945,...

Merge cherrypicks of [8709890, 8710035, 8710036, 8710037, 8710038, 8709945, 8709612] into qt-release

Change-Id: I7562106135f6c9d72c2c15a3c60157903ca9e3d1
parents 4ca06afb 69011866
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public class FalsingManagerProxy implements FalsingManager {
    @VisibleForTesting
    public void setupFalsingManager(Context context) {
        boolean brightlineEnabled = DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_SYSTEMUI, BRIGHTLINE_FALSING_MANAGER_ENABLED, false);
                DeviceConfig.NAMESPACE_SYSTEMUI, BRIGHTLINE_FALSING_MANAGER_ENABLED, true);
        if (!brightlineEnabled) {
            mInternalFalsingManager = new FalsingManagerImpl(context);
        } else {
+14 −3
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.annotation.VisibleForTesting;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto;
import com.android.systemui.R;
import com.android.systemui.plugins.SensorManagerPlugin;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.util.AlarmTimeout;
@@ -255,12 +256,21 @@ public class DozeSensors {
        long mLastNear;
        final AlarmTimeout mCooldownTimer;
        final AlwaysOnDisplayPolicy mPolicy;

        final Sensor mSensor;

        public ProxSensor(AlwaysOnDisplayPolicy policy) {
            mPolicy = policy;
            mCooldownTimer = new AlarmTimeout(mAlarmManager, this::updateRegistered,
                    "prox_cooldown", mHandler);

            // The default prox sensor can be noisy, so let's use a prox gated brightness sensor
            // if available.
            Sensor sensor = DozeSensors.findSensorWithType(mSensorManager,
                    mContext.getString(R.string.doze_brightness_sensor_type));
            if (sensor == null) {
                sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
            }
            mSensor = sensor;
        }

        void setRequested(boolean requested) {
@@ -324,8 +334,9 @@ public class DozeSensors {

        @Override
        public String toString() {
            return String.format("{registered=%s, requested=%s, coolingDown=%s, currentlyFar=%s}",
                    mRegistered, mRequested, mCooldownTimer.isScheduled(), mCurrentlyFar);
            return String.format("{registered=%s, requested=%s, coolingDown=%s, currentlyFar=%s,"
                    + " sensor=%s}", mRegistered, mRequested, mCooldownTimer.isScheduled(),
                    mCurrentlyFar, mSensor);
        }
    }

+9 −1
Original line number Diff line number Diff line
@@ -2516,12 +2516,20 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
            }
            return;
        }
        int minTopPosition = 0;
        int minTopPosition;
        NotificationSection lastSection = getLastVisibleSection();
        if (mStatusBarState != StatusBarState.KEYGUARD) {
            minTopPosition = (int) (mTopPadding + mStackTranslation);
        } else if (lastSection == null) {
            minTopPosition = mTopPadding;
        } else {
            // The first sections could be empty while there could still be elements in later
            // sections. The position of these first few sections is determined by the position of
            // the first visible section.
            NotificationSection firstVisibleSection = getFirstVisibleSection();
            firstVisibleSection.updateBounds(0 /* minTopPosition*/, 0 /* minBottomPosition */,
                    false /* shiftPulsingWithFirst */);
            minTopPosition = firstVisibleSection.getBounds().top;
        }
        boolean shiftPulsingWithFirst = mAmbientPulseManager.getAllEntries().count() <= 1;
        for (NotificationSection section : mSections) {
+5 −2
Original line number Diff line number Diff line
@@ -301,12 +301,15 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
    }

    public Region calculateTouchableRegion() {
        if (!hasPinnedHeadsUp()) {
        NotificationEntry topEntry = getTopEntry();
        // This call could be made in an inconsistent state while the pinnedMode hasn't been
        // updated yet, but callbacks leading out of the headsUp manager, querying it. Let's
        // therefore also check if the topEntry is null.
        if (!hasPinnedHeadsUp() || topEntry == null) {
            mTouchableRegion.set(0, 0, mStatusBarWindowView.getWidth(), mStatusBarHeight);
            updateRegionForNotch(mTouchableRegion);

        } else {
            NotificationEntry topEntry = getTopEntry();
            if (topEntry.isChildInGroup()) {
                final NotificationEntry groupSummary =
                        mGroupManager.getGroupSummary(topEntry.notification);
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ public class FalsingManagerProxyTest extends SysuiTestCase {
        mHandler = new Handler(mTestableLooper.getLooper());
        mDefaultConfigValue = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
                BRIGHTLINE_FALSING_MANAGER_ENABLED, false);
        // In case it runs on a device where it's been set to true, set it to false by hand.
        DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SYSTEMUI,
                BRIGHTLINE_FALSING_MANAGER_ENABLED, "false", false);
    }

    @After