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

Commit 652de4ec authored by Matthew Ng's avatar Matthew Ng Committed by android-build-merger
Browse files

Merge "Add a function to get the secondary split screen bounds" into pi-dev

am: 427e41bd

Change-Id: I15b75499f92747cf7772eccada58887d40d98a06
parents 64a615ee 427e41bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -49,4 +49,9 @@ interface ISystemUiProxy {
     * Notifies SystemUI that Overview is shown.
     */
    void onOverviewShown(boolean fromHome) = 6;

    /**
     * Get the secondary split screen app's rectangle when not minimized.
     */
    Rect getNonMinimizedSplitScreenSecondaryBounds() = 7;
}
+14 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.os.Binder;
import android.os.Handler;
@@ -42,6 +41,7 @@ import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.GraphicBufferCompat;
import com.android.systemui.stackdivider.Divider;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.policy.CallbackController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
@@ -147,6 +147,19 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                Binder.restoreCallingIdentity(token);
            }
        }

        public Rect getNonMinimizedSplitScreenSecondaryBounds() {
            long token = Binder.clearCallingIdentity();
            try {
                Divider divider = ((SystemUIApplication) mContext).getComponent(Divider.class);
                if (divider != null) {
                    return divider.getView().getNonMinimizedSplitScreenSecondaryBounds();
                }
                return null;
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }
    };

    private final BroadcastReceiver mLauncherStateChangedReceiver = new BroadcastReceiver() {
+17 −0
Original line number Diff line number Diff line
@@ -378,6 +378,23 @@ public class DividerView extends FrameLayout implements OnTouchListener,
        return mWindowManagerProxy;
    }

    public Rect getNonMinimizedSplitScreenSecondaryBounds() {
        calculateBoundsForPosition(mSnapTargetBeforeMinimized.position,
                DockedDividerUtils.invertDockSide(mDockSide), mOtherTaskRect);
        switch (mDockSide) {
            case WindowManager.DOCKED_LEFT:
                mOtherTaskRect.right -= mStableInsets.right;
                break;
            case WindowManager.DOCKED_RIGHT:
                mOtherTaskRect.left -= mStableInsets.left;
                break;
            case WindowManager.DOCKED_TOP:
                mOtherTaskRect.bottom -= mStableInsets.bottom;
                break;
        }
        return mOtherTaskRect;
    }

    public boolean startDragging(boolean animate, boolean touching) {
        cancelFlingAnimation();
        if (touching) {