Loading services/core/java/com/android/server/wm/Task.java +2 −0 Original line number Diff line number Diff line Loading @@ -5101,6 +5101,7 @@ class Task extends TaskFragment { mTranslucentActivityWaiting = r; mPendingConvertFromTranslucentActivity = r; mUndrawnActivitiesBelowTopTranslucent.clear(); updateTaskDescription(); mHandler.sendEmptyMessageDelayed(TRANSLUCENT_TIMEOUT_MSG, TRANSLUCENT_CONVERSION_TIMEOUT); } Loading @@ -5110,6 +5111,7 @@ class Task extends TaskFragment { + " but is " + r); } mPendingConvertFromTranslucentActivity = null; updateTaskDescription(); } /** Loading services/tests/wmtests/src/com/android/server/wm/TaskTests.java +38 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ import android.util.Xml; import android.view.Display; import android.view.DisplayInfo; import android.view.SurfaceControl; import android.view.WindowInsetsController; import android.window.TaskFragmentOrganizer; import androidx.test.filters.MediumTest; Loading Loading @@ -2109,6 +2110,43 @@ public class TaskTests extends WindowTestsBase { assertEquals(Color.RED, task.getTaskDescription().getBackgroundColor()); } @Test public void testUpdateTopOpaqueSystemBarsAppearanceWhenActivityBecomesTransparent() { final Task task = createTask(mDisplayContent); final ActivityRecord activity = createActivityRecord(task); final ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(); td.setSystemBarsAppearance( WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND); activity.setTaskDescription(td); assertEquals(WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); activity.setOccludesParent(false); assertEquals(0, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); } @Test public void testUpdateTopOpaqueSystemBarsAppearanceWhenActivityBecomesOpaque() { final Task task = createTask(mDisplayContent); final ActivityRecord activity = createActivityRecord(task); activity.setOccludesParent(false); final ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(); td.setSystemBarsAppearance( WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND); activity.setTaskDescription(td); assertEquals(0, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); activity.setOccludesParent(true); assertEquals(WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); } private Task getTestTask() { return new TaskBuilder(mSupervisor).setCreateActivity(true).build(); } Loading Loading
services/core/java/com/android/server/wm/Task.java +2 −0 Original line number Diff line number Diff line Loading @@ -5101,6 +5101,7 @@ class Task extends TaskFragment { mTranslucentActivityWaiting = r; mPendingConvertFromTranslucentActivity = r; mUndrawnActivitiesBelowTopTranslucent.clear(); updateTaskDescription(); mHandler.sendEmptyMessageDelayed(TRANSLUCENT_TIMEOUT_MSG, TRANSLUCENT_CONVERSION_TIMEOUT); } Loading @@ -5110,6 +5111,7 @@ class Task extends TaskFragment { + " but is " + r); } mPendingConvertFromTranslucentActivity = null; updateTaskDescription(); } /** Loading
services/tests/wmtests/src/com/android/server/wm/TaskTests.java +38 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ import android.util.Xml; import android.view.Display; import android.view.DisplayInfo; import android.view.SurfaceControl; import android.view.WindowInsetsController; import android.window.TaskFragmentOrganizer; import androidx.test.filters.MediumTest; Loading Loading @@ -2109,6 +2110,43 @@ public class TaskTests extends WindowTestsBase { assertEquals(Color.RED, task.getTaskDescription().getBackgroundColor()); } @Test public void testUpdateTopOpaqueSystemBarsAppearanceWhenActivityBecomesTransparent() { final Task task = createTask(mDisplayContent); final ActivityRecord activity = createActivityRecord(task); final ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(); td.setSystemBarsAppearance( WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND); activity.setTaskDescription(td); assertEquals(WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); activity.setOccludesParent(false); assertEquals(0, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); } @Test public void testUpdateTopOpaqueSystemBarsAppearanceWhenActivityBecomesOpaque() { final Task task = createTask(mDisplayContent); final ActivityRecord activity = createActivityRecord(task); activity.setOccludesParent(false); final ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(); td.setSystemBarsAppearance( WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND); activity.setTaskDescription(td); assertEquals(0, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); activity.setOccludesParent(true); assertEquals(WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND, task.getTaskDescription().getTopOpaqueSystemBarsAppearance()); } private Task getTestTask() { return new TaskBuilder(mSupervisor).setCreateActivity(true).build(); } Loading