how to set default about:flags values during chromium apk build

92 views
Skip to first unread message

109012

unread,
Oct 19, 2022, 11:20:55 PM10/19/22
to Chromium-dev
I want to do 2 very simple things and I can't find information on how to do it.
1) Need to set some default flag values to build chromium apk to launch with, baked in. I see several about_flags.cc files, which are pretty convoluted.
2) Need to change some values in apk manifest file. Not sure where that can be done in code.
Please help.

109012

unread,
Oct 20, 2022, 12:05:51 AM10/20/22
to Chromium-dev, 109012
I think I found a solution to #1 - a quick way to set default chromium flag values to bake them into a compilation/build.
1) Set default flags to build apk: edit chrome/browser/about_flags.cc, then modify corresponding flag's feature entry so that the default flags_ui has switches::disabled/enabled_whatever, or just replace the default flags_ui with the disabled/enabled flags_ui. 
Now, this will bake the desired chromium flag settings into a compiled build, however, this might cause unusual behavior even when it shouldn't (probably per flag). For example, I disabled GPU rasterization flag by default this way in a chromium-based Brave Browser Android build, the browser loads and works fine, but when I tried flipping the flag to Enabled after launching the apk it crashes the browser.

Reply all
Reply to author
Forward
0 new messages