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

Commit a6c32d8b authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge changes from topic "shell_feature_interfaces_reland" into sc-dev am: d3d61ffe

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13895212

Change-Id: I2528258a1b17c1967ec13cf75a34029beb170a86
parents d5d57899 d3d61ffe
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.legacysplitscreen.LegacySplitScreenController;
import com.android.wm.shell.pip.phone.PipTouchHandler;
import com.android.wm.shell.splitscreen.SplitScreenController;
import com.android.wm.shell.startingsurface.StartingSurface;
import com.android.wm.shell.startingsurface.StartingWindowController;
import com.android.wm.shell.transition.Transitions;

import java.util.Optional;
@@ -47,7 +47,7 @@ public class ShellInitImpl {
    private final FullscreenTaskListener mFullscreenTaskListener;
    private final ShellExecutor mMainExecutor;
    private final Transitions mTransitions;
    private final Optional<StartingSurface> mStartingSurfaceOptional;
    private final StartingWindowController mStartingWindow;

    private final InitImpl mImpl = new InitImpl();

@@ -57,10 +57,10 @@ public class ShellInitImpl {
            Optional<LegacySplitScreenController> legacySplitScreenOptional,
            Optional<SplitScreenController> splitScreenOptional,
            Optional<AppPairsController> appPairsOptional,
            Optional<StartingSurface> startingSurfaceOptional,
            Optional<PipTouchHandler> pipTouchHandlerOptional,
            FullscreenTaskListener fullscreenTaskListener,
            Transitions transitions,
            StartingWindowController startingWindow,
            ShellExecutor mainExecutor) {
        mDisplayImeController = displayImeController;
        mDragAndDropController = dragAndDropController;
@@ -72,7 +72,7 @@ public class ShellInitImpl {
        mPipTouchHandlerOptional = pipTouchHandlerOptional;
        mTransitions = transitions;
        mMainExecutor = mainExecutor;
        mStartingSurfaceOptional = startingSurfaceOptional;
        mStartingWindow = startingWindow;
    }

    public ShellInit asShellInit() {
@@ -83,10 +83,10 @@ public class ShellInitImpl {
        // Start listening for display changes
        mDisplayImeController.startMonitorDisplays();

        // Setup the shell organizer
        mShellTaskOrganizer.addListenerForType(
                mFullscreenTaskListener, TASK_LISTENER_TYPE_FULLSCREEN);
        mStartingSurfaceOptional.ifPresent(mShellTaskOrganizer::initStartingSurface);
        // Register the shell organizer
        mShellTaskOrganizer.initStartingWindow(mStartingWindow);
        mShellTaskOrganizer.registerOrganizer();

        mAppPairsOptional.ifPresent(AppPairsController::onOrganizerRegistered);
+10 −10
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.sizecompatui.SizeCompatUIController;
import com.android.wm.shell.startingsurface.StartingSurface;
import com.android.wm.shell.startingsurface.StartingWindowController;

import java.io.PrintWriter;
import java.util.ArrayList;
@@ -133,7 +133,7 @@ public class ShellTaskOrganizer extends TaskOrganizer {
    private final ArraySet<LocusIdListener> mLocusIdListeners = new ArraySet<>();

    private final Object mLock = new Object();
    private StartingSurface mStartingSurface;
    private StartingWindowController mStartingWindow;

    /**
     * In charge of showing size compat UI. Can be {@code null} if device doesn't support size
@@ -184,8 +184,8 @@ public class ShellTaskOrganizer extends TaskOrganizer {
    /**
     * @hide
     */
    public void initStartingSurface(StartingSurface startingSurface) {
        mStartingSurface = startingSurface;
    public void initStartingWindow(StartingWindowController startingWindow) {
        mStartingWindow = startingWindow;
    }

    /**
@@ -302,23 +302,23 @@ public class ShellTaskOrganizer extends TaskOrganizer {

    @Override
    public void addStartingWindow(StartingWindowInfo info, IBinder appToken) {
        if (mStartingSurface != null) {
            mStartingSurface.addStartingWindow(info, appToken);
        if (mStartingWindow != null) {
            mStartingWindow.addStartingWindow(info, appToken);
        }
    }

    @Override
    public void removeStartingWindow(int taskId, SurfaceControl leash, Rect frame,
            boolean playRevealAnimation) {
        if (mStartingSurface != null) {
            mStartingSurface.removeStartingWindow(taskId, leash, frame, playRevealAnimation);
        if (mStartingWindow != null) {
            mStartingWindow.removeStartingWindow(taskId, leash, frame, playRevealAnimation);
        }
    }

    @Override
    public void copySplashScreenView(int taskId) {
        if (mStartingSurface != null) {
            mStartingSurface.copySplashScreenView(taskId);
        if (mStartingWindow != null) {
            mStartingWindow.copySplashScreenView(taskId);
        }
    }

+4 −5
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ public class DragAndDropPolicy {
            mStarter.startShortcut(packageName, id, stage, position, opts, user);
        } else {
            mStarter.startIntent(intent.getParcelableExtra(EXTRA_PENDING_INTENT),
                    mContext, null, stage, position, opts);
                    null, stage, position, opts);
        }
    }

@@ -295,7 +295,7 @@ public class DragAndDropPolicy {
                @Nullable Bundle options);
        void startShortcut(String packageName, String shortcutId, @StageType int stage,
                @StagePosition int position, @Nullable Bundle options, UserHandle user);
        void startIntent(PendingIntent intent, Context context, Intent fillInIntent,
        void startIntent(PendingIntent intent, Intent fillInIntent,
                @StageType int stage, @StagePosition int position,
                @Nullable Bundle options);
        void enterSplitScreen(int taskId, boolean leftOrTop);
@@ -337,9 +337,8 @@ public class DragAndDropPolicy {
        }

        @Override
        public void startIntent(PendingIntent intent, Context context,
                @Nullable Intent fillInIntent, int stage, int position,
                @Nullable Bundle options) {
        public void startIntent(PendingIntent intent, @Nullable Intent fillInIntent, int stage,
                int position, @Nullable Bundle options) {
            try {
                intent.send(mContext, 0, fillInIntent, null, null, null, options);
            } catch (PendingIntent.CanceledException e) {
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.wm.shell.onehanded;

/**
 * Interface that is exposed to remote callers to manipulate the OneHanded feature.
 */
interface IOneHanded {

    /**
     * Enters one handed mode.
     */
    oneway void startOneHanded() = 1;

    /**
     * Exits one handed mode.
     */
    oneway void stopOneHanded() = 2;
}
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,14 @@ import com.android.wm.shell.onehanded.OneHandedGestureHandler.OneHandedGestureEv
 */
@ExternalThread
public interface OneHanded {

    /**
     * Returns a binder that can be passed to an external process to manipulate OneHanded.
     */
    default IOneHanded createExternalInterface() {
        return null;
    }

    /**
     * Return one handed settings enabled or not.
     */
Loading