From a5877307d159f4773fb26146e798b98540e7ac17 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Wed, 29 Apr 2020 12:12:44 -0700 Subject: [PATCH] Dump RecentsOrientationState for bug reports Bug: 154951045 Test: New output shows up when running "adb shell dumpsys activity com.google.android.apps.nexuslauncher.NexusLauncherActivity [--all]" Change-Id: I5e9ace7d370eb0e9d278d7d9f7f9156674ca1a50 --- .../uioverrides/QuickstepLauncher.java | 11 +++++++++++ .../quickstep/util/RecentsOrientedState.java | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 87ca2b688a..634eb4980d 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -56,6 +56,8 @@ import com.android.quickstep.SysUINavigationMode.Mode; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.RecentsView; +import java.io.FileDescriptor; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.stream.Stream; @@ -227,4 +229,13 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { mActivity.getStateManager().setCurrentUserControlledAnimation(animController); } } + + @Override + public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { + super.dump(prefix, fd, writer, args); + RecentsView recentsView = getOverviewPanel(); + writer.println("\nQuickstepLauncher:"); + writer.println(prefix + "\tmOrientationState: " + (recentsView == null ? "recentsNull" : + recentsView.getPagedViewOrientedState())); + } } diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java index 74daeca33f..97424fba53 100644 --- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java +++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java @@ -44,6 +44,7 @@ import android.view.OrientationEventListener; import android.view.Surface; import androidx.annotation.IntDef; +import androidx.annotation.NonNull; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Utilities; @@ -64,7 +65,7 @@ import java.util.function.IntConsumer; public final class RecentsOrientedState implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = "RecentsOrientedState"; - private static final boolean DEBUG = false; + private static final boolean DEBUG = true; private static final String FIXED_ROTATION_TRANSFORM_SETTING_NAME = "fixed_rotation_transform"; @@ -440,4 +441,19 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre return Settings.Global.getInt( context.getContentResolver(), FIXED_ROTATION_TRANSFORM_SETTING_NAME, 1) == 1; } + + @NonNull + @Override + public String toString() { + boolean systemRotationOn = (mFlags & FLAG_SYSTEM_ROTATION_ALLOWED) != 0; + return "[" + + "mDisplayRotation=" + mDisplayRotation + + " mTouchRotation=" + mTouchRotation + + " mLauncherRotation=" + mLauncherRotation + + " mHomeRotation=" + isHomeRotationAllowed() + + " mSystemRotation=" + systemRotationOn + + " mFlags=" + mFlags + + " mOrientationHandler=" + mOrientationHandler + + "]"; + } }