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

Commit 7026bffa authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/25603480',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/25603480', 'googleplex-android-review.googlesource.com/26238492', 'googleplex-android-review.googlesource.com/26485132', 'googleplex-android-review.googlesource.com/26307234', 'googleplex-android-review.googlesource.com/26151073', 'googleplex-android-review.googlesource.com/26720245', 'googleplex-android-review.googlesource.com/26685061', 'googleplex-android-review.googlesource.com/26677508', 'googleplex-android-review.googlesource.com/26183005', 'googleplex-android-review.googlesource.com/25839619', 'googleplex-android-review.googlesource.com/26554109', 'googleplex-android-review.googlesource.com/26721087', 'googleplex-android-review.googlesource.com/26738221', 'googleplex-android-review.googlesource.com/26703706'] into security-aosp-udc-release.

Change-Id: I123fd62f3bd00069b99e33813cb75ccb4aec22c0
parents 7a0ccf46 c1bc907a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -424,6 +424,8 @@ public class ZygoteProcess {
                throw new ZygoteStartFailedEx("Embedded newlines not allowed");
            } else if (arg.indexOf('\r') >= 0) {
                throw new ZygoteStartFailedEx("Embedded carriage returns not allowed");
            } else if (arg.indexOf('\u0000') >= 0) {
                throw new ZygoteStartFailedEx("Embedded nulls not allowed");
            }
        }

