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

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

Snap for 10338099 from d5b8a608 to udc-release

Change-Id: I81ca45479b025567f6d21e0e4e1f69554f1239ce
parents 0c2919f8 d5b8a608
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.app;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doReturn;
@@ -26,6 +27,7 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;

@@ -209,6 +211,42 @@ public class KeyguardManagerTest {
        verifyDeviceLockedAndRemoveLock();
    }

    @Test
    public void createConfirmDeviceCredentialForRemoteValidationIntent() {
        RemoteLockscreenValidationSession remoteLockscreenValidationSession =
                new RemoteLockscreenValidationSession.Builder()
                        .setSourcePublicKey("sourcePublicKey".getBytes())
                        .build();
        ComponentName componentName = new ComponentName("pkg", "cls");
        String title = "title";
        String description = "description";
        String checkboxLabel = "checkboxLabel";
        String alternateButtonLabel = "alternateButtonLabel";

        Intent intent = mKeyguardManager.createConfirmDeviceCredentialForRemoteValidationIntent(
                remoteLockscreenValidationSession,
                componentName,
                title,
                description,
                checkboxLabel,
                alternateButtonLabel
        );

        assertNotNull(intent);
        assertEquals(KeyguardManager.ACTION_CONFIRM_REMOTE_DEVICE_CREDENTIAL, intent.getAction());
        assertEquals(remoteLockscreenValidationSession,
                intent.getParcelableExtra(
                        KeyguardManager.EXTRA_REMOTE_LOCKSCREEN_VALIDATION_SESSION,
                        RemoteLockscreenValidationSession.class));
        assertEquals(componentName,
                intent.getParcelableExtra(Intent.EXTRA_COMPONENT_NAME, ComponentName.class));
        assertEquals(title, intent.getStringExtra(KeyguardManager.EXTRA_TITLE));
        assertEquals(description, intent.getStringExtra(KeyguardManager.EXTRA_DESCRIPTION));
        assertEquals(checkboxLabel, intent.getStringExtra(KeyguardManager.EXTRA_CHECKBOX_LABEL));
        assertEquals(alternateButtonLabel,
                intent.getStringExtra(KeyguardManager.EXTRA_ALTERNATE_BUTTON_LABEL));
    }

    private void verifyDeviceLockedAndRemoveLock() {
        assertTrue(mKeyguardManager.isDeviceSecure());
        assertTrue("Failed to remove new password that was set in the test case.",
+3 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
        // display state, so we have to look through all displays to match the address
        final Display[] displays = mDisplayManager.getDisplays(
                DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED);
        final Display defaultDisplay = mDisplayManager.getDisplay(Display.DEFAULT_DISPLAY);


        for (int i = 0; i < displays.length; i++) {
            DisplayAddress.Physical address =
@@ -255,6 +255,8 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
                // TODO(b/287170025): This should be something like if (!rearDisplay.isEnabled)
                //  instead. Currently when the rear display is disabled, its state is STATE_OFF.
                if (rearDisplay.getDisplayId() != Display.DEFAULT_DISPLAY) {
                    final Display defaultDisplay = mDisplayManager
                            .getDisplay(Display.DEFAULT_DISPLAY);
                    rotateRearDisplayMetricsIfNeeded(defaultDisplay.getRotation(),
                            rearDisplay.getRotation(), rearDisplayMetrics);
                }
+15 −0
Original line number Diff line number Diff line
@@ -710,4 +710,19 @@ public abstract class WMShellModule {
    static DesktopModeTaskRepository provideDesktopModeTaskRepository() {
        return new DesktopModeTaskRepository();
    }

    //
    // Misc
    //

    // TODO: Temporarily move dependencies to this instead of ShellInit since that is needed to add
    // the callback. We will be moving to a different explicit startup mechanism in a follow- up CL.
    @WMSingleton
    @ShellCreateTriggerOverride
    @Provides
    static Object provideIndependentShellComponentsToCreate(
            DefaultMixedHandler defaultMixedHandler,
            Optional<DesktopModeController> desktopModeController) {
        return new Object();
    }
}
+9 −3
Original line number Diff line number Diff line
@@ -2365,6 +2365,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    prepareExitSplitScreen(STAGE_TYPE_UNDEFINED, out);
                }
            }

            // When split in the background, it should be only opening/dismissing transition and
            // would keep out not empty. Prevent intercepting all transitions for split screen when
            // it is in the background and not identify to handle it.
            return (!out.isEmpty() || isSplitScreenVisible()) ? out : null;
        } else {
            if (isOpening && getStageOfTask(triggerTask) != null) {
                // One task is appearing into split, prepare to enter split screen.
@@ -2373,9 +2378,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
                        TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
            }
        }
            return out;
        }
    }

    /**
     * This is used for mixed scenarios. For such scenarios, just make sure to include exiting
@@ -2506,8 +2511,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                        && getStageType(dismissStages.valueAt(0)) == STAGE_TYPE_MAIN)
                        || mMainStage.getChildCount() == 0 ? STAGE_TYPE_SIDE : STAGE_TYPE_MAIN;
                // If there is a fullscreen opening change, we should not bring stage to top.
                prepareExitSplitScreen(record.mContainShowFullscreenChange
                        ? STAGE_TYPE_UNDEFINED : dismissTop, wct);
                prepareExitSplitScreen(
                        !record.mContainShowFullscreenChange && isSplitScreenVisible()
                        ? dismissTop : STAGE_TYPE_UNDEFINED, wct);
                mSplitTransitions.startDismissTransition(wct, this, dismissTop,
                        EXIT_REASON_APP_FINISHED);
                // This can happen in some pathological cases. For example:
+0 −1
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ private val KNOWN_PLUGINS =
        "com.android.systemui.falcon.four" to listOf(ClockMetadata("DIGITAL_CLOCK_GROWTH")),
        "com.android.systemui.falcon.five" to listOf(ClockMetadata("DIGITAL_CLOCK_HANDWRITTEN")),
        "com.android.systemui.falcon.six" to listOf(ClockMetadata("DIGITAL_CLOCK_INFLATE")),
        "com.android.systemui.falcon.seven" to listOf(ClockMetadata("DIGITAL_CLOCK_METRO")),
        "com.android.systemui.falcon.eight" to listOf(ClockMetadata("DIGITAL_CLOCK_NUMBEROVERLAP")),
        "com.android.systemui.falcon.nine" to listOf(ClockMetadata("DIGITAL_CLOCK_WEATHER")),
    )
Loading