Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a10d9b94 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Simplify legacy screen compat mode a bit

The entry of changing legacy screen compat mode is almost a dead code.
The current usage is only from command:
  adb shell am screen-compat [on|off] $packageName

But because the manifest attributes are still valid:
 android:smallScreens/normalScreens/largeScreens
It might be better to preserve the behavior for now.

By caching the legacy compat state in server side and reusing
restartProcessIfVisible for compatibility info change, this can
reduce unnecessary Configuration comparison on every frame from
Display#getDisplayAdjustments(). Also the fields can be removed:
 ViewRootImpl#mLastInCompatMode
 WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW
 ActivityRecord#forceNewConfig

Bug: 163976519
Test: atest CompatModePackagesTests
Test: adb install --bypass-low-target-sdk-block test.apk
      which declares minSdkVersion="1"
      The appearance is not changed and touch can still work.
Test: App (without always/never-compat) can be relaunched and
      scaled when using command:
      adb shell am screen-compat [on|off] $packageName

Change-Id: I661ddaee15014201aa1109671cfd6619df91ea4a
parent c7faccbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment