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

Commit 22e0024f authored by Marzia Favaro's avatar Marzia Favaro
Browse files

Enable UserAspectRatioManager call AtivityRecord#canBeUniversalResizeable

instead of duplicating the method locally.

Bug: 374903057
Flag: EXEMPT change does nothing by itself
Test: UserAspectRatioManagerTest
Change-Id: I216f7a0ccbe682b22b3a16f431ce9c33393fc96a
parent 253eda20
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.SystemService;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -482,6 +483,19 @@ public class ActivityTaskManager {
        }
    }

    /**
     * @return Whether the app could be universal resizeable (assuming it's on a large screen and
     * ignoring possible overrides)
     * @hide
     */
    public boolean canBeUniversalResizeable(@NonNull ApplicationInfo appInfo) {
        try {
            return getService().canBeUniversalResizeable(appInfo);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Detaches the navigation bar from the app it was attached to during a transition.
     * @hide
+6 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ interface IActivityTaskManager {
    void reportAssistContextExtras(in IBinder assistToken, in Bundle extras,
            in AssistStructure structure, in AssistContent content, in Uri referrer);

    /**
     * @return whether the app could be universal resizeable (assuming it's on a large screen and
     * ignoring possible overrides)
     */
    boolean canBeUniversalResizeable(in ApplicationInfo appInfo);

    void setFocusedRootTask(int taskId);
    ActivityTaskManager.RootTaskInfo getFocusedRootTaskInfo();
    Rect getTaskBounds(int taskId);
+2 −2
Original line number Diff line number Diff line
@@ -3231,8 +3231,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     * Returns {@code true} if the fixed orientation, aspect ratio, resizability of the application
     * can be ignored.
     */
    static boolean canBeUniversalResizeable(ApplicationInfo appInfo, WindowManagerService wms,
            boolean isLargeScreen, boolean forActivity) {
    static boolean canBeUniversalResizeable(@NonNull ApplicationInfo appInfo,
            WindowManagerService wms, boolean isLargeScreen, boolean forActivity) {
        if (appInfo.category == ApplicationInfo.CATEGORY_GAME) {
            return false;
        }
+10 −0
Original line number Diff line number Diff line
@@ -2152,6 +2152,16 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        }
    }

    /**
     * @return ehether the application could be universal resizeable on a large screen,
     * ignoring any overrides
     */
    @Override
    public boolean canBeUniversalResizeable(@NonNull ApplicationInfo appInfo) {
        return ActivityRecord.canBeUniversalResizeable(appInfo, mWindowManager,
                /* isLargeScreen */ true, /* forActivity */ false);
    }

    @Override
    public void removeAllVisibleRecentTasks() {
        mAmInternal.enforceCallingPermission(REMOVE_TASKS, "removeAllVisibleRecentTasks()");