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

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

Snap for 9905614 from 49a00c31 to tm-qpr3-release

Change-Id: I3c2eda3161574fa6329aab7eb2d7abc524b380b4
parents 65ffbd46 49a00c31
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -469,6 +469,18 @@
      "group": "WM_DEBUG_TASKS",
      "at": "com\/android\/server\/wm\/RecentTasks.java"
    },
    "-1643780158": {
      "message": "Saving original orientation before camera compat, last orientation is %d",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/DisplayRotationCompatPolicy.java"
    },
    "-1639406696": {
      "message": "NOSENSOR override detected",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/DisplayRotationReversionController.java"
    },
    "-1638958146": {
      "message": "Removing activity %s from task=%s adding to task=%s Callers=%s",
      "level": "INFO",
@@ -751,6 +763,12 @@
      "group": "WM_DEBUG_IME",
      "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
    },
    "-1397175017": {
      "message": "Other orientation overrides are in place: not reverting",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/DisplayRotationReversionController.java"
    },
    "-1394745488": {
      "message": "ControlAdapter onAnimationCancelled mSource: %s mControlTarget: %s",
      "level": "INFO",
@@ -1669,6 +1687,12 @@
      "group": "WM_DEBUG_WINDOW_TRANSITIONS",
      "at": "com\/android\/server\/wm\/Transition.java"
    },
    "-529187878": {
      "message": "Reverting orientation after camera compat force rotation",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/DisplayRotationCompatPolicy.java"
    },
    "-521613870": {
      "message": "App died during pause, not stopping: %s",
      "level": "VERBOSE",
@@ -2365,6 +2389,12 @@
      "group": "WM_DEBUG_FOCUS_LIGHT",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "138097009": {
      "message": "NOSENSOR override is absent: reverting",
      "level": "VERBOSE",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/DisplayRotationReversionController.java"
    },
    "140319294": {
      "message": "IME target changed within ActivityRecord",
      "level": "DEBUG",
+11 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@

package com.android.systemui.shade;

import static android.view.WindowInsets.Type.ime;

import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_QS_EXPAND_COLLAPSE;
import static com.android.systemui.classifier.Classifier.QS_COLLAPSE;
import static com.android.systemui.shade.NotificationPanelViewController.COUNTER_PANEL_OPEN_QS;
@@ -450,9 +452,17 @@ public class QuickSettingsController {
        return (mQs != null ? mQs.getHeader().getHeight() : 0) + mPeekHeight;
    }

    private boolean isRemoteInputActiveWithKeyboardUp() {
        //TODO(b/227115380) remove the isVisible(ime()) check once isRemoteInputActive is fixed.
        // The check for keyboard visibility is a temporary workaround that allows QS to expand
        // even when isRemoteInputActive is mistakenly returning true.
        return mRemoteInputManager.isRemoteInputActive()
                && mPanelView.getRootWindowInsets().isVisible(ime());
    }

    public boolean isExpansionEnabled() {
        return mExpansionEnabledPolicy && mExpansionEnabledAmbient
                && !mRemoteInputManager.isRemoteInputActive();
            && !isRemoteInputActiveWithKeyboardUp();
    }

    public float getTransitioningToFullShadeProgress() {
+2 −0
Original line number Diff line number Diff line
@@ -7867,6 +7867,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

        mAtmService.getTaskChangeNotificationController().notifyActivityRequestedOrientationChanged(
                task.mTaskId, requestedOrientation);

        mDisplayContent.getDisplayRotation().onSetRequestedOrientation();
    }

    /*
+12 −0
Original line number Diff line number Diff line
@@ -746,6 +746,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     */
    DisplayWindowPolicyControllerHelper mDwpcHelper;

    private final DisplayRotationReversionController mRotationReversionController;

    private final Consumer<WindowState> mUpdateWindowsForAnimator = w -> {
        WindowStateAnimator winAnimator = w.mWinAnimator;
        final ActivityRecord activity = w.mActivityRecord;
@@ -1170,6 +1172,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                mWmService.mLetterboxConfiguration.isCameraCompatTreatmentEnabled(
                            /* checkDeviceConfig */ false)
                        ? new DisplayRotationCompatPolicy(this) : null;
        mRotationReversionController = new DisplayRotationReversionController(this);

        mInputMonitor = new InputMonitor(mWmService, this);
        mInsetsPolicy = new InsetsPolicy(mInsetsStateController, this);
@@ -1283,6 +1286,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                .show(mOverlayLayer);
    }

    DisplayRotationReversionController getRotationReversionController() {
        return mRotationReversionController;
    }

    boolean isReady() {
        // The display is ready when the system and the individual display are both ready.
        return mWmService.mDisplayReady && mDisplayReady;
@@ -1665,9 +1672,14 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    }

    private boolean updateOrientation(boolean forceUpdate) {
        final WindowContainer prevOrientationSource = mLastOrientationSource;
        final int orientation = getOrientation();
        // The last orientation source is valid only after getOrientation.
        final WindowContainer orientationSource = getLastOrientationSource();
        if (orientationSource != prevOrientationSource
                && mRotationReversionController.isRotationReversionEnabled()) {
            mRotationReversionController.updateForNoSensorOverride();
        }
        final ActivityRecord r =
                orientationSource != null ? orientationSource.asActivityRecord() : null;
        if (r != null) {
+56 −6
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ import static com.android.server.wm.DisplayRotationProto.IS_FIXED_TO_USER_ROTATI
import static com.android.server.wm.DisplayRotationProto.LAST_ORIENTATION;
import static com.android.server.wm.DisplayRotationProto.ROTATION;
import static com.android.server.wm.DisplayRotationProto.USER_ROTATION;
import static com.android.server.wm.DisplayRotationReversionController.REVERSION_TYPE_CAMERA_COMPAT;
import static com.android.server.wm.DisplayRotationReversionController.REVERSION_TYPE_HALF_FOLD;
import static com.android.server.wm.DisplayRotationReversionController.REVERSION_TYPE_NOSENSOR;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_ACTIVE;
@@ -97,6 +100,8 @@ public class DisplayRotation {
    // config changes and unexpected jumps while folding the device to closed state.
    private static final int FOLDING_RECOMPUTE_CONFIG_DELAY_MS = 800;

    private static final int ROTATION_UNDEFINED = -1;

    private static class RotationAnimationPair {
        @AnimRes
        int mEnter;
@@ -104,6 +109,9 @@ public class DisplayRotation {
        int mExit;
    }

    @Nullable
    final FoldController mFoldController;

    private final WindowManagerService mService;
    private final DisplayContent mDisplayContent;
    private final DisplayPolicy mDisplayPolicy;
@@ -125,8 +133,6 @@ public class DisplayRotation {
    private OrientationListener mOrientationListener;
    private StatusBarManagerInternal mStatusBarManagerInternal;
    private SettingsObserver mSettingsObserver;
    @Nullable
    private FoldController mFoldController;
    @NonNull
    private final DeviceStateController mDeviceStateController;

@@ -184,6 +190,12 @@ public class DisplayRotation {
     */
    private int mShowRotationSuggestions;

    /**
     * The most recent {@link Surface.Rotation} choice shown to the user for confirmation, or
     * {@link #ROTATION_UNDEFINED}
     */
    private int mRotationChoiceShownToUserForConfirmation = ROTATION_UNDEFINED;

    private static final int ALLOW_ALL_ROTATIONS_UNDEFINED = -1;
    private static final int ALLOW_ALL_ROTATIONS_DISABLED = 0;
    private static final int ALLOW_ALL_ROTATIONS_ENABLED = 1;
@@ -271,7 +283,11 @@ public class DisplayRotation {
            if (mSupportAutoRotation && mContext.getResources().getBoolean(
                    R.bool.config_windowManagerHalfFoldAutoRotateOverride)) {
                mFoldController = new FoldController();
            } else {
                mFoldController = null;
            }
        } else {
            mFoldController = null;
        }
    }

@@ -329,6 +345,11 @@ public class DisplayRotation {
        return -1;
    }

    @VisibleForTesting
    boolean useDefaultSettingsProvider() {
        return isDefaultDisplay;
    }

    /**
     * Updates the configuration which may have different values depending on current user, e.g.
     * runtime resource overlay.
@@ -861,7 +882,8 @@ public class DisplayRotation {

    @VisibleForTesting
    void setUserRotation(int userRotationMode, int userRotation) {
        if (isDefaultDisplay) {
        mRotationChoiceShownToUserForConfirmation = ROTATION_UNDEFINED;
        if (useDefaultSettingsProvider()) {
            // We'll be notified via settings listener, so we don't need to update internal values.
            final ContentResolver res = mContext.getContentResolver();
            final int accelerometerRotation =
@@ -1568,6 +1590,17 @@ public class DisplayRotation {
        return shouldUpdateRotation;
    }

    /**
     * Called from {@link ActivityRecord#setRequestedOrientation(int)}
     */
    void onSetRequestedOrientation() {
        if (mCompatPolicyForImmersiveApps == null
                || mRotationChoiceShownToUserForConfirmation == ROTATION_UNDEFINED) {
            return;
        }
        mOrientationListener.onProposedRotationChanged(mRotationChoiceShownToUserForConfirmation);
    }

    void dump(String prefix, PrintWriter pw) {
        pw.println(prefix + "DisplayRotation");
        pw.println(prefix + "  mCurrentAppOrientation="
@@ -1794,7 +1827,7 @@ public class DisplayRotation {
                return false;
            }
            if (mDeviceState == DeviceStateController.DeviceState.HALF_FOLDED) {
                return !(isTabletop ^ mTabletopRotations.contains(mRotation));
                return isTabletop == mTabletopRotations.contains(mRotation);
            }
            return true;
        }
@@ -1818,7 +1851,8 @@ public class DisplayRotation {
            return mDeviceState == DeviceStateController.DeviceState.OPEN
                    && !mShouldIgnoreSensorRotation // Ignore if the hinge angle still moving
                    && mInHalfFoldTransition
                    && mHalfFoldSavedRotation != -1 // Ignore if we've already reverted.
                    && mDisplayContent.getRotationReversionController().isOverrideActive(
                        REVERSION_TYPE_HALF_FOLD)
                    && mUserRotationMode
                        == WindowManagerPolicy.USER_ROTATION_LOCKED; // Ignore if we're unlocked.
        }
@@ -1826,6 +1860,8 @@ public class DisplayRotation {
        int revertOverriddenRotation() {
            int savedRotation = mHalfFoldSavedRotation;
            mHalfFoldSavedRotation = -1;
            mDisplayContent.getRotationReversionController()
                    .revertOverride(REVERSION_TYPE_HALF_FOLD);
            mInHalfFoldTransition = false;
            return savedRotation;
        }
@@ -1845,6 +1881,8 @@ public class DisplayRotation {
                    && mDeviceState != DeviceStateController.DeviceState.HALF_FOLDED) {
                // The device has transitioned to HALF_FOLDED state: save the current rotation and
                // update the device rotation.
                mDisplayContent.getRotationReversionController().beforeOverrideApplied(
                        REVERSION_TYPE_HALF_FOLD);
                mHalfFoldSavedRotation = mRotation;
                mDeviceState = newState;
                // Now mFoldState is set to HALF_FOLDED, the overrideFrozenRotation function will
@@ -1966,9 +2004,11 @@ public class DisplayRotation {
            // Send interaction power boost to improve redraw performance.
            mService.mPowerManagerInternal.setPowerBoost(Boost.INTERACTION, 0);
            if (isRotationChoiceAllowed(rotation)) {
                mRotationChoiceShownToUserForConfirmation = rotation;
                final boolean isValid = isValidRotationChoice(rotation);
                sendProposedRotationChangeToStatusBarInternal(rotation, isValid);
            } else {
                mRotationChoiceShownToUserForConfirmation = ROTATION_UNDEFINED;
                mService.updateRotation(false /* alwaysSendConfiguration */,
                        false /* forceRelayout */);
            }
@@ -2047,6 +2087,8 @@ public class DisplayRotation {
            final int mHalfFoldSavedRotation;
            final boolean mInHalfFoldTransition;
            final DeviceStateController.DeviceState mDeviceState;
            @Nullable final boolean[] mRotationReversionSlots;

            @Nullable final String mDisplayRotationCompatPolicySummary;

            Record(DisplayRotation dr, int fromRotation, int toRotation) {
@@ -2087,6 +2129,8 @@ public class DisplayRotation {
                        ? null
                        : dc.mDisplayRotationCompatPolicy
                                .getSummaryForDisplayRotationHistoryRecord();
                mRotationReversionSlots =
                        dr.mDisplayContent.getRotationReversionController().getSlotsCopy();
            }

            void dump(String prefix, PrintWriter pw) {
@@ -2112,6 +2156,12 @@ public class DisplayRotation {
                if (mDisplayRotationCompatPolicySummary != null) {
                    pw.println(prefix + mDisplayRotationCompatPolicySummary);
                }
                if (mRotationReversionSlots != null) {
                    pw.println(prefix + " reversionSlots= NOSENSOR "
                            + mRotationReversionSlots[REVERSION_TYPE_NOSENSOR] + ", CAMERA "
                            + mRotationReversionSlots[REVERSION_TYPE_CAMERA_COMPAT] + " HALF_FOLD "
                            + mRotationReversionSlots[REVERSION_TYPE_HALF_FOLD]);
                }
            }
        }

Loading