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

am: 427e41bd07

Change-Id: I15b75499f92747cf7772eccada58887d40d98a06
This commit is contained in:
Matthew Ng
2018-04-20 17:24:10 -07:00
committed by android-build-merger
3 changed files with 36 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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() {

View File

@@ -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) {