Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PrefService Java class for local state prefs from BravePrefServiceBridge #27632

Closed
AlexeyBarabash opened this issue Jan 4, 2023 · 1 comment · Fixed by brave/brave-core#16486

Comments

@AlexeyBarabash
Copy link
Contributor

AlexeyBarabash commented Jan 4, 2023

Follow-up for brave/brave-core#16386

Edit BravePrefServiceBridge for local state based prefs is not perfect by following reasons:

  • it requires add new methods in two files;
  • it's easy to make mistake.

The good solution would be to re-use Chromium PrefService class and auto-generated pref names, which is now done for profile-based prefs.

@Uni-verse
Copy link
Contributor

Uni-verse commented Feb 6, 2023

Verified on Samsung Galaxy S21 using version:

Brave	1.48.157 Chromium: 110.0.5481.77 (Official Build) (64-bit) 
Revision	65ed616c6e8ee3fe0ad64fe83796c020644d42af-refs/branch-heads/5481@{#839}
OS	Android 13; Build/TP1A.220624.014

Test Plan: brave/brave-core#16486 (comment)

brave.p3a.enabled
  1. Ensured that unchecking P3A in the onboarding flow will show below in brave://local-state
"p3a": {
         "enabled": false,
  1. Ensured that enabling P3A switch in privacy settings will display below in brave://local-state
  2. Ensured that relaunching the browser does not reset the P3A preference in the settings
 "p3a": {
         "enabled": true,
Step 1 Step 2
screenshot-1675720301647 screenshot-1675720273364
brave.stats.reporting_enabled
  1. Ensured that turning off Automatically send daily usage pings in privacy settings will display reporting_enabled: false follow in brave://local-state
  2. Ensured that relaunching the browser does not reset the setting
Example Example
screenshot-1675720364276 screenshot-1675720583355
safetynet.status
  1. Ensured that the Brave Rewards grant should is retrieved successfully to verify it works as before.
safetynet.status
brave.unstoppable_domains.resolve_method
  1. Ensured that enabling Unstoppable Domains in privacy settings will display below in local-state
"unstoppable_domains": {
         "resolve_method": 3
      },
  1. Ensured that relaunching the browser does not reset the setting
Example Example
screenshot-1675720699223 screenshot-1675720713739
brave.ens.resolve_method
  1. Ensured that enabling Ethereum Name Service in privacy settings will display the following under brave://local-state
"ens": {
         "resolve_method": 3
      },
  1. Ensured that relaunching the browser does not reset the setting
Example Example
screenshot-1675721366658 screenshot-1675723250944
brave.sns.resolve_method
  1. Enable Solana Name Service in brave://flags
  2. Ensured Solana Name Service shows up in the privacy settings
  3. Ensured enabling SNS will display the following in brave://local-state
"sns": {
         "resolve_method": 3
      },

Example Example Example
screenshot-1675720851382 screenshot-1675720903837 screenshot-1675721142038
brave.ens.offchain_resolve_method
  1. Enable ENS offchain lookup under Ethereum Name Service in the privacy settings
  2. Check brave://localstate to ensure that the follow log is displayed
"ens": {
         "offchain_resolve_method": 2,

  1. Relaunch browser to make sure setting preference is retained
Example Example
screenshot-1675721366658 screenshot-1675723250944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants