-
Notifications
You must be signed in to change notification settings - Fork 988
[ads] Survey panelist: Android #29360
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
Conversation
Warning You have got a presubmit warning. Please address it if possible.
Items:
|
Warning You have got a presubmit warning. Please address it if possible.
|
Warning You have got a presubmit warning. Please address it if possible.
|
1 similar comment
Warning You have got a presubmit warning. Please address it if possible.
|
@@ -39,4 +39,5 @@ public abstract class BraveFeatureList { | |||
public static final String BRAVE_SHIELDS_ELEMENT_PICKER = "BraveShieldsElementPicker"; | |||
public static final String BRAVE_WEB_DISCOVERY_NATIVE = "BraveWebDiscoveryNative"; | |||
public static final String BRAVE_INCOGNITO_SCREENSHOT = "incognito-screenshot"; | |||
public static final String BRAVE_SURVEY_PANELIST = "BraveNTPBrandedWallpaperSurveyPanelist"; |
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.
nit: Match string to variable name
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.
Fixed
@@ -174,6 +180,7 @@ public class BravePrivacySettings extends PrivacySettings { | |||
PREF_SEND_P3A, | |||
PREF_SEND_CRASH_REPORTS, | |||
PREF_BRAVE_STATS_USAGE_PING, | |||
PREF_BRAVE_SURVEY_PANELIST, |
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.
nit: Do we need brave in the name?
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 needed, removed.
@@ -104,6 +107,9 @@ public class BravePrivacySettings extends PrivacySettings { | |||
private static final String PREF_SEND_P3A = "send_p3a_analytics"; | |||
private static final String PREF_SEND_CRASH_REPORTS = "send_crash_reports"; | |||
private static final String PREF_BRAVE_STATS_USAGE_PING = "brave_stats_usage_ping"; | |||
private static final String PREF_BRAVE_SURVEY_PANELIST = "brave_survey_panelist"; | |||
private static final String PREF_BRAVE_SURVEY_PANELIST_LEARN_MORE = |
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.
nit: Do we need brave in the name?
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 needed, removed.
android:title="@string/send_crash_reports_title" | ||
android:summary="@string/send_crash_reports_summary" | ||
android:defaultValue="false" /> | ||
<org.chromium.components.browser_ui.settings.ChromeSwitchPreference | ||
android:key="brave_stats_usage_ping" | ||
android:order="25" |
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.
Were these intentionally removed?
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.
Yes these wee intentionally removed, as they broke order of new preference items.
Also android:order
attributes did nothing here before because they all had the same value.
@@ -774,6 +774,15 @@ This file contains all "about" strings. It is set to NOT be translated, in tran | |||
<message name="IDS_BRAVE_STATS_TEXT_TIME" desc="Title for the estimated saved time"> | |||
Est. Time\nSaved | |||
</message> | |||
<message name="IDS_BRAVE_SURVEY_PANELIST_TITLE" desc="Title for enable/disable brave survey panelist toggle."> |
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.
Do we need brave in the name? Same for below
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 needed, removed.
@@ -592,6 +623,11 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { | |||
(boolean) newValue, ChangeMetricsReportingStateCalledFrom.UI_SETTINGS); | |||
} else if (PREF_BRAVE_STATS_USAGE_PING.equals(key)) { | |||
BraveLocalState.get().setBoolean(BravePref.STATS_REPORTING_ENABLED, (boolean) newValue); | |||
} else if (PREF_BRAVE_SURVEY_PANELIST.equals(key)) { | |||
UserPrefs.get(ProfileManager.getLastUsedRegularProfile()) |
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.
use getProfile()
. We are going to refactor other places inside BravePrivacySettings
later.
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.
Fixed
@@ -784,6 +820,10 @@ private void updateBravePreferences() { | |||
mBraveStatsUsagePing.setChecked( | |||
BraveLocalState.get().getBoolean(BravePref.STATS_REPORTING_ENABLED)); | |||
|
|||
mBraveSurveyPanelist.setChecked( | |||
UserPrefs.get(ProfileManager.getLastUsedRegularProfile()) |
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.
getProfile()
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.
Fixed
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.
++
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.
chromium_src
, DEPS
, strings
++
Released in v1.81.47 |
The PR adds
Allow Brave surveys
setting in Android settings:Resolves brave/brave-browser#45992
Test case 1
BraveNTPBrandedWallpaperSurveyPanelist
feature disabledPrivacy and security
settingsEXPECTATION:
Allow Brave surveys
setting is not availableTest case 2
BraveNTPBrandedWallpaperSurveyPanelist
feature enabledPrivacy and security
settingsEXPECTATION:
Allow Brave surveys
setting is disabled by defaultLearn more about Brave surveys
linkEXPECTATION:
Brave surveys
help page is opened