diff --git a/android/brave_java_sources.gni b/android/brave_java_sources.gni index 05f954741192..a746cbc842d5 100644 --- a/android/brave_java_sources.gni +++ b/android/brave_java_sources.gni @@ -297,6 +297,14 @@ brave_java_sources = [ "../../brave/android/java/org/chromium/chrome/browser/partnercustomizations/CloseBraveManager.java", "../../brave/android/java/org/chromium/chrome/browser/password_manager/settings/BraveExportFlow.java", "../../brave/android/java/org/chromium/chrome/browser/password_manager/settings/BravePasswordSettingsBase.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistServiceFactoryAndroid.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistServiceObserverImpl.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistStreamingObserverImpl.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/hls_content/HlsServiceImpl.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/hls_content/HlsUtils.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistPreferences.java", + "../../brave/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistResetPreference.java", "../../brave/android/java/org/chromium/chrome/browser/preferences/BravePrefServiceBridge.java", "../../brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettings.java", "../../brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettingsObserver.java", @@ -518,7 +526,6 @@ brave_java_sources += brave_feed_java_sources brave_java_sources += brave_public_tab_management_java_sources brave_java_sources += brave_share_java_sources brave_java_sources += brave_app_billing_sources -brave_java_sources += brave_playlist_sources brave_browser_ui_android_appmenu_internal_sources = [ "//brave/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/BraveAppMenu.java" ] @@ -543,12 +550,11 @@ brave_java_base_sources = [ brave_java_base_module_sources = [ "//brave/android/java/org/chromium/chrome/browser/base/SplitCompatJobIntentService.java", + "//brave/android/java/org/chromium/chrome/browser/playlist/hls_content/HlsService.java", "//brave/android/java/org/chromium/chrome/browser/upgrade/BraveUpgradeJobIntentService.java", "//brave/android/java/org/chromium/chrome/browser/vpn/wireguard/WireguardService.java", ] -brave_java_base_module_sources += brave_java_base_module_playlist_sources - brave_java_base_module_deps = [ "//brave/third_party/android_deps:com_wireguard_android_java", "//third_party/androidx:androidx_core_core_java", diff --git a/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistPreferences.java b/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistPreferences.java index b233a40e8b4f..11f2e023d964 100644 --- a/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistPreferences.java +++ b/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistPreferences.java @@ -15,6 +15,7 @@ import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; import org.chromium.chrome.R; +import org.chromium.chrome.browser.BraveRelaunchUtils; import org.chromium.chrome.browser.playlist.PlaylistServiceFactoryAndroid; import org.chromium.chrome.browser.playlist.local_database.PlaylistRepository; import org.chromium.chrome.browser.playlist.util.PlaylistPreferenceUtils; @@ -77,6 +78,13 @@ public void onActivityCreated(Bundle savedInstanceState) { playlistRepository.deleteAllLastPlayedPosition(); playlistRepository.deleteAllHlsContentQueueModel(); PlaylistPreferenceUtils.resetPlaylistPrefs(getActivity()); + getActivity() + .runOnUiThread( + (Runnable) + () -> + BraveRelaunchUtils + .askForRelaunch( + getActivity())); }); } return true; diff --git a/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistResetPreference.java b/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistResetPreference.java index b155baa32e7d..bc3b04e7a48b 100644 --- a/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistResetPreference.java +++ b/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistResetPreference.java @@ -14,12 +14,10 @@ import org.chromium.chrome.R; -/** - * The preference used to reset Brave Playlist. - */ -public class BravePlaylistResetPreference - extends Preference implements Preference.OnPreferenceClickListener { - private String TAG = "BravePlaylistResetPreference"; +/** The preference used to reset Brave Playlist. */ +public class BravePlaylistResetPreference extends Preference + implements Preference.OnPreferenceClickListener { + private static final String TAG = "BravePlaylistResetPreference"; private int mPrefAccentColor; diff --git a/android/java/org/chromium/chrome/browser/playlist/sources.gni b/android/java/org/chromium/chrome/browser/playlist/sources.gni index e0723358198c..18325768a0a3 100644 --- a/android/java/org/chromium/chrome/browser/playlist/sources.gni +++ b/android/java/org/chromium/chrome/browser/playlist/sources.gni @@ -7,16 +7,3 @@ brave_app_playlist_deps = [ "//brave/third_party/android_deps:androidx_media3_media3_exoplayer_hls_java", "//third_party/androidx:androidx_media3_media3_common_java", ] - -brave_playlist_sources = [ - "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistServiceFactoryAndroid.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistServiceObserverImpl.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/PlaylistStreamingObserverImpl.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/hls_content/HlsServiceImpl.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/hls_content/HlsUtils.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistPreferences.java", - "../../brave/android/java/org/chromium/chrome/browser/playlist/settings/BravePlaylistResetPreference.java", -] - -brave_java_base_module_playlist_sources = [ "//brave/android/java/org/chromium/chrome/browser/playlist/hls_content/HlsService.java" ] diff --git a/browser/playlist/android/sources.gni b/browser/playlist/android/sources.gni index 017e6d02f46a..11047676ceec 100644 --- a/browser/playlist/android/sources.gni +++ b/browser/playlist/android/sources.gni @@ -3,19 +3,5 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at https://mozilla.org/MPL/2.0/. -import("//brave/components/playlist/common/buildflags/buildflags.gni") - -brave_browser_playlist_sources = [] -brave_browser_playlist_deps = [] - -if (enable_playlist && is_android) { - brave_browser_playlist_sources += [ "playlist_service_factory_android.cc" ] - - brave_browser_playlist_deps += [ - "//brave/build/android:jni_headers", - "//mojo/public/cpp/bindings", - ] -} - brave_playlist_kt_allowlist = [ "java/src/org/chromium/chrome/browser/playlist/*.kt" ] diff --git a/browser/playlist/sources.gni b/browser/playlist/sources.gni index 5d812ab37cfa..a8219564d90f 100644 --- a/browser/playlist/sources.gni +++ b/browser/playlist/sources.gni @@ -24,7 +24,16 @@ if (enable_playlist) { "//components/pref_registry:pref_registry", ] - if (!is_android) { + if (is_android) { + brave_browser_playlist_sources += [ + "//brave/browser/playlist/android/playlist_service_factory_android.cc", + ] + + brave_browser_playlist_deps += [ + "//brave/build/android:jni_headers", + "//mojo/public/cpp/bindings", + ] + } else { brave_browser_playlist_sources += [ "//brave/browser/playlist/playlist_data_source.cc", "//brave/browser/playlist/playlist_data_source.h",