Add event log for setRequestedOrientation

To clarify app's behavior.

Bug: 259085920
Test: Call Activity#setRequestedOrientation by a sample app.
      Check events log.
Change-Id: I7dd937f7e56cd6229801b385456fccb9a73791b8
This commit is contained in:
Riddle Hsu
2023-02-01 07:48:48 +00:00
parent 8bcfd1b399
commit 4e278a41f2
2 changed files with 7 additions and 1 deletions

View File

@@ -749,6 +749,8 @@ class ActivityClientController extends IActivityClientController.Stub {
synchronized (mGlobalLock) {
final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
EventLogTags.writeWmSetRequestedOrientation(requestedOrientation,
r.shortComponentName);
r.setRequestedOrientation(requestedOrientation);
}
}

View File

@@ -1,4 +1,4 @@
# See system/core/logcat/event.logtags for a description of the format of this file.
# See system/logging/logcat/event.logtags for a description of the format of this file.
option java_package com.android.server.wm
@@ -59,6 +59,10 @@ option java_package com.android.server.wm
31002 wm_task_moved (TaskId|1|5),(Root Task ID|1|5),(Display Id|1|5),(ToTop|1),(Index|1)
# Task removed with source explanation.
31003 wm_task_removed (TaskId|1|5),(Root Task ID|1|5),(Display Id|1|5),(Reason|3)
# Set the requested orientation of an activity.
31006 wm_set_requested_orientation (Orientation|1|5),(Component Name|3)
# bootanim finished:
31007 wm_boot_animation_done (time|2|3)