Loading services/core/java/com/android/server/wm/Task.java +2 −5 Original line number Diff line number Diff line Loading @@ -3508,13 +3508,10 @@ class Task extends TaskFragment { top.mLetterboxUiController.getLetterboxPositionForVerticalReachability(); } } // User Aspect Ratio Settings button is enabled if the app is not in SCM and has // launchable activities // User Aspect Ratio Settings is enabled if the app is not in SCM info.topActivityEligibleForUserAspectRatioButton = top != null && !info.topActivityInSizeCompat && top.mLetterboxUiController.shouldEnableUserAspectRatioSettings() && mAtmService.mContext.getPackageManager() .getLaunchIntentForPackage(getBasePackageName()) != null; && top.mLetterboxUiController.shouldEnableUserAspectRatioSettings(); info.topActivityBoundsLetterboxed = top != null && top.areBoundsLetterboxed(); } Loading services/tests/wmtests/src/com/android/server/wm/TaskTests.java +0 −8 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ import android.content.ComponentName; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; Loading Loading @@ -571,15 +570,12 @@ public class TaskTests extends WindowTestsBase { .setWindowingMode(WINDOWING_MODE_FULLSCREEN).setDisplay(display).build(); final Task task = rootTask.getBottomMostTask(); final ActivityRecord root = task.getTopNonFinishingActivity(); final PackageManager pm = mContext.getPackageManager(); spyOn(pm); spyOn(mWm.mLetterboxConfiguration); spyOn(root); spyOn(root.mLetterboxUiController); doReturn(true).when(root.mLetterboxUiController) .shouldEnableUserAspectRatioSettings(); doReturn(new Intent()).when(pm).getLaunchIntentForPackage(anyString()); doReturn(false).when(root).inSizeCompatMode(); doReturn(task).when(root).getOrganizedTask(); Loading @@ -597,10 +593,6 @@ public class TaskTests extends WindowTestsBase { doReturn(true).when(root).inSizeCompatMode(); assertFalse(task.getTaskInfo().topActivityEligibleForUserAspectRatioButton); doReturn(false).when(root).inSizeCompatMode(); // When app doesn't have any launchable activities the button is not enabled doReturn(null).when(pm).getLaunchIntentForPackage(anyString()); assertFalse(task.getTaskInfo().topActivityEligibleForUserAspectRatioButton); } /** Loading Loading
services/core/java/com/android/server/wm/Task.java +2 −5 Original line number Diff line number Diff line Loading @@ -3508,13 +3508,10 @@ class Task extends TaskFragment { top.mLetterboxUiController.getLetterboxPositionForVerticalReachability(); } } // User Aspect Ratio Settings button is enabled if the app is not in SCM and has // launchable activities // User Aspect Ratio Settings is enabled if the app is not in SCM info.topActivityEligibleForUserAspectRatioButton = top != null && !info.topActivityInSizeCompat && top.mLetterboxUiController.shouldEnableUserAspectRatioSettings() && mAtmService.mContext.getPackageManager() .getLaunchIntentForPackage(getBasePackageName()) != null; && top.mLetterboxUiController.shouldEnableUserAspectRatioSettings(); info.topActivityBoundsLetterboxed = top != null && top.areBoundsLetterboxed(); } Loading
services/tests/wmtests/src/com/android/server/wm/TaskTests.java +0 −8 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ import android.content.ComponentName; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; Loading Loading @@ -571,15 +570,12 @@ public class TaskTests extends WindowTestsBase { .setWindowingMode(WINDOWING_MODE_FULLSCREEN).setDisplay(display).build(); final Task task = rootTask.getBottomMostTask(); final ActivityRecord root = task.getTopNonFinishingActivity(); final PackageManager pm = mContext.getPackageManager(); spyOn(pm); spyOn(mWm.mLetterboxConfiguration); spyOn(root); spyOn(root.mLetterboxUiController); doReturn(true).when(root.mLetterboxUiController) .shouldEnableUserAspectRatioSettings(); doReturn(new Intent()).when(pm).getLaunchIntentForPackage(anyString()); doReturn(false).when(root).inSizeCompatMode(); doReturn(task).when(root).getOrganizedTask(); Loading @@ -597,10 +593,6 @@ public class TaskTests extends WindowTestsBase { doReturn(true).when(root).inSizeCompatMode(); assertFalse(task.getTaskInfo().topActivityEligibleForUserAspectRatioButton); doReturn(false).when(root).inSizeCompatMode(); // When app doesn't have any launchable activities the button is not enabled doReturn(null).when(pm).getLaunchIntentForPackage(anyString()); assertFalse(task.getTaskInfo().topActivityEligibleForUserAspectRatioButton); } /** Loading