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

Commit bab869ca authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "Fix notification permission for letterboxed activity" into tm-qpr-dev

parents bc907f45 99131186
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1146,10 +1146,9 @@ final class LetterboxUiController {
        final ActivityRecord firstOpaqueActivityBeneath = mActivityRecord.getTask().getActivity(
                ActivityRecord::fillsParent, mActivityRecord, false /* includeBoundary */,
                true /* traverseTopToBottom */);
        if (firstOpaqueActivityBeneath == null
                || mActivityRecord.launchedFromUid != firstOpaqueActivityBeneath.getUid()) {
        if (firstOpaqueActivityBeneath == null) {
            // We skip letterboxing if the translucent activity doesn't have any opaque
            // activities beneath of if it's launched from a different user (e.g. notification)
            // activities beneath
            return;
        }
        inheritConfiguration(firstOpaqueActivityBeneath);
+0 −21
Original line number Diff line number Diff line
@@ -196,27 +196,6 @@ public class SizeCompatTests extends WindowTestsBase {
        assertEquals(1.5f, translucentActivity.getMaxAspectRatio(), 0.00001f);
    }

    @Test
    public void testNotApplyStrategyToTranslucentActivitiesWithDifferentUid() {
        mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true);
        setUpDisplaySizeWithApp(2000, 1000);
        prepareUnresizable(mActivity, 1.5f /* maxAspect */, SCREEN_ORIENTATION_PORTRAIT);
        mActivity.info.setMinAspectRatio(1.2f);
        mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */);
        // Translucent Activity
        final ActivityRecord translucentActivity = new ActivityBuilder(mAtm)
                .setScreenOrientation(SCREEN_ORIENTATION_LANDSCAPE)
                .setMinAspectRatio(1.1f)
                .setMaxAspectRatio(3f)
                .build();
        doReturn(false).when(translucentActivity).fillsParent();
        mTask.addChild(translucentActivity);
        // We check bounds
        final Rect opaqueBounds = mActivity.getConfiguration().windowConfiguration.getBounds();
        final Rect translucentRequestedBounds = translucentActivity.getRequestedOverrideBounds();
        assertNotEquals(opaqueBounds, translucentRequestedBounds);
    }

    @Test
    public void testApplyStrategyToMultipleTranslucentActivities() {
        mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true);