Skip to content

Re-enable P3A and remove the backfill (uplift to 1.32.x) #11084

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

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,6 @@ public void finishNativeInitialization() {
BraveSyncInformers.show();
BraveAndroidSyncDisabledInformer.showInformers();

if (!PackageUtils.isFirstInstall(this)
&& !OnboardingPrefManager.getInstance().isP3AEnabledForExistingUsers()) {
BravePrefServiceBridge.getInstance().setP3AEnabled(true);
OnboardingPrefManager.getInstance().setP3AEnabledForExistingUsers(true);
}

if (!OnboardingPrefManager.getInstance().isOneTimeNotificationStarted()
&& PackageUtils.isFirstInstall(this)) {
RetentionNotificationUtil.scheduleNotification(this, RetentionNotificationUtil.HOUR_3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
public class OnboardingPrefManager {
private static final String PREF_ONBOARDING = "onboarding";
private static final String PREF_P3A_ONBOARDING = "p3a_onboarding";
private static final String PREF_P3A_ENABLED_FOR_EXISTING_USERS =
"p3a_enabled_for_existing_users";
private static final String PREF_CROSS_PROMO_MODAL = "cross_promo_modal";
private static final String PREF_ONBOARDING_V2 = "onboarding_v2";
private static final String PREF_NEXT_ONBOARDING_DATE = "next_onboarding_date";
Expand Down Expand Up @@ -109,16 +107,6 @@ public void setOnboardingShown(boolean isShown) {
sharedPreferencesEditor.apply();
}

public boolean isP3AEnabledForExistingUsers() {
return mSharedPreferences.getBoolean(PREF_P3A_ENABLED_FOR_EXISTING_USERS, false);
}

public void setP3AEnabledForExistingUsers(boolean isShown) {
SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
sharedPreferencesEditor.putBoolean(PREF_P3A_ENABLED_FOR_EXISTING_USERS, isShown);
sharedPreferencesEditor.apply();
}

/**
* Returns the user preference for whether the onboarding is shown.
*/
Expand Down
6 changes: 0 additions & 6 deletions components/p3a/brave_p3a_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ void BraveP3AService::StartScheduledUpload() {

// Only upload if service is enabled.
bool p3a_enabled = local_state_->GetBoolean(brave::kP3AEnabled);
#if defined(OS_ANDROID)
p3a_enabled = false;
#endif // OS_ANDROID
if (p3a_enabled) {
const std::string log = log_store_->staged_log();
const std::string log_type = log_store_->staged_log_type();
Expand All @@ -417,9 +414,6 @@ void BraveP3AService::StartScheduledUpload() {
void BraveP3AService::OnHistogramChanged(const char* histogram_name,
uint64_t name_hash,
base::HistogramBase::Sample sample) {
#if defined(OS_ANDROID)
return;
#endif // OS_ANDROID
std::unique_ptr<base::HistogramSamples> samples =
base::StatisticsRecorder::FindHistogram(histogram_name)->SnapshotDelta();

Expand Down