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

Commit 1826f52f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [15732630, 15732754, 15732755, 15732756, 15732757,...

Merge cherrypicks of [15732630, 15732754, 15732755, 15732756, 15732757, 15733137, 15733138, 15732858, 15733570, 15733571, 15733572, 15733573, 15733574, 15732859, 15733575, 15733576, 15733685, 15733686] into sc-d1-release

Change-Id: Id632c9017517e2f36dd6be234269658f83f095a3
parents e9d071e8 987179a2
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -464,11 +464,7 @@ public final class ActivityThread extends ClientTransactionHandler

        @Override
        public int hashCode() {
            return hashCode(authority, userId);
        }

        public static int hashCode(final String auth, final int userIdent) {
            return ((auth != null) ? auth.hashCode() : 0) ^ userIdent;
            return ((authority != null) ? authority.hashCode() : 0) ^ userId;
        }
    }

@@ -490,7 +486,7 @@ public final class ActivityThread extends ClientTransactionHandler
    // Note we never removes items from this map but that's okay because there are only so many
    // users and so many authorities.
    @GuardedBy("mGetProviderKeys")
    final SparseArray<ProviderKey> mGetProviderKeys = new SparseArray<>();
    final ArrayMap<ProviderKey, ProviderKey> mGetProviderKeys = new ArrayMap<>();

    final ArrayMap<Activity, ArrayList<OnActivityPausedListener>> mOnPauseListeners
        = new ArrayMap<Activity, ArrayList<OnActivityPausedListener>>();
@@ -7016,11 +7012,11 @@ public final class ActivityThread extends ClientTransactionHandler
    }

    private ProviderKey getGetProviderKey(String auth, int userId) {
        final int key = ProviderKey.hashCode(auth, userId);
        final ProviderKey key = new ProviderKey(auth, userId);
        synchronized (mGetProviderKeys) {
            ProviderKey lock = mGetProviderKeys.get(key);
            if (lock == null) {
                lock = new ProviderKey(auth, userId);
                lock = key;
                mGetProviderKeys.put(key, lock);
            }
            return lock;
+7 −0
Original line number Diff line number Diff line
@@ -155,6 +155,13 @@ public class UdfpsKeyguardView extends UdfpsAnimationView {
        updateAlpha();
    }

    /**
     * @return alpha between 0 and 255
     */
    int getUnpausedAlpha() {
        return mAlpha;
    }

    @Override
    protected int updateAlpha() {
        int alpha = super.updateAlpha();
+6 −3
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
        pw.println("mIsBouncerVisible=" + mIsBouncerVisible);
        pw.println("mInputBouncerHiddenAmount=" + mInputBouncerHiddenAmount);
        pw.println("mStatusBarExpansion=" + mStatusBarExpansion);
        pw.println("mAlpha=" + mView.getAlpha());
        pw.println("unpausedAlpha=" + mView.getUnpausedAlpha());
        pw.println("mUdfpsRequested=" + mUdfpsRequested);
        pw.println("mView.mUdfpsRequested=" + mView.mUdfpsRequested);
        pw.println("mLaunchTransitionFadingAway=" + mLaunchTransitionFadingAway);
@@ -168,10 +168,10 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
            return false;
        }

        boolean udfpsAffordanceWasNotShowing = shouldPauseAuth();
        mShowingUdfpsBouncer = show;
        updatePauseAuth();
        if (mShowingUdfpsBouncer) {
            if (mStatusBarState == StatusBarState.SHADE_LOCKED) {
            if (udfpsAffordanceWasNotShowing) {
                mView.animateInUdfpsBouncer(null);
            }

@@ -184,6 +184,8 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
        } else {
            mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false);
        }
        updateAlpha();
        updatePauseAuth();
        return true;
    }

@@ -308,6 +310,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                public void requestUdfps(boolean request, int color) {
                    mUdfpsRequested = request;
                    mView.requestUdfps(request, color);
                    updateAlpha();
                    updatePauseAuth();
                }

+19 −0
Original line number Diff line number Diff line
@@ -313,6 +313,25 @@ public class UdfpsKeyguardViewControllerTest extends SysuiTestCase {
        verify(mView).setUnpausedAlpha(0);
    }

    @Test
    public void testShowUdfpsBouncer() {
        // GIVEN view is attached and status bar expansion is 0
        mController.onViewAttached();
        captureExpansionListeners();
        captureKeyguardStateControllerCallback();
        captureAltAuthInterceptor();
        updateStatusBarExpansion(0, true);
        reset(mView);
        when(mView.getContext()).thenReturn(mResourceContext);
        when(mResourceContext.getString(anyInt())).thenReturn("test string");

        // WHEN status bar expansion is 0 but udfps bouncer is requested
        mAltAuthInterceptor.showAlternateAuthBouncer();

        // THEN alpha is 0
        verify(mView).setUnpausedAlpha(255);
    }

    private void sendStatusBarStateChanged(int statusBarState) {
        mStatusBarStateListener.onStateChanged(statusBarState);
    }
+4 −2
Original line number Diff line number Diff line
@@ -411,7 +411,7 @@ final class DisplayPowerState {
     * Updates the state of the screen and backlight asynchronously on a separate thread.
     */
    private final class PhotonicModulator extends Thread {
        private static final int INITIAL_SCREEN_STATE = Display.STATE_OFF; // unknown, assume off
        private static final int INITIAL_SCREEN_STATE = Display.STATE_UNKNOWN;
        private static final float INITIAL_BACKLIGHT_FLOAT = PowerManager.BRIGHTNESS_INVALID_FLOAT;

        private final Object mLock = new Object();
@@ -494,7 +494,9 @@ final class DisplayPowerState {
                    if (!backlightChanged) {
                        mBacklightChangeInProgress = false;
                    }
                    if (!stateChanged && !backlightChanged) {
                    boolean valid = state != Display.STATE_UNKNOWN && !Float.isNaN(brightnessState);
                    boolean changed = stateChanged || backlightChanged;
                    if (!valid || !changed) {
                        try {
                            mLock.wait();
                        } catch (InterruptedException ex) {
Loading