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

Commit 7c4b0829 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Add development option to force everything resizable"

parents 95d6bf14 8ccdf3ac
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -6277,6 +6277,15 @@ public final class Settings {
        */
       public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";

        /**
         * Whether any activity can be resized. When this is true, any
         * activity, regardless of manifest values, can be resized for multi-window.
         * (0 = false, 1 = true)
         * @hide
         */
        public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
                = "force_resizable_activities";

       /**
        * Whether user has enabled development settings.
        */
+0 −13
Original line number Diff line number Diff line
@@ -266,17 +266,6 @@ public class SystemServicesProxy {
        return null;
    }

    /** Allow a task to resize. */
    public void setTaskResizeable(int taskId) {
        if (mIam == null) return;

        try {
            mIam.setTaskResizeable(taskId, true);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

    /**
     * Resizes the given task to the new bounds.
     */
@@ -746,8 +735,6 @@ public class SystemServicesProxy {
            ActivityOptions options) {
        if (mIam != null) {
            try {
                // TODO: Remove when compatibility story is figured out.
                setTaskResizeable(taskId);
                mIam.startActivityFromRecents(
                        taskId, INVALID_STACK_ID, options == null ? null : options.toBundle());
                return true;
+8 −2
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ import android.os.WorkSource;
import android.os.storage.IMountService;
import android.os.storage.MountServiceInternal;
import android.os.storage.StorageManager;
import android.provider.Settings.Global;
import android.service.voice.IVoiceInteractionSession;
import android.service.voice.VoiceInteractionSession;
import android.util.ArrayMap;
@@ -1189,6 +1190,7 @@ public final class ActivityManagerService extends ActivityManagerNative
    String mOrigDebugApp = null;
    boolean mOrigWaitForDebugger = false;
    boolean mAlwaysFinishActivities = false;
    boolean mForceResizableActivites;
    IActivityController mController = null;
    String mProfileApp = null;
    ProcessRecord mProfileProc = null;
@@ -11638,14 +11640,17 @@ public final class ActivityManagerService extends ActivityManagerNative
    private void retrieveSettings() {
        final ContentResolver resolver = mContext.getContentResolver();
        String debugApp = Settings.Global.getString(
            resolver, Settings.Global.DEBUG_APP);
        String debugApp = Settings.Global.getString(resolver, Settings.Global.DEBUG_APP);
        boolean waitForDebugger = Settings.Global.getInt(
            resolver, Settings.Global.WAIT_FOR_DEBUGGER, 0) != 0;
        boolean alwaysFinishActivities = Settings.Global.getInt(
            resolver, Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0) != 0;
        boolean forceRtl = Settings.Global.getInt(
                resolver, Settings.Global.DEVELOPMENT_FORCE_RTL, 0) != 0;
        int defaultForceResizable = Build.IS_DEBUGGABLE ? 1 : 0;
        boolean forceResizable = Settings.Global.getInt(
                resolver, Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES,
                defaultForceResizable) != 0;
        // Transfer any global setting for forcing RTL layout, into a System Property
        SystemProperties.set(Settings.Global.DEVELOPMENT_FORCE_RTL, forceRtl ? "1":"0");
@@ -11660,6 +11665,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            mDebugApp = mOrigDebugApp = debugApp;
            mWaitForDebugger = mOrigWaitForDebugger = waitForDebugger;
            mAlwaysFinishActivities = alwaysFinishActivities;
            mForceResizableActivites = forceResizable;
            // This happens before any activities are started, so we can
            // change mConfiguration in-place.
            updateConfigurationLocked(configuration, null, true);
+5 −2
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ final class TaskRecord {
        mNextAffiliateTaskId = nextTaskId;
        mCallingUid = callingUid;
        mCallingPackage = callingPackage;
        mResizeable = resizeable;
        mResizeable = resizeable || mService.mForceResizableActivites;
        mPrivileged = privileged;
        ActivityInfo info = mActivities.get(0).info;
        mMinimalSize = info != null && info.layout != null ? info.layout.minimalSize : -1;
@@ -420,7 +420,7 @@ final class TaskRecord {
        } else {
            autoRemoveRecents = false;
        }
        mResizeable = info.resizeable;
        mResizeable = info.resizeable || mService.mForceResizableActivites;
        mLockTaskMode = info.lockTaskLaunchMode;
        mPrivileged = (info.applicationInfo.privateFlags & PRIVATE_FLAG_PRIVILEGED) != 0;
        setLockTaskAuth();
@@ -626,6 +626,9 @@ final class TaskRecord {
        // Only set this based on the first activity
        if (mActivities.isEmpty()) {
            taskType = r.mActivityType;
            if (taskType == HOME_ACTIVITY_TYPE && mService.mForceResizableActivites) {
                mResizeable = r.info.resizeable;
            }
            isPersistable = r.isPersistable();
            mCallingUid = r.launchedFromUid;
            mCallingPackage = r.launchedFromPackage;