[SysUI][Floaty] Fix incorrect default value picked for LPP setting
Fetching POWER_BUTTON_LONG_PRESS's value using GlobalSetting's getInt() API currently uses "R.integer.config_longPressOnPowerBehavior" directly. This causes it to return config's resource id instead of the actual integer value of the config. On further analysis, logs suggest that POWER_BUTTON_LONG_PRESS setting isn't present and even in PhoneWindowManager's usage, default value read from config is returned on the first time. This change fixes this issue by fetching the actual integer value of the config. Test: NONE checked manually by logging value 1. Factory reset the device 2. Add logs in SqueezeEffectRepositoryImpl and PhoneWindowManager to print POWER_BUTTON_LONG_PRESS's value using both Settings and GlobalSettings API 3. In the logs keep -1 as the default value in API's default param 4. Repeat #3, but this time keep the default value as the integer value of the config "R.integer.config_longPressOnPowerBehavior" 5. In both #3 and #4, logs coming from both files should point to exactly same values 6. Repeat #1 to #5 couple times and ensure that #5 is correct everytime Flag: com.android.systemui.shared.enable_lpp_assist_invocation_effect Bug: 399263897 Change-Id: Ifbe7f8fe66dc6fe67a98f5c375668e9342c31204
Loading
Please register or sign in to comment