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

Commit fd41d0af authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23822907',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23822907', 'googleplex-android-review.googlesource.com/23831003', 'googleplex-android-review.googlesource.com/23854042', 'googleplex-android-review.googlesource.com/23848628', 'googleplex-android-review.googlesource.com/23875866', 'googleplex-android-review.googlesource.com/23845585'] into udc-release.

Change-Id: Idd03aee5c8b649c2163154151faf6e60492354a3
parents e64a7d3f fbf9c585
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -339,20 +339,37 @@ public class PipTransition extends PipTransitionController {
        }
        // This means an expand happened before enter-pip finished and we are now "merging" a
        // no-op transition that happens to match our exit-pip.
        // Or that the keyguard is up and preventing the transition from applying, in which case we
        // want to manually reset pip. (b/283783868)
        boolean cancelled = false;
        if (mPipAnimationController.getCurrentAnimator() != null) {
            mPipAnimationController.getCurrentAnimator().cancel();
            mPipAnimationController.resetAnimatorState();
            cancelled = true;
        }

        // Unset exitTransition AFTER cancel so that finishResize knows we are merging.
        mExitTransition = null;
        if (!cancelled || aborted) return;
        if (!cancelled) return;
        final ActivityManager.RunningTaskInfo taskInfo = mPipOrganizer.getTaskInfo();
        if (taskInfo != null) {
            if (aborted) {
                // keyguard case - the transition got aborted, so we want to reset state and
                // windowing mode before reapplying the resize transaction
                sendOnPipTransitionFinished(TRANSITION_DIRECTION_LEAVE_PIP);
                mPipOrganizer.onExitPipFinished(taskInfo);

                WindowContainerTransaction wct = new WindowContainerTransaction();
                mPipOrganizer.applyWindowingModeChangeOnExit(wct, TRANSITION_DIRECTION_LEAVE_PIP);
                wct.setBounds(taskInfo.token, null);
                mPipOrganizer.applyFinishBoundsResize(wct, TRANSITION_DIRECTION_LEAVE_PIP, false);
            } else {
                // merge case
                startExpandAnimation(taskInfo, mPipOrganizer.getSurfaceControl(),
                        mPipBoundsState.getBounds(), mPipBoundsState.getBounds(),
                        new Rect(mExitDestinationBounds), Surface.ROTATION_0, null /* startT */);
            }
        }
        mExitDestinationBounds.setEmpty();
        mCurrentPipTaskToken = null;
    }
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.wm.shell.startingsurface;

import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.graphics.Color.WHITE;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
@@ -77,6 +78,13 @@ public class TaskSnapshotWindow {
            @NonNull Runnable clearWindowHandler) {
        final ActivityManager.RunningTaskInfo runningTaskInfo = info.taskInfo;
        final int taskId = runningTaskInfo.taskId;

        // if we're in PIP we don't want to create the snapshot
        if (runningTaskInfo.getWindowingMode() == WINDOWING_MODE_PINNED) {
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_STARTING_WINDOW,
                    "did not create taskSnapshot due to being in PIP");
            return null;
        }
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_STARTING_WINDOW,
                "create taskSnapshot surface for task: %d", taskId);

+0 −1
Original line number Diff line number Diff line
@@ -164,7 +164,6 @@
            />
        <ImageView
            android:id="@+id/media_output_item_end_click_icon"
            android:src="@drawable/media_output_status_edit_session"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:focusable="false"
+24 −31
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.settingslib.media.MediaDevice.SelectionBehavior.SELECT
import static com.android.settingslib.media.MediaDevice.SelectionBehavior.SELECTION_BEHAVIOR_NONE;
import static com.android.settingslib.media.MediaDevice.SelectionBehavior.SELECTION_BEHAVIOR_TRANSFER;

