Tiger Huang ec1a69e87c Send display cutout to client via insetsChanged
Since the display cutout is a type of insets and the display cutout can
be obtained from WindowInsets, it makes sense that InsetsState has the
display cutout instance. In this way, we can send the display cutout to
client via W#insetsChanged instead of W#resized.

This can be a step to remove the class of ClientWindowFrames, and can
also be a step to make client compute its window frame locally.

Fix: 175858810
Bug: 161810301
Test: atest WindowAddRemovePerfTest ImeInsetsSourceConsumerTest
            InsetsControllerTest InsetsStateTest ViewRootImplTest
            WindowInsetsControllerTests ActivityRecordTests
            DisplayPolicyLayoutTests LaunchParamsControllerTests
            TaskSnapshotSurfaceTest WindowMetricsActivityTests
            WindowMetricsWindowContextTests WindowMetricsTest
            WindowFrameTests WindowStateTests WmDisplayCutoutTest
Change-Id: I9a930b1d2f7df3cea2b29629b767a4a5f31bca17
2021-01-05 22:22:38 +08:00
..

Window manager performance tests

Precondition

To reduce the variance of the test, if perf-setup.sh (platform_testing/scripts/perf-setup) is available, it is better to use the following instructions to lock CPU and GPU frequencies.

m perf-setup
PERF_SETUP_PATH=/data/local/tmp/perf-setup.sh
adb push $OUT/$PERF_SETUP_PATH $PERF_SETUP_PATH
adb shell chmod +x $PERF_SETUP_PATH
adb shell $PERF_SETUP_PATH

Example to run

Use atest

atest WmPerfTests:RelayoutPerfTest -- \
      --module-arg WmPerfTests:instrumentation-arg:kill-bg:=true

Use am instrument

adb shell am instrument -w -r -e class android.wm.RelayoutPerfTest \
          -e listener android.wm.WmPerfRunListener \
          -e kill-bg true \
          com.android.perftests.wm/androidx.test.runner.AndroidJUnitRunner
  • kill-bg is optional.

Test arguments

  • kill-bg
    • boolean: Kill background process before running test.
  • profiling-iterations
    • int: Run the extra iterations with enabling method profiling.
  • profiling-sampling
    • int: The interval (0=trace each method, default is 10) of sample profiling in microseconds.