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
Loading
Please register or sign in to comment