Fix bounds rotation logic

Reuse code that computes window bounds for seamless rotation in
DisplayContent#rotateBounds. Also make sure that we operate with
display rect adjusted for the requested orientation.

Bug: 31005451
Bug: 29586417
Test: Tests in ActivityManagerAppConfigurationTests pass.
Change-Id: I921ec184c9eaad6dbd15ac3e0def1f5e623a363e
2 files changed