Merge "Fix notification permission for letterboxed activity" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bab869ca8c
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user