@@ -959,6 +961,14 @@ public class ZygoteProcess {
            return true;
        }

        for (/* NonNull */ String s : mApiDenylistExemptions) {
            // indexOf() is intrinsified and faster than contains().
            if (s.indexOf('\n') >= 0 || s.indexOf('\r') >= 0 || s.indexOf('\u0000') >= 0) {
                Slog.e(LOG_TAG, "Failed to set API denylist exemptions: Bad character");
                mApiDenylistExemptions = Collections.emptyList();
                return false;
            }
        }
        try {
            state.mZygoteOutputWriter.write(Integer.toString(mApiDenylistExemptions.size() + 1));
            state.mZygoteOutputWriter.newLine();
+0 −40
Original line number Diff line number Diff line
@@ -18,16 +18,10 @@ package com.android.systemui.media.controls.ui

import android.content.Context
import android.content.res.Configuration
import android.database.ContentObserver
import android.net.Uri
import android.os.Handler
import android.os.UserHandle
import android.provider.Settings
import android.view.View
import android.view.ViewGroup
import androidx.annotation.VisibleForTesting
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.media.dagger.MediaModule.KEYGUARD
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.statusbar.StatusBarState
@@ -36,7 +30,6 @@ import com.android.systemui.statusbar.notification.stack.MediaContainerView
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.LargeScreenUtils
import com.android.systemui.util.settings.SecureSettings
import javax.inject.Inject
import javax.inject.Named

@@ -52,8 +45,6 @@ constructor(
    private val bypassController: KeyguardBypassController,
    private val statusBarStateController: SysuiStatusBarStateController,
    private val context: Context,
    private val secureSettings: SecureSettings,
    @Main private val handler: Handler,
    configurationController: ConfigurationController,
) {

@@ -77,26 +68,6 @@ constructor(
            }
        )

        val settingsObserver: ContentObserver =
            object : ContentObserver(handler) {
                override fun onChange(selfChange: Boolean, uri: Uri?) {
                    if (uri == lockScreenMediaPlayerUri) {
                        allowMediaPlayerOnLockScreen =
                            secureSettings.getBoolForUser(
                                Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN,
                                true,
                                UserHandle.USER_CURRENT
                            )
                        refreshMediaPosition()
                    }
                }
            }
        secureSettings.registerContentObserverForUser(
            Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN,
            settingsObserver,
            UserHandle.USER_ALL
        )

        // First let's set the desired state that we want for this host
        mediaHost.expansion = MediaHostState.EXPANDED
        mediaHost.showsOnlyActiveMedia = true
@@ -142,16 +113,6 @@ constructor(
        private set
    private var splitShadeContainer: ViewGroup? = null

    /** Track the media player setting status on lock screen. */
    private var allowMediaPlayerOnLockScreen: Boolean =
        secureSettings.getBoolForUser(
            Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN,
            true,
            UserHandle.USER_CURRENT
        )
    private val lockScreenMediaPlayerUri =
        secureSettings.getUriFor(Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN)

    /**
     * Attaches media container in single pane mode, situated at the top of the notifications list
     */
@@ -211,7 +172,6 @@ constructor(
            mediaHost.visible &&
                !bypassController.bypassEnabled &&
                keyguardOrUserSwitcher &&
                allowMediaPlayerOnLockScreen &&
                shouldBeVisibleForSplitShade()
        if (visible) {
            showMediaPlayer()
+19 −8
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ constructor(
) {

    /** Track the media player setting status on lock screen. */
    private var allowMediaPlayerOnLockScreen: Boolean = true
    private var allowMediaPlayerOnLockScreen: Boolean = getMediaLockScreenSetting()
    private val lockScreenMediaPlayerUri =
        secureSettings.getUriFor(Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN)

@@ -461,6 +461,7 @@ constructor(
                        mediaCarouselController.logSmartspaceImpression(qsExpanded)
                    }
                    updateUserVisibility()
                    mediaCarouselController.updateHostVisibility()
                }

                override fun onDozeAmountChanged(linear: Float, eased: Float) {
@@ -533,7 +534,6 @@ constructor(
        mediaCarouselController.updateHostVisibility = {
            mediaHosts.forEach { it?.updateViewVisibility() }
        }

        panelEventsEvents.addShadeStateEventsListener(
            object : ShadeStateEventsListener {
                override fun onExpandImmediateChanged(isExpandImmediateEnabled: Boolean) {
@@ -547,12 +547,8 @@ constructor(
            object : ContentObserver(handler) {
                override fun onChange(selfChange: Boolean, uri: Uri?) {
                    if (uri == lockScreenMediaPlayerUri) {
                        allowMediaPlayerOnLockScreen =
                            secureSettings.getBoolForUser(
                                Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN,
                                true,
                                UserHandle.USER_CURRENT
                            )
                        allowMediaPlayerOnLockScreen = getMediaLockScreenSetting()
                        mediaCarouselController.updateHostVisibility()
                    }
                }
            }
@@ -563,6 +559,14 @@ constructor(
        )
    }

    private fun getMediaLockScreenSetting(): Boolean {
        return secureSettings.getBoolForUser(
            Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN,
            true,
            UserHandle.USER_CURRENT
        )
    }

    private fun updateConfiguration() {
        distanceForFullShadeTransition =
            context.resources.getDimensionPixelSize(
@@ -602,6 +606,13 @@ constructor(
        mediaCarouselController.closeGuts()
    }

    /** Return true if the carousel should be hidden because lockscreen is currently visible */
    fun isLockedAndHidden(): Boolean {
        return !allowMediaPlayerOnLockScreen &&
            (statusbarState == StatusBarState.SHADE_LOCKED ||
                statusbarState == StatusBarState.KEYGUARD)
    }

    private fun createUniqueObjectHost(): UniqueObjectHostView {
        val viewHost = UniqueObjectHostView(context)
        viewHost.addOnAttachStateChangeListener(
+3 −1
Original line number Diff line number Diff line
@@ -199,7 +199,9 @@ constructor(
     */
    fun updateViewVisibility() {
        state.visible =
            if (showsOnlyActiveMedia) {
            if (mediaHierarchyManager.isLockedAndHidden()) {
                false
            } else if (showsOnlyActiveMedia) {
                mediaDataManager.hasActiveMediaOrRecommendation()
            } else {
                mediaDataManager.hasAnyMediaOrRecommendation()
+34 −5
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Trace;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.util.ArraySet;
import android.util.AttributeSet;
@@ -371,7 +372,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private boolean mUseIncreasedHeadsUpHeight;
    private float mTranslationWhenRemoved;
    private boolean mWasChildInGroupWhenRemoved;
    private NotificationInlineImageResolver mImageResolver;
    private final NotificationInlineImageResolver mImageResolver;
    @Nullable
    private OnExpansionChangedListener mExpansionChangedListener;
    @Nullable
@@ -1630,13 +1631,41 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    }

    /**
     * Constructs an ExpandableNotificationRow.
     * @param context context passed to image resolver
     * Constructs an ExpandableNotificationRow. Used by layout inflation.
     *
     * @param context passed to image resolver
     * @param attrs attributes used to initialize parent view
     */
    public ExpandableNotificationRow(Context context, AttributeSet attrs) {
        super(context, attrs);
        mImageResolver = new NotificationInlineImageResolver(context,
        this(context, attrs, context);
        Log.wtf(TAG, "This constructor shouldn't be called");
    }

    /**
     * Constructs an ExpandableNotificationRow. Used by layout inflation (with a custom {@code
     * AsyncLayoutFactory} in {@link RowInflaterTask}.
     *
     * @param context context context of the view
     * @param attrs attributes used to initialize parent view
     * @param entry notification that the row will be associated to (determines the user for the
     *              ImageResolver)
     */
    public ExpandableNotificationRow(Context context, AttributeSet attrs, NotificationEntry entry) {
        this(context, attrs, userContextForEntry(context, entry));
    }

    private static Context userContextForEntry(Context base, NotificationEntry entry) {
        if (base.getUserId() == entry.getSbn().getNormalizedUserId()) {
            return base;
        }
        return base.createContextAsUser(
                UserHandle.of(entry.getSbn().getNormalizedUserId()), /* flags= */ 0);
    }

    private ExpandableNotificationRow(Context sysUiContext, AttributeSet attrs,
            Context userContext) {
        super(sysUiContext, attrs);
        mImageResolver = new NotificationInlineImageResolver(userContext,
                new NotificationInlineImageCache());
        float radius = getResources().getDimension(R.dimen.notification_corner_radius_small);
        mSmallRoundness = radius / getMaxRadius();
Loading