Merge "Add Dimmer to RootDisplayArea" into sc-dev
This commit is contained in:
@@ -37,7 +37,7 @@ import java.util.Map;
|
||||
* of the whole logical display, or a {@link DisplayAreaGroup} as the root of a partition of the
|
||||
* logical display.
|
||||
*/
|
||||
class RootDisplayArea extends DisplayArea<DisplayArea> {
|
||||
class RootDisplayArea extends DisplayArea.Dimmable {
|
||||
|
||||
/** {@link Feature} that are supported in this {@link DisplayArea} hierarchy. */
|
||||
List<DisplayAreaPolicyBuilder.Feature> mFeatures;
|
||||
|
||||
@@ -80,6 +80,7 @@ import android.util.DisplayMetrics;
|
||||
import android.util.TypedXmlPullParser;
|
||||
import android.util.TypedXmlSerializer;
|
||||
import android.util.Xml;
|
||||
import android.view.Display;
|
||||
import android.view.DisplayInfo;
|
||||
|
||||
import androidx.test.filters.MediumTest;
|
||||
@@ -1338,6 +1339,16 @@ public class TaskTests extends WindowTestsBase {
|
||||
verify(display).onDescendantOrientationChanged(same(task));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNonNullDimmerOnUntrustedDisplays() {
|
||||
final DisplayInfo untrustedDisplayInfo = new DisplayInfo(mDisplayInfo);
|
||||
untrustedDisplayInfo.flags &= ~Display.FLAG_TRUSTED;
|
||||
final DisplayContent untrustedDisplay = createNewDisplay(untrustedDisplayInfo);
|
||||
final ActivityRecord activity = createActivityRecord(untrustedDisplay);
|
||||
activity.setOccludesParent(false);
|
||||
assertNotNull(activity.getTask().getDimmer());
|
||||
}
|
||||
|
||||
private Task getTestTask() {
|
||||
final Task task = new TaskBuilder(mSupervisor).setCreateActivity(true).build();
|
||||
return task.getBottomMostTask();
|
||||
|
||||
Reference in New Issue
Block a user