Skip to content
New issue

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

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

Already on GitHub? # to your account

migrate android toolbar settings #4970

Merged
merged 1 commit into from
Mar 17, 2020
Merged

Conversation

SergeyZhukovsky
Copy link
Member

Resolves brave/brave-browser#8713

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@SergeyZhukovsky SergeyZhukovsky added CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Mar 17, 2020
@SergeyZhukovsky SergeyZhukovsky added this to the 1.8.x - Nightly milestone Mar 17, 2020
@SergeyZhukovsky SergeyZhukovsky self-assigned this Mar 17, 2020
sharedPreferencesEditor.putBoolean(BravePreferenceKeys.BRAVE_BOTTOM_TOOLBAR_ENABLED_KEY,
sharedPreferences.getBoolean(BOTTOM_TOOLBAR_ENABLED_KEY, true));
sharedPreferencesEditor.apply();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to call it before the scheduled job as it allows to run non heave tasks. Otherwise we don't have the settings migrated on a first task sometimes.

SharedPreferences prefStatsFromTabs = ContextUtils.getApplicationContext()
.getSharedPreferences(PREF_STATS_PREFERENCES_NAME, 0);
boolean updateFormTabs = prefStatsFromTabs.contains(PREF_WEEK_OF_INSTALLATION_NAME);
if (!updateFormTabs) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are confident that it's a tabs=>core update by checking the preferences above

Copy link
Member

@yrliou yrliou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

public static final String BRAVE_BOTTOM_TOOLBAR_SET_KEY = "brave_bottom_toolbar_set";
public static final String BRAVE_BOTTOM_TOOLBAR_ENABLED_KEY = "brave_bottom_toolbar_enabled";
public static final String BRAVE_BOTTOM_TOOLBAR_ENABLED_KEY = "brave_bottom_toolbar_enabled_key";
public static final String BRAVE_BOTTOM_TOOLBAR_SET_KEY = "brave_bottom_toolbar_enabled";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we mixed preferences names initially on feature migration. We kept one settings named the same but it was used for diff things comparing to tabs and another settings I just renamed to be consistent with the preference name. It breaks beta build settings for bottom toolbar but otherwise we don't have a way to migrate our existing stable version users.

@SergeyZhukovsky SergeyZhukovsky merged commit 67ace75 into master Mar 17, 2020
@SergeyZhukovsky SergeyZhukovsky deleted the android_toolbar_migration branch March 17, 2020 23:09
brave-builds pushed a commit that referenced this pull request Mar 17, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Settings reset during migration
3 participants