Integrate IPC call from SysUI to system_server
Integrate IPC call that starts from SettingsLib/DeviceStateAutoRotateSettingManagerImpl and will eventually reach WM/DeviceStateAutoRotateSettingController. Do not directly write ACCELEROMETER_ROTATION via settings apis in WM/DisplayRotation, instead use WM/DeviceStateAutoRotateSettingController. More details: The main goal is to keep the auto-rotate logic working the same as before this refactor, with the only difference being that the controller is now in WindowManager (WM). Previously, when accelerometer_rotation needed an update, RotationPolicy.setRotationLock() was called. This method did several extra steps, not just update the setting. Now, when the device state or device_state_rotation_lock setting changes, we write directly to the accelerometer_rotation setting. This direct write alone would miss those important extra steps. To prevent unintentional behavior change and ensure all original operations are performed, we now call setUserRotationSetting immediately after writing to the accelerometer_rotation setting. We determined what setUserRotationSetting needs to do by checking the original RotationPolicy.setRotationLock() flow and all uses of DisplayRotation.freezeRotation. Bug: 394303731 Test: atest DeviceStateAutoRotateSettingControllerTests DisplayRotationTests Flag: com.android.window.flags.enable_device_state_auto_rotate_setting_refactor Change-Id: I29c4aa9d62cbb99df3eec3e957971d5bcbb5e979
Loading
Please register or sign in to comment