Merge changes I2c1e440b,I805d56d4 into tm-qpr-dev am: 1207e773e2

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20980941

Change-Id: I7914563f8e32d3fa58a70ce4cb925764a7936df9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Nicolò Mazzucato
2023-01-19 20:07:58 +00:00
committed by Automerger Merge Worker
4 changed files with 39 additions and 0 deletions

View File

@@ -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

View File

@@ -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<Launcher> {

View File

@@ -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<RecentsState> {
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

View File

@@ -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;