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

Commit 76d159fd authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge changes I96fdf9b4,Ia85d9d89,I1fd23114

* changes:
  Added isDockable field to RunningTaskInfo
  Display warning toast when we try to launch unresizeable app in split-screen
  Don't allow non-dockable activities/tasks in docked stack.
parents 7134cce6 21b6058f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1195,6 +1195,12 @@ public class ActivityManager {
         */
        public Rect bounds;

        /**
         * True if the task can go in the docked stack.
         * @hide
         */
        public boolean isDockable;

        public RecentTaskInfo() {
        }

@@ -1238,6 +1244,7 @@ public class ActivityManager {
            } else {
                dest.writeInt(0);
            }
            dest.writeInt(isDockable ? 1 : 0);
        }

        public void readFromParcel(Parcel source) {
@@ -1260,6 +1267,7 @@ public class ActivityManager {
            numActivities = source.readInt();
            bounds = source.readInt() > 0 ?
                    Rect.CREATOR.createFromParcel(source) : null;
            isDockable = source.readInt() == 1;
        }

        public static final Creator<RecentTaskInfo> CREATOR
@@ -1444,6 +1452,12 @@ public class ActivityManager {
         */
        public long lastActiveTime;

        /**
         * True if the task can go in the docked stack.
         * @hide
         */
        public boolean isDockable;

        public RunningTaskInfo() {
        }

+4 −2
Original line number Diff line number Diff line
@@ -4006,8 +4006,10 @@
    <string name="lock_to_app_unlock_password">Ask for password before unpinning</string>

    <!-- Multi-Window strings -->
    <!-- Warning message when a non-resizeble tasks is docked. -->
    <string name="dock_non_resizeble_text">App is not resizeable, scroll it with two fingers.</string>
    <!-- Warning message when a non-resizeble tasks is docked whose display windows are cropped. -->
    <string name="dock_cropped_windows_text">App is not resizeable, scroll it with two fingers.</string>
    <!-- Warning message when we try to dock a non-resizeble tasks and launch it in fullscreen instead. -->
    <string name="dock_non_resizeble_failed_to_dock_text">App does not support split-screen.</string>

    <!-- Notification shown when device owner silently installs a package [CHAR LIMIT=NONE] -->
    <string name="package_installed_device_owner">Installed by your administrator</string>
+2 −1
Original line number Diff line number Diff line
@@ -610,7 +610,8 @@
  <java-symbol type="string" name="display_manager_overlay_display_name" />
  <java-symbol type="string" name="display_manager_overlay_display_secure_suffix" />
  <java-symbol type="string" name="display_manager_overlay_display_title" />
  <java-symbol type="string" name="dock_non_resizeble_text" />
  <java-symbol type="string" name="dock_cropped_windows_text" />
  <java-symbol type="string" name="dock_non_resizeble_failed_to_dock_text" />
  <java-symbol type="string" name="double_tap_toast" />
  <java-symbol type="string" name="durationDays" />
  <java-symbol type="string" name="durationDayHours" />
+1 −0
Original line number Diff line number Diff line
@@ -8591,6 +8591,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        if (tr.mBounds != null) {
            rti.bounds = new Rect(tr.mBounds);
        }
        rti.isDockable = tr.canGoInDockedStack();
        ActivityRecord base = null;
        ActivityRecord top = null;
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.am;

import static android.app.ActivityManager.StackId;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE;
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_CONFIGURATION;
@@ -759,10 +760,19 @@ final class ActivityRecord {
        return !isHomeActivity() && ActivityInfo.isResizeableMode(info.resizeMode);
    }

    boolean isResizeableOrForced() {
        return !isHomeActivity() && (isResizeable() || service.mForceResizableActivities);
    }

    boolean supportsPictureInPicture() {
        return !isHomeActivity() && info.resizeMode == RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
    }

    boolean canGoInDockedStack() {
        return !isHomeActivity()
                && (isResizeableOrForced() || info.resizeMode == RESIZE_MODE_CROP_WINDOWS);
    }

    boolean isAlwaysFocusable() {
        return (info.flags & FLAG_ALWAYS_FOCUSABLE) != 0;
    }
Loading