Merge "Add Rotation Information to WindowManager proto dumpsys"
This commit is contained in:
committed by
Android (Google) Code Review
commit
9464b73a32
@@ -91,6 +91,8 @@ message DisplayProto {
|
||||
repeated WindowTokenProto ime_windows = 7;
|
||||
int32 dpi = 8;
|
||||
.android.view.DisplayInfoProto display_info = 9;
|
||||
int32 rotation = 10;
|
||||
ScreenRotationAnimationProto screen_rotation_animation = 11;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,4 +172,10 @@ message WindowStateAnimatorProto {
|
||||
message WindowSurfaceControllerProto {
|
||||
bool shown = 1;
|
||||
int32 layer = 2;
|
||||
}
|
||||
|
||||
/* represents ScreenRotationAnimation */
|
||||
message ScreenRotationAnimationProto {
|
||||
bool started = 1;
|
||||
bool animation_running = 2;
|
||||
}
|
||||
@@ -108,6 +108,8 @@ import static com.android.server.wm.proto.DisplayProto.DPI;
|
||||
import static com.android.server.wm.proto.DisplayProto.ID;
|
||||
import static com.android.server.wm.proto.DisplayProto.IME_WINDOWS;
|
||||
import static com.android.server.wm.proto.DisplayProto.PINNED_STACK_CONTROLLER;
|
||||
import static com.android.server.wm.proto.DisplayProto.ROTATION;
|
||||
import static com.android.server.wm.proto.DisplayProto.SCREEN_ROTATION_ANIMATION;
|
||||
import static com.android.server.wm.proto.DisplayProto.STACKS;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
@@ -2139,6 +2141,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
|
||||
}
|
||||
proto.write(DPI, mBaseDisplayDensity);
|
||||
mDisplayInfo.writeToProto(proto, DISPLAY_INFO);
|
||||
proto.write(ROTATION, mRotation);
|
||||
final ScreenRotationAnimation screenRotationAnimation =
|
||||
mService.mAnimator.getScreenRotationAnimationLocked(mDisplayId);
|
||||
if (screenRotationAnimation != null) {
|
||||
screenRotationAnimation.writeToProto(proto, SCREEN_ROTATION_ANIMATION);
|
||||
}
|
||||
proto.end(token);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,15 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
|
||||
import static com.android.server.wm.WindowStateAnimator.WINDOW_FREEZE_LAYER;
|
||||
import static com.android.server.wm.WindowSurfaceController.SurfaceTrace;
|
||||
import static com.android.server.wm.proto.ScreenRotationAnimationProto.ANIMATION_RUNNING;
|
||||
import static com.android.server.wm.proto.ScreenRotationAnimationProto.STARTED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.util.Slog;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
import android.view.Display;
|
||||
import android.view.DisplayInfo;
|
||||
import android.view.Surface;
|
||||
@@ -216,6 +219,13 @@ class ScreenRotationAnimation {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToProto(ProtoOutputStream proto, long fieldId) {
|
||||
final long token = proto.start(fieldId);
|
||||
proto.write(STARTED, mStarted);
|
||||
proto.write(ANIMATION_RUNNING, mAnimRunning);
|
||||
proto.end(token);
|
||||
}
|
||||
|
||||
public ScreenRotationAnimation(Context context, DisplayContent displayContent,
|
||||
SurfaceSession session, boolean inTransaction, boolean forceDefaultOrientation,
|
||||
boolean isSecure, WindowManagerService service) {
|
||||
|
||||
Reference in New Issue
Block a user