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

Commit 7bea0069 authored by Robert Horvath's avatar Robert Horvath Committed by Android (Google) Code Review
Browse files

Merge "Dismiss TV PiP when app op OP_PICTURE_IN_PICTURE is revoked" into tm-dev

parents e87d18f7 48e24a84
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipAppOpsListener;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipSnapAlgorithm;
@@ -63,6 +64,7 @@ public abstract class TvPipModule {
            Context context,
            Context context,
            TvPipBoundsState tvPipBoundsState,
            TvPipBoundsState tvPipBoundsState,
            TvPipBoundsAlgorithm tvPipBoundsAlgorithm,
            TvPipBoundsAlgorithm tvPipBoundsAlgorithm,
            PipAppOpsListener pipAppOpsListener,
            PipTaskOrganizer pipTaskOrganizer,
            PipTaskOrganizer pipTaskOrganizer,
            TvPipMenuController tvPipMenuController,
            TvPipMenuController tvPipMenuController,
            PipMediaController pipMediaController,
            PipMediaController pipMediaController,
@@ -79,6 +81,7 @@ public abstract class TvPipModule {
                        context,
                        context,
                        tvPipBoundsState,
                        tvPipBoundsState,
                        tvPipBoundsAlgorithm,
                        tvPipBoundsAlgorithm,
                        pipAppOpsListener,
                        pipTaskOrganizer,
                        pipTaskOrganizer,
                        pipTransitionController,
                        pipTransitionController,
                        tvPipMenuController,
                        tvPipMenuController,
@@ -185,4 +188,12 @@ public abstract class TvPipModule {
    static PipParamsChangedForwarder providePipParamsChangedForwarder() {
    static PipParamsChangedForwarder providePipParamsChangedForwarder() {
        return new PipParamsChangedForwarder();
        return new PipParamsChangedForwarder();
    }
    }

    @WMSingleton
    @Provides
    static PipAppOpsListener providePipAppOpsListener(Context context,
            PipTaskOrganizer pipTaskOrganizer,
            @ShellMainThread ShellExecutor mainExecutor) {
        return new PipAppOpsListener(context, pipTaskOrganizer::removePip, mainExecutor);
    }
}
}
+0 −9
Original line number Original line Diff line number Diff line
@@ -78,7 +78,6 @@ import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.phone.PipAppOpsListener;
import com.android.wm.shell.pip.phone.PipTouchHandler;
import com.android.wm.shell.pip.phone.PipTouchHandler;
import com.android.wm.shell.recents.RecentTasks;
import com.android.wm.shell.recents.RecentTasks;
import com.android.wm.shell.recents.RecentTasksController;
import com.android.wm.shell.recents.RecentTasksController;
@@ -435,14 +434,6 @@ public abstract class WMShellBaseModule {
        return new FloatingContentCoordinator();
        return new FloatingContentCoordinator();
    }
    }


    @WMSingleton
    @Provides
    static PipAppOpsListener providePipAppOpsListener(Context context,
            PipTouchHandler pipTouchHandler,
            @ShellMainThread ShellExecutor mainExecutor) {
        return new PipAppOpsListener(context, pipTouchHandler.getMotionHelper(), mainExecutor);
    }

    // Needs handler for registering broadcast receivers
    // Needs handler for registering broadcast receivers
    @WMSingleton
    @WMSingleton
    @Provides
    @Provides
+9 −1
Original line number Original line Diff line number Diff line
@@ -51,6 +51,7 @@ import com.android.wm.shell.legacysplitscreen.LegacySplitScreenController;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipAppOpsListener;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipMediaController;
@@ -63,7 +64,6 @@ import com.android.wm.shell.pip.PipTransitionController;
import com.android.wm.shell.pip.PipTransitionState;
import com.android.wm.shell.pip.PipTransitionState;
import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.phone.PhonePipMenuController;
import com.android.wm.shell.pip.phone.PhonePipMenuController;
import com.android.wm.shell.pip.phone.PipAppOpsListener;
import com.android.wm.shell.pip.phone.PipController;
import com.android.wm.shell.pip.phone.PipController;
import com.android.wm.shell.pip.phone.PipMotionHelper;
import com.android.wm.shell.pip.phone.PipMotionHelper;
import com.android.wm.shell.pip.phone.PipTouchHandler;
import com.android.wm.shell.pip.phone.PipTouchHandler;
@@ -323,6 +323,14 @@ public class WMShellModule {
                pipSurfaceTransactionHelper, splitScreenOptional);
                pipSurfaceTransactionHelper, splitScreenOptional);
    }
    }


    @WMSingleton
    @Provides
    static PipAppOpsListener providePipAppOpsListener(Context context,
            PipTouchHandler pipTouchHandler,
            @ShellMainThread ShellExecutor mainExecutor) {
        return new PipAppOpsListener(context, pipTouchHandler.getMotionHelper(), mainExecutor);
    }

    @WMSingleton
    @WMSingleton
    @Provides
    @Provides
    static PipMotionHelper providePipMotionHelper(Context context,
    static PipMotionHelper providePipMotionHelper(Context context,
+1 −2
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.wm.shell.pip.phone;
package com.android.wm.shell.pip;


import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.OP_PICTURE_IN_PICTURE;
import static android.app.AppOpsManager.OP_PICTURE_IN_PICTURE;
@@ -28,7 +28,6 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Pair;
import android.util.Pair;


import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.pip.PipUtils;


public class PipAppOpsListener {
public class PipAppOpsListener {
    private static final String TAG = PipAppOpsListener.class.getSimpleName();
    private static final String TAG = PipAppOpsListener.class.getSimpleName();
+1 −0
Original line number Original line Diff line number Diff line
@@ -76,6 +76,7 @@ import com.android.wm.shell.pip.IPipAnimationListener;
import com.android.wm.shell.pip.PinnedStackListenerForwarder;
import com.android.wm.shell.pip.PinnedStackListenerForwarder;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipAppOpsListener;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipMediaController;
Loading