diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 26eca5bf3b..5a81b2fc0a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -16,6 +16,7 @@ package com.android.launcher3.taskbar; import static android.content.pm.PackageManager.FEATURE_PC; +import static android.os.Trace.TRACE_TAG_APP; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; @@ -46,6 +47,7 @@ import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.Process; import android.os.SystemProperties; +import android.os.Trace; import android.provider.Settings; import android.util.Log; import android.view.Display; @@ -268,6 +270,13 @@ public class TaskbarActivityContext extends BaseTaskbarContext { dispatchDeviceProfileChanged(); } + @Override + public void dispatchDeviceProfileChanged() { + super.dispatchDeviceProfileChanged(); + Trace.instantForTrack(TRACE_TAG_APP, "TaskbarActivityContext#DeviceProfileChanged", + getDeviceProfile().toSmallString()); + } + /** * Copy the original DeviceProfile, match the number of hotseat icons and qsb width and update * the icon size diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index a7651b6a06..078865fd02 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.uioverrides; +import static android.os.Trace.TRACE_TAG_APP; +import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT; @@ -62,6 +64,7 @@ import android.os.Bundle; import android.os.CancellationSignal; import android.os.IBinder; import android.os.SystemProperties; +import android.os.Trace; import android.view.Display; import android.view.HapticFeedbackConstants; import android.view.RemoteAnimationTarget; @@ -541,6 +544,7 @@ public class QuickstepLauncher extends Launcher { if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) { mViewCapture = ViewCapture.getInstance().startCapture(getWindow()); } + getWindow().addPrivateFlags(PRIVATE_FLAG_OPTIMIZE_MEASURE); } @Override @@ -1036,6 +1040,13 @@ public class QuickstepLauncher extends Launcher { return false; } + @Override + public void dispatchDeviceProfileChanged() { + super.dispatchDeviceProfileChanged(); + Trace.instantForTrack(TRACE_TAG_APP, "QuickstepLauncher#DeviceProfileChanged", + getDeviceProfile().toSmallString()); + } + private static final class LauncherTaskViewController extends TaskViewTouchController { diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index 6f86bf5de6..f26189ce57 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -15,6 +15,7 @@ */ package com.android.quickstep; +import static android.os.Trace.TRACE_TAG_APP; import static android.view.RemoteAnimationTarget.MODE_CLOSING; import static android.view.RemoteAnimationTarget.MODE_OPENING; @@ -36,6 +37,7 @@ import android.content.res.Configuration; import android.os.Bundle; import android.os.Handler; import android.os.Looper; +import android.os.Trace; import android.view.Display; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationTarget; @@ -448,6 +450,13 @@ public final class RecentsActivity extends StatefulActivity { return new RecentsAtomicAnimationFactory<>(this); } + @Override + public void dispatchDeviceProfileChanged() { + super.dispatchDeviceProfileChanged(); + Trace.instantForTrack(TRACE_TAG_APP, "RecentsActivity#DeviceProfileChanged", + getDeviceProfile().toSmallString()); + } + private AnimatorListenerAdapter resetStateListener() { return new AnimatorListenerAdapter() { @Override diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 7b540d00c2..8391b91c43 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -1680,6 +1680,16 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth())); } + /** Returns a reduced representation of this DeviceProfile. */ + public String toSmallString() { + return "isTablet:" + isTablet + ", " + + "isMultiDisplay:" + isMultiDisplay + ", " + + "widthPx:" + widthPx + ", " + + "heightPx:" + heightPx + ", " + + "insets:" + mInsets + ", " + + "rotationHint:" + rotationHint; + } + private static Context getContext(Context c, Info info, int orientation, WindowBounds bounds) { Configuration config = new Configuration(c.getResources().getConfiguration()); config.orientation = orientation;