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

Commit b9ec9319 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Add fixed_rotation_transform to home settings

This sets the feature flag on launcher side
and also updates the setting in Settings.Global
Launcher DOES NOT listen to the Settings.Global
change from adb anymore. This should take
preference over setting it from command line.

Also fix a related swipe to home animation bug
that happened w/ merge conflict.

Fixes: 150260456
Test: Set and unset, visually verified behavior.
Tested w/ autorotate on and off.
Checked Settings.Global value correctly updated
via "adb shell settings get global
fixed_rotation_transform"
TODO: Update tests to reflect this new
default-on fixed rotation behavior.

Change-Id: Id95f006eb1e92a59e24b05567298fd21b1409b13
parent 31ff98e1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@
    <uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

    <!-- TODO(b/150802536): Enabled only for ENABLE_FIXED_ROTATION_TRANSFORM feature flag -->
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
    
    <!--
    Permissions required for read/write access to the workspace data. These permission name
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

    
    <application
        android:backupAgent="com.android.launcher3.LauncherBackupAgent"
        android:fullBackupOnly="true"
+4 −4
Original line number Diff line number Diff line
@@ -482,10 +482,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
            public void onUpdate(RectF currentRect, float progress) {
                homeAnim.setPlayFraction(progress);

                mTransformParams.setProgress(
                        Utilities.mapRange(progress, startTransformProgress, endTransformProgress))
                        .setCurrentRect(currentRect)
                        .setTargetAlpha(getWindowAlpha(progress));
                rotatedRect.set(currentRect);
                if (isFloatingIconView) {
                    RotationHelper.mapRectFromNormalOrientation(rotatedRect,
@@ -493,6 +489,10 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
                    mTransformParams.setCornerRadius(endRadius * progress + startRadius
                        * (1f - progress));
                }
                mTransformParams.setProgress(
                    Utilities.mapRange(progress, startTransformProgress, endTransformProgress))
                    .setCurrentRect(rotatedRect)
                    .setTargetAlpha(getWindowAlpha(progress));
                mAppWindowAnimationHelper.applyTransform(mTransformParams);

                if (isFloatingIconView) {
+4 −2
Original line number Diff line number Diff line
@@ -502,8 +502,10 @@ public class TouchInteractionService extends Service implements PluginListener<O
                        ? newBaseConsumer(previousGestureState, newGestureState, event)
                        : mResetGestureInputConsumer;
        // TODO(b/149880412): 2 button landscape mode is wrecked. Fixit!
        if (mDeviceState.isFullyGesturalNavMode()) {
        if (mDeviceState.isGesturalNavMode()) {
            handleOrientationSetup(base);
        }
        if (mDeviceState.isFullyGesturalNavMode()) {
            if (mDeviceState.canTriggerAssistantAction(event)) {
                base = new AssistantInputConsumer(this, newGestureState, base, mInputMonitorCompat);
            }
@@ -548,7 +550,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
    }

    private void handleOrientationSetup(InputConsumer baseInputConsumer) {
        if (!PagedView.sFlagForcedRotation) {
        if (!FeatureFlags.ENABLE_FIXED_ROTATION_TRANSFORM.get()) {
            return;
        }
        mDeviceState.enableMultipleRegions(baseInputConsumer instanceof OtherActivityInputConsumer);
+2 −2
Original line number Diff line number Diff line
@@ -42,13 +42,13 @@ import com.android.launcher3.Hotseat;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager.StateListener;
import com.android.launcher3.PagedView;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.appprediction.PredictionUiStateManager;
import com.android.launcher3.appprediction.PredictionUiStateManager.Client;
import com.android.launcher3.states.RotationHelper;
import com.android.launcher3.uioverrides.BackgroundBlurController;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.TraceHelper;
import com.android.launcher3.views.ScrimView;
@@ -287,7 +287,7 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL

    @Override
    protected boolean supportsVerticalLandscape() {
        return PagedView.sFlagForcedRotation;
        return FeatureFlags.ENABLE_FIXED_ROTATION_TRANSFORM.get();
    }

    @Override
Loading