summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorJames O'Leary <jamesoleary@google.com>2021-07-12 10:10:19 -0400
committerJames O'Leary <jamesoleary@google.com>2021-07-12 10:10:19 -0400
commitedb7c22c0d8a58b459d3b6f329c5ed1bfa930402 (patch)
tree4e59ee139d630abfcb54b80e0f1841c233d24d37 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent103bec65a256afa3781d92b7fddc3fb054554f63 (diff)
Fix WallpaperPicker not being able to assign colors
- ThemeOverlayController intentionally chooses transparent as the theme color if there aren't any wallpaper colors (ex. a Live Wallpaper that doesn't send WallpaperColors objects to WallpaperManagerService) - Rather than refactor old code, we patched by ensuring any attempts to use less-than-opaque colors for a theme are replaced by using a default color (ag/15193364) - However, WallpaperPicker sends transparent colors when setting a new theme color - WallpaperPicker's ColorUtils.toColorString turns a color into a 6 characters hex code when transmitting it to framework via JSON stored in a setting. - Six characters can only contain red, green, and blue channels, not alpha. - When the six character string is parsed by Integer.parseInt(), the resulting color has 0 alpha, and the new theme color is rejected in favor of the default color - Using Color.parseColor ensures that alpha is correctly set, whether callers use a 6 or 8 character hex code, and ensuring the input to Color.parseColor starts with a # sign ensures it will work properly Test: Add logs to WallpaperPicker, verifying points at which it manipulates hex codes, ensuring WallpaperPicker is receiving colors with a full alpha channel and merely losing it upon converting it to a 6 digit string. Make this patch to framework. Check implementation of Color.parseColor, ensure we meet its requirements for arguments by sanitizing inputs from callers (i.e. add a # sign in front). Uninstall patches wallpaper picker, reverting to system image, and verify theme colors are assigned properly. Bug: 193044118 Change-Id: Idcdf5d41ee422d5a1b12cec415da9198b8405a5a
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions