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

Commit d0938d02 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Removing dependencies on recents-specific code in SysUI"

parents 9e4a42e7 67f5c8b2
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -341,6 +341,20 @@ public class ActivityManagerWrapper {
        }
    }

    /**
     * Moves an already resumed task to the side of the screen to initiate split screen.
     */
    public boolean setTaskWindowingModeSplitScreenPrimary(int taskId, int createMode,
            Rect initialBounds) {
        try {
            return ActivityTaskManager.getService().setTaskWindowingModeSplitScreenPrimary(taskId,
                    createMode, true /* onTop */, false /* animate */, initialBounds,
                    true /* showRecents */);
        } catch (RemoteException e) {
            return false;
        }
    }

    /**
     * Registers a task stack listener with the system.
     * This should be called on the main thread.
+19 −0
Original line number Diff line number Diff line
@@ -151,6 +151,25 @@ public class WindowManagerWrapper {
        }
    }

    public void setPipVisibility(final boolean visible) {
        try {
            WindowManagerGlobal.getWindowManagerService().setPipVisibility(visible);
        } catch (RemoteException e) {
            Log.e(TAG, "Unable to reach window manager", e);
        }
    }

    /**
     * @return whether there is a soft nav bar.
     */
    public boolean hasSoftNavigationBar() {
        try {
            return WindowManagerGlobal.getWindowManagerService().hasNavigationBar();
        } catch (RemoteException e) {
            return false;
        }
    }

    /**
     * @return The side of the screen where navigation bar is positioned.
     * @see #NAV_BAR_POS_RIGHT
+3 −4
Original line number Diff line number Diff line
@@ -86,9 +86,8 @@ import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.util.Preconditions;
import com.android.internal.widget.LockPatternUtils;
import com.android.settingslib.WirelessUtils;
import com.android.systemui.recents.misc.SysUiTaskStackChangeListener;
import com.android.systemui.shared.system.ActivityManagerWrapper;

import com.android.systemui.shared.system.TaskStackChangeListener;
import com.google.android.collect.Lists;

import java.io.FileDescriptor;
@@ -2218,8 +2217,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        }
    }

    private final SysUiTaskStackChangeListener
            mTaskStackListener = new SysUiTaskStackChangeListener() {
    private final TaskStackChangeListener
            mTaskStackListener = new TaskStackChangeListener() {
        @Override
        public void onTaskStackChangedBackground() {
            try {
+10 −13
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@

package com.android.systemui;

import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON;
import static com.android.systemui.shared.system.NavigationBarCompat.InteractionType;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -33,11 +38,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.view.MotionEvent;

import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -46,17 +47,11 @@ import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.policy.CallbackController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON;
import static com.android.systemui.shared.system.NavigationBarCompat.InteractionType;

/**
 * Class to send information from overview to launcher with a binder.
 */
@@ -133,7 +128,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            }
            long token = Binder.clearCallingIdentity();
            try {
                EventBus.getDefault().post(new DockedFirstAnimationFrameEvent());
                Divider divider = SysUiServiceProvider.getComponent(mContext, Divider.class);
                if (divider != null) {
                    divider.onDockedFirstAnimationFrame();
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }
@@ -314,8 +312,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                getDefaultInteractionFlags());

        // Listen for the package update changes.
        if (SystemServicesProxy.getInstance(context)
                .isSystemUser(mDeviceProvisionedController.getCurrentUser())) {
        if (mDeviceProvisionedController.getCurrentUser() == UserHandle.USER_SYSTEM) {
            updateEnabledState();
            mDeviceProvisionedController.addCallback(mDeviceProvisionedCallback);
            IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
+1 −18
Original line number Diff line number Diff line
@@ -22,27 +22,10 @@ import android.view.View;

public interface RecentsComponent {
    void showRecentApps(boolean triggeredFromAltTab);
    void showNextAffiliatedTask();
    void showPrevAffiliatedTask();

    /**
     * Docks the top-most task and opens recents.
     */
    boolean splitPrimaryTask(int dragMode, int stackCreateMode, Rect initialBounds,
    boolean splitPrimaryTask(int stackCreateMode, Rect initialBounds,
            int metricsDockAction);

    /**
     * Called during a drag-from-navbar-in gesture.
     *
     * @param distanceFromTop the distance of the current drag in gesture from the top of the
     *                        screen
     */
    void onDraggingInRecents(float distanceFromTop);

    /**
     * Called when the gesture to drag in recents ended.
     *
     * @param velocity the velocity of the finger when releasing it in pixels per second
     */
    void onDraggingInRecentsEnded(float velocity);
}
Loading