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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20943164

Change-Id: I1d5b7b5aa824f2e3c53ad9ce47908d5c90e37c26
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Massimo Carli
2023-01-13 17:02:10 +00:00
committed by Automerger Merge Worker
2 changed files with 2 additions and 24 deletions

View File

@@ -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);

View File

@@ -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);