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

Commit db7d65d9 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker Committed by Anis Assi
Browse files

Merge cherrypicks of [15624560, 16103659, 15975848, 15975849, 15975850,...

Merge cherrypicks of [15624560, 16103659, 15975848, 15975849, 15975850, 16222361, 16190719, 16222704, 16214550] into security-aosp-rvc-release.

Change-Id: Id3a85132347ceee9a3b63acc7278add9732d0410
parents 89eeeb09 005bddca
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.Log;

import com.android.internal.annotations.GuardedBy;

import java.util.Objects;
import java.util.Set;

/**
@@ -85,6 +86,12 @@ public class Account implements Parcelable {
        if (TextUtils.isEmpty(type)) {
            throw new IllegalArgumentException("the type must not be empty: " + type);
        }
        if (name.length() > 200) {
            throw new IllegalArgumentException("account name is longer than 200 characters");
        }
        if (type.length() > 200) {
            throw new IllegalArgumentException("account type is longer than 200 characters");
        }
        this.name = name;
        this.type = type;
        this.accessId = accessId;
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.app.admin;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.content.ComponentName;
import android.content.Intent;
@@ -75,6 +77,13 @@ public abstract class DevicePolicyManagerInternal {
    public abstract void addOnCrossProfileWidgetProvidersChangeListener(
            OnCrossProfileWidgetProvidersChangeListener listener);

    /**
     * @param userHandle the handle of the user whose profile owner is being fetched.
     * @return the configured supervision app if it exists and is the device owner or policy owner.
     */
    public abstract @Nullable ComponentName getProfileOwnerOrDeviceOwnerSupervisionComponent(
            @NonNull UserHandle userHandle);

    /**
     * Checks if an app with given uid is an active device admin of its user and has the policy
     * specified.
+2 −2
Original line number Diff line number Diff line
@@ -134,11 +134,11 @@ public class StatusBarStateControllerImpl implements SysuiStatusBarStateControll
    }

    @Override
    public boolean setState(int state) {
    public boolean setState(int state, boolean force) {
        if (state > MAX_STATE || state < MIN_STATE) {
            throw new IllegalArgumentException("Invalid state " + state);
        }
        if (state == mState) {
        if (!force && state == mState) {
            return false;
        }

+13 −1
Original line number Diff line number Diff line
@@ -58,7 +58,19 @@ public interface SysuiStatusBarStateController extends StatusBarStateController
     * @param state see {@link StatusBarState} for valid options
     * @return {@code true} if the state changed, else {@code false}
     */
    boolean setState(int state);
    default boolean setState(int state) {
        return setState(state, false /* force */);
    }

    /**
     * Update the status bar state
     * @param state see {@link StatusBarState} for valid options
     * @param force whether to set the state even if it's the same as the current state. This will
     *              dispatch the state to all StatusBarStateListeners, ensuring that all listening
     *              components are reset to this state.
     * @return {@code true} if the state was changed or set forcefully
     */
    boolean setState(int state, boolean force);

    /**
     * Update the dozing state from {@link StatusBar}'s perspective
+9 −4
Original line number Diff line number Diff line
@@ -3152,6 +3152,10 @@ public class StatusBar extends SystemUI implements DemoMode,
    }

    boolean updateIsKeyguard() {
        return updateIsKeyguard(false /* force */);
    }

    boolean updateIsKeyguard(boolean force) {
        boolean wakeAndUnlocking = mBiometricUnlockController.getMode()
                == BiometricUnlockController.MODE_WAKE_AND_UNLOCK;

@@ -3174,7 +3178,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                showKeyguardImpl();
            }
        } else {
            return hideKeyguardImpl();
            return hideKeyguardImpl(force);
        }
        return false;
    }
@@ -3305,11 +3309,11 @@ public class StatusBar extends SystemUI implements DemoMode,
    /**
     * @return true if we would like to stay in the shade, false if it should go away entirely
     */
    public boolean hideKeyguardImpl() {
    public boolean hideKeyguardImpl(boolean force) {
        mIsKeyguard = false;
        Trace.beginSection("StatusBar#hideKeyguard");
        boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide();
        if (!(mStatusBarStateController.setState(StatusBarState.SHADE))) {
        if (!(mStatusBarStateController.setState(StatusBarState.SHADE, force))) {
            //TODO: StatusBarStateController should probably know about hiding the keyguard and
            // notify listeners.

@@ -3736,7 +3740,8 @@ public class StatusBar extends SystemUI implements DemoMode,
                // is correct.
                mHandler.post(() -> onCameraLaunchGestureDetected(mLastCameraLaunchSource));
            }
            updateIsKeyguard();
            // When finished going to sleep, force the status bar state to avoid stale state.
            updateIsKeyguard(true /* force */);
        }

        @Override
Loading