Commit 1c3c42a6 authored by Nathan Froyd's avatar Nathan Froyd
Browse files

Bug 722240 - Submit Telemetry only for official builds; r=taras

parent c505db2c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@ EXTRA_DSO_LDOPTS += \

TEST_DIRS += tests

ifdef MOZILLA_OFFICIAL
DEFINES += -DMOZILLA_OFFICIAL
endif

include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
+10 −0
Original line number Diff line number Diff line
@@ -694,6 +694,16 @@ TelemetryImpl::CanRecord() {
  return !sTelemetry || sTelemetry->mCanRecord;
}

NS_IMETHODIMP
TelemetryImpl::GetCanSend(bool *ret) {
#if defined(MOZILLA_OFFICIAL) && defined(MOZ_TELEMETRY_REPORTING)
  *ret = true;
#else
  *ret = false;
#endif
  return NS_OK;
}

already_AddRefed<nsITelemetry>
TelemetryImpl::CreateTelemetryInstance()
{
+4 −1
Original line number Diff line number Diff line
@@ -573,7 +573,10 @@ TelemetryPing.prototype = {
        idleService.removeIdleObserver(this, IDLE_TIMEOUT_SECONDS);
        this._isIdleObserver = false;
      }
      this.send(aTopic == "idle" ? "idle-daily" : aTopic, server);
      reason = (Telemetry.canSend && aTopic == "idle"
		? "idle-daily"
		: "test-ping");
      this.send(reason, server);
      break;
    }
  },
+5 −0
Original line number Diff line number Diff line
@@ -131,4 +131,9 @@ interface nsITelemetry : nsISupports
   * Set this to false to disable gathering of telemetry statistics.
   */
  attribute boolean canRecord;

  /**
   * A flag indicating whether Telemetry can submit official results.
   */
  readonly attribute boolean canSend;
};