Skip to content

Commit

Permalink
Merge pull request #11083 from brave/pr11063_bsc-reenable-p3a-android…
Browse files Browse the repository at this point in the history
…_1.33.x

Re-enable P3A and remove the backfill (uplift to 1.33.x)
  • Loading branch information
kjozwiak authored Nov 23, 2021
2 parents 6ca3a8a + 0c92edb commit 2a373aa
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,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 @@ -398,9 +398,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 @@ -413,9 +410,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

0 comments on commit 2a373aa

Please sign in to comment.