Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1be9ef4f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "CameraServiceProxy: Extend the recent app resizeable query" into tm-dev

parents a8b20748 f452138f
Loading
Loading
Loading
Loading
+23 −18
Original line number Diff line number Diff line
@@ -467,7 +467,8 @@ public class CameraServiceProxy extends SystemService
            ParceledListSlice<ActivityManager.RecentTaskInfo> recentTasks = null;

            try {
                recentTasks = ActivityTaskManager.getService().getRecentTasks(/*maxNum*/1,
                // Get 2 recent tasks in case we are running in split mode
                recentTasks = ActivityTaskManager.getService().getRecentTasks(/*maxNum*/2,
                        /*flags*/ 0, userId);
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to query recent tasks!");
@@ -475,7 +476,7 @@ public class CameraServiceProxy extends SystemService
            }

            if ((recentTasks != null) && (!recentTasks.getList().isEmpty())) {
                ActivityManager.RecentTaskInfo task = recentTasks.getList().get(0);
                for (ActivityManager.RecentTaskInfo task : recentTasks.getList()) {
                    if (packageName.equals(task.topActivityInfo.packageName)) {
                        taskInfo = new TaskInfo();
                        taskInfo.frontTaskId = task.taskId;
@@ -489,9 +490,13 @@ public class CameraServiceProxy extends SystemService
                        taskInfo.isFixedOrientationPortrait =
                                ActivityInfo.isFixedOrientationPortrait(
                                        task.topActivityInfo.screenOrientation);
                } else {
                    Log.e(TAG, "Recent task package name: " + task.topActivityInfo.packageName
                            + " doesn't match with camera client package name: " + packageName);
                        break;
                    }
                }

                if (taskInfo == null) {
                    Log.e(TAG, "Recent tasks don't include camera client package name: " +
                            packageName);
                    return CaptureRequest.SCALER_ROTATE_AND_CROP_NONE;
                }
            } else {