-
Notifications
You must be signed in to change notification settings - Fork 877
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
[Android] Add option to enable/disable download notification bubble #16556
[Android] Add option to enable/disable download notification bubble #16556
Conversation
|
2 similar comments
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android test change++
d5a239e
to
58f60b7
Compare
android/java/org/chromium/chrome/browser/download/settings/BraveDownloadSettings.java
Show resolved
Hide resolved
@@ -25,6 +25,11 @@ public final class BravePreferenceKeys { | |||
"org.chromium.chrome.browser.upgrade.Milliseconds_New"; | |||
public static final String BRAVE_DOWNLOADS_AUTOMATICALLY_OPEN_WHEN_POSSIBLE = | |||
"org.chromium.chrome.browser.downloads.Automatically_Open_When_Possible"; | |||
|
|||
// Value is being used in | |||
// browser/download/internal/android/java/src/org/chromium/chrome/browser/download/BraveDownloadMessageUiControllerImpl.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move BravePreferenceKeys.java
to base to be accessible in all components, like we did with BraveFeatureList.java
android/java/proguard.flags
Outdated
@@ -13,6 +13,10 @@ | |||
*** createViewProvider(...); | |||
} | |||
|
|||
-keep class org.chromium.chrome.browser.download.DownloadMessageUiControllerImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule should be required for tests only, why we need it in the main proguard file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. I'll remove it here and will add in tests
ec5b4cc
to
649dea5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -35,6 +39,17 @@ public void onCreate(Bundle savedInstanceState) { | |||
(ChromeSwitchPreference) findPreference(PREF_AUTOMATICALLY_OPEN_WHEN_POSSIBLE); | |||
mAutomaticallyOpenWhenPossiblePref.setOnPreferenceChangeListener(this); | |||
|
|||
mDownloadProgressNotificationBubblePref = | |||
(ChromeSwitchPreference) findPreference(PREF_DOWNLOAD_PROGRESS_NOTIFICATION_BUBBLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check for null here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is needed as we are adding this ChromeSwitchPreference from our brave_download_preferences.xml
@@ -66,6 +87,13 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { | |||
BravePreferenceKeys.BRAVE_DOWNLOADS_AUTOMATICALLY_OPEN_WHEN_POSSIBLE, | |||
(boolean) newValue) | |||
.apply(); | |||
} else if (PREF_DOWNLOAD_PROGRESS_NOTIFICATION_BUBBLE.equals(preference.getKey())) { | |||
ContextUtils.getAppSharedPreferences() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use SharedPreferenceManager here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this. we are already using ContextUtils.getAppSharedPreferences()
in download setting's another item
|
||
package org.chromium.chrome.browser.preferences; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason to change package ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wants to access BravePreferenceKeys in browser/download/internal/android/java/src/org/chromium/chrome/browser/download/BraveDownloadMessageUiControllerImpl.java
and from @samartnik's suggestion #16556 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Resolves brave/brave-browser#25611
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: