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

Adapt Android for sync v2 #5361

Merged
merged 23 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
14e2151
Removed sync v1 js stuff for Android
AlexeyBarabash Jun 22, 2020
6836c01
Removed js extension stuff for desktop
AlexeyBarabash Jun 22, 2020
227729e
Removed Android sync v1 unnecessary stuff
AlexeyBarabash Jun 22, 2020
6ef8013
Reverted brave-core PR #5096
AlexeyBarabash Jun 22, 2020
4148ec8
Cleaned up BraveSyncWorker class
AlexeyBarabash Jun 22, 2020
5ed5142
Method Prefs::SetSyncV1WasEnabled to allow Android set flag on migrat…
AlexeyBarabash Jun 22, 2020
a10b5ee
Migration from sync v1 on Android, clear old prefs, set flag about mi…
AlexeyBarabash Jun 22, 2020
ef4e4a8
Classes for work with sync devices
AlexeyBarabash Jun 22, 2020
74ab8b3
BraveSyncWorker methods to support sync v2 enable/reset/auth and code…
AlexeyBarabash Jun 22, 2020
fc0d60b
Patch and xml for ManageSyncSettings.java to have switches instead of…
AlexeyBarabash Jun 22, 2020
2e13730
Removed BraveSyncScreensObserver class
AlexeyBarabash Jun 22, 2020
851e004
Updated string resources
AlexeyBarabash Jun 22, 2020
8ab7799
Removed enter device name dialog
AlexeyBarabash Jun 22, 2020
90eb6b5
Updated layout for sync v2 screen
AlexeyBarabash Jun 22, 2020
21ead9c
UI changes for sync v2 (BraveSyncScreensPreference)
AlexeyBarabash Jun 22, 2020
b07460a
Removed CC sync preference
AlexeyBarabash Jun 22, 2020
00b2370
Modified log level from info to verbose for some messages.
AlexeyBarabash Jun 24, 2020
04ab45d
Removed delete other device buttons
AlexeyBarabash Jun 24, 2020
ab607b1
Reverted strings with mention of Brave Pay, as this category is hidde…
AlexeyBarabash Jun 24, 2020
8fe81c6
On migrate from sync v1 remove PREF_SEED also
AlexeyBarabash Jun 25, 2020
9b1ec9c
Fixed issue when sync on Android didn't work after app restart.
AlexeyBarabash Jun 25, 2020
85d5d11
Reducing ManageSyncSettings.java.patch
AlexeyBarabash Jun 26, 2020
0f0b680
Fixed issues of re-connecting new/existing chains rapidly
AlexeyBarabash Jun 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ if (is_android) {
sources = [
"$root_build_dir/brave_resources.pak",
"$root_build_dir/brave_100_percent.pak",
"//brave/android/sync/android_sync.js",
"//brave/android/sync/android_sync_words.js",
"//brave/android/sync/crypto.js",
"//brave/components/brave_sync/extension/brave-sync-android/bundles/bundle.js",
"//brave/LICENSE.html",
]
deps = [
Expand Down
22 changes: 0 additions & 22 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ deps = {
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@13bb40a215248cfbdd87d0a6b425c8397402e9e6",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@e3742ba3e8942eea9e4755d91532491871bd3116",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@800f9d40b7409239ff192e0be634764e747c7a75",
"components/brave_sync/extension/brave-sync": {
'url': 'https://github.com/brave/sync.git@5da4fc903f9cf0a627bbca28b49fcb09bb479f88',
'condition': 'not checkout_android',
},
"components/brave_sync/extension/brave-sync-android": {
'url': 'https://github.com/brave/sync.git@4098493496b19f46c33a66b8867c69ee6d1a4568',
'condition': 'checkout_android',
},
"vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@865ba342737c09b13ee18e45b8ece5970bb77246",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@c396fb4eb9e9bf63b89ae5a0ec0b5f201d43c7c5",
}
Expand All @@ -45,20 +37,6 @@ hooks = [
'condition': 'not checkout_android',
'action': ['vpython3', 'src/brave/script/download_rust_deps.py'],
},
{
# Build brave-sync
'name': 'build_brave_sync',
'pattern': '.',
'action': ['python', 'src/brave/script/build-simple-js-bundle.py', '--repo_dir_path', 'src/brave/components/brave_sync/extension/brave-sync'],
'condition': 'not checkout_android',
},
{
# Build brave-sync android
'name': 'build_brave_sync',
'pattern': '.',
'action': ['python', 'src/brave/script/build-simple-js-bundle.py', '--repo_dir_path', 'src/brave/components/brave_sync/extension/brave-sync-android'],
'condition': 'checkout_android',
},
{
'name': 'generate_licenses',
'pattern': '.',
Expand Down
1 change: 0 additions & 1 deletion android/brave_java_resources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ brave_java_resources = [
"java/res/layout/fragment_search_engine_onboarding.xml",
"java/res/layout/brave_rewards_spinnner_item_dropdown.xml",
"java/res/layout/brave_rewards_grants_list_item.xml",
"java/res/layout/add_sync_device_name_dialog.xml",
"java/res/layout/brave_rewards_donation_sent.xml",
"java/res/layout/ntp_bottom_sheet.xml",
"java/res/layout/brave_shields_scripts_blocked_switcher.xml",
Expand Down
9 changes: 3 additions & 6 deletions android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsUserWalletActivity.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsVerifyWalletActivity.java",
"../../brave/android/java/org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate.java",
"../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java",
"../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java",
"../../brave/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkWorker.java",
"../../brave/android/java/org/chromium/chrome/browser/document/BraveLauncherActivity.java",
"../../brave/android/java/org/chromium/chrome/browser/externalnav/BraveExternalNavigationHandler.java",
"../../brave/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedback.java",
Expand Down Expand Up @@ -81,7 +78,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/partnercustomizations/CloseBraveManager.java",
"../../brave/android/java/org/chromium/chrome/browser/preferences/BravePreferenceKeys.java",
"../../brave/android/java/org/chromium/chrome/browser/preferences/BravePrefServiceBridge.java",
"../../brave/android/java/org/chromium/chrome/browser/preferences/BraveSyncScreensObserver.java",
"../../brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettings.java",
"../../brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettingsObserver.java",
"../../brave/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java",
Expand Down Expand Up @@ -114,8 +110,8 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsPreferencesBase.java",
"../../brave/android/java/org/chromium/chrome/browser/site_settings/DesktopModePreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/site_settings/PlayYTVideoInBrowserPreferences.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/BraveSyncService.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/BraveSyncServiceObserver.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/BraveSyncDevices.java",
"../../brave/android/java/org/chromium/chrome/browser/sync/settings/BraveManageSyncSettings.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/BraveHomeButton.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BookmarksButton.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomToolbarConfiguration.java",
Expand All @@ -124,6 +120,7 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBrowsingModeBottomToolbarCoordinator.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveSearchAccelerator.java",
"../../brave/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java",
"../../brave/android/java/org/chromium/chrome/browser/ui/brave_tricks/checkbox_to_switch/CheckBoxPreference.java",
"../../brave/android/java/org/chromium/chrome/browser/upgrade/BravePackageReplacedBroadcastReceiver.java",
"../../brave/android/java/org/chromium/chrome/browser/upgrade/NotificationIntent.java",
"../../brave/android/java/org/chromium/chrome/browser/util/BraveDbUtil.java",
Expand Down
23 changes: 0 additions & 23 deletions android/java/org/chromium/chrome/browser/BraveActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,29 +230,6 @@ public void finishNativeInitialization() {
showBraveRateDialog();
}

@Override
public void addOrEditBookmark(final Tab tabToBookmark) {
long tempBookmarkId = BookmarkBridge.getUserBookmarkIdForTab(tabToBookmark);
final boolean bCreateBookmark = (BookmarkId.INVALID_ID == tempBookmarkId);

super.addOrEditBookmark(tabToBookmark);

final long bookmarkId = BookmarkBridge.getUserBookmarkIdForTab(tabToBookmark);
final BookmarkModel bookmarkModel = new BookmarkModel();

bookmarkModel.finishLoadingBookmarkModel(() -> {
// Gives up the bookmarking if the tab is being destroyed.
BookmarkId newBookmarkId = new BookmarkId(bookmarkId, BookmarkType.NORMAL);
if (!((TabImpl)tabToBookmark).isClosing() && ((TabImpl)tabToBookmark).isInitialized()) {
if (null != mBraveSyncWorker && null != newBookmarkId) {
mBraveSyncWorker.CreateUpdateBookmark(bCreateBookmark, bookmarkModel.getBookmarkById(newBookmarkId));
bookmarkModel.destroy();
}
}
bookmarkModel.destroy();
});
}

private void createNotificationChannel() {
Context context = ContextUtils.getApplicationContext();
// Create the NotificationChannel, but only on API 26+ because
Expand Down
Loading