import android.annotation.DrawableRes;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.AnimatedVectorDrawable;
@@ -181,27 +182,23 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                                    mController.getSelectedMediaDevice(), device)));
                    boolean isHost = device.isHostForOngoingSession()
                            && isActiveWithOngoingSession;
                    if (isHost) {
                    if (isActiveWithOngoingSession) {
                        mCurrentActivePosition = position;
                        updateTitleIcon(R.drawable.media_output_icon_volume,
                                mController.getColorItemContent());
                        mSubTitleText.setText(device.getSubtextString());
                        updateTwoLineLayoutContentAlpha(DEVICE_CONNECTED_ALPHA);
                        updateEndClickAreaAsSessionEditing(device);
                        updateEndClickAreaAsSessionEditing(device,
                                isHost ? R.drawable.media_output_status_edit_session
                                        : R.drawable.ic_sound_bars_anim);
                        setTwoLineLayout(device, null /* title */, true /* bFocused */,
                                true /* showSeekBar */, false /* showProgressBar */,
                                true /* showSubtitle */, false /* showStatus */,
                                true /* showEndTouchArea */, false /* isFakeActive */);
                        initSeekbar(device, isCurrentSeekbarInvisible);
                    } else {
                        if (isActiveWithOngoingSession) {
                            //Selected device which has ongoing session, disable seekbar since we
                            //only allow volume control on Host
                        if (currentlyConnected) {
                            mCurrentActivePosition = position;
                        }
                        boolean showSeekbar =
                                (!device.hasOngoingSession() && currentlyConnected);
                        if (showSeekbar) {
                            updateTitleIcon(R.drawable.media_output_icon_volume,
                                    mController.getColorItemContent());
                            initSeekbar(device, isCurrentSeekbarInvisible);
@@ -222,10 +219,10 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                                updateClickActionBasedOnSelectionBehavior(device)
                                        ? DEVICE_CONNECTED_ALPHA : DEVICE_DISCONNECTED_ALPHA);
                        setTwoLineLayout(device, currentlyConnected /* bFocused */,
                                showSeekbar  /* showSeekBar */,
                                currentlyConnected  /* showSeekBar */,
                                false /* showProgressBar */, true /* showSubtitle */,
                                deviceStatusIcon != null /* showStatus */,
                                isActiveWithOngoingSession /* isFakeActive */);
                                false /* isFakeActive */);
                    }
                } else if (device.getState() == MediaDeviceState.STATE_CONNECTING_FAILED) {
                    setUpDeviceIcon(device);
@@ -267,25 +264,16 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
                        setSingleLineLayout(getItemTitle(device));
                    } else if (device.hasOngoingSession()) {
                        mCurrentActivePosition = position;
                        if (device.isHostForOngoingSession()) {
                        updateTitleIcon(R.drawable.media_output_icon_volume,
                                mController.getColorItemContent());
                            updateEndClickAreaAsSessionEditing(device);
                        updateEndClickAreaAsSessionEditing(device, device.isHostForOngoingSession()
                                ? R.drawable.media_output_status_edit_session
                                : R.drawable.ic_sound_bars_anim);
                        mEndClickIcon.setVisibility(View.VISIBLE);
                        setSingleLineLayout(getItemTitle(device), true /* showSeekBar */,
                                false /* showProgressBar */, false /* showCheckBox */,
                                true /* showEndTouchArea */);
                        initSeekbar(device, isCurrentSeekbarInvisible);
                        } else {
                            updateDeviceStatusIcon(mContext.getDrawable(
                                    R.drawable.ic_sound_bars_anim));
                            mStatusIcon.setVisibility(View.VISIBLE);
                            updateSingleLineLayoutContentAlpha(
                                    updateClickActionBasedOnSelectionBehavior(device)
                                            ? DEVICE_CONNECTED_ALPHA : DEVICE_DISCONNECTED_ALPHA);
                            setSingleLineLayout(getItemTitle(device));
                            initFakeActiveDevice();
                        }
                    } else if (mController.isCurrentConnectedDeviceRemote()
                            && !mController.getSelectableMediaDevice().isEmpty()) {
                        //If device is connected and there's other selectable devices, layout as
@@ -362,7 +350,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
            mStatusIcon.setAlpha(alphaValue);
        }

        private void updateEndClickAreaAsSessionEditing(MediaDevice device) {
        private void updateEndClickAreaAsSessionEditing(MediaDevice device, @DrawableRes int id) {
            mEndClickIcon.setOnClickListener(null);
            mEndTouchArea.setOnClickListener(null);
            updateEndClickAreaColor(mController.getColorSeekbarProgress());
@@ -371,6 +359,11 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
            mEndClickIcon.setOnClickListener(
                    v -> mController.tryToLaunchInAppRoutingIntent(device.getId(), v));
            mEndTouchArea.setOnClickListener(v -> mEndClickIcon.performClick());
            Drawable drawable = mContext.getDrawable(id);
            mEndClickIcon.setImageDrawable(drawable);
            if (drawable instanceof AnimatedVectorDrawable) {
                ((AnimatedVectorDrawable) drawable).start();
            }
        }

        public void updateEndClickAreaColor(int color) {
+4 −2
Original line number Diff line number Diff line
@@ -240,8 +240,10 @@ public class StatusBarWindowController {
                    Insets.of(0, safeTouchRegionHeight, 0, 0));
        }
        lp.providedInsets = new InsetsFrameProvider[] {
                new InsetsFrameProvider(mInsetsSourceOwner, 0, statusBars()),
                new InsetsFrameProvider(mInsetsSourceOwner, 0, tappableElement()),
                new InsetsFrameProvider(mInsetsSourceOwner, 0, statusBars())
                        .setInsetsSize(Insets.of(0, height, 0, 0)),
                new InsetsFrameProvider(mInsetsSourceOwner, 0, tappableElement())
                        .setInsetsSize(Insets.of(0, height, 0, 0)),
                gestureInsetsProvider
        };
        return lp;
Loading