jenkins-bot has submitted this change and it was merged.

Change subject: Do not send X-WMF-UUID header if the user has opted out of 
EventLogging.
......................................................................


Do not send X-WMF-UUID header if the user has opted out of EventLogging.

If the user has opted out of EventLogging then we shouldn't be tracking them
at all. This includes unique counting using the app install ID. This patch
ensures that the app install ID not transmitted if the user has opted out.

Bug: T85243
Change-Id: Ie6b9aea9708d382119372febd9b8c849360fd5ef
---
M wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  BearND: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java 
b/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
index 5733bd7..e0e8a48 100644
--- a/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
+++ b/wikipedia/src/main/java/org/wikipedia/WikipediaApp.java
@@ -277,7 +277,10 @@
         // 
https://lists.wikimedia.org/pipermail/wikimedia-l/2014-April/071131.html
         HashMap<String, String> customHeaders = new HashMap<String, String>();
         customHeaders.put("User-Agent", getUserAgent());
-        customHeaders.put("X-WMF-UUID", getAppInstallID());
+        // Add the app install ID to the header, but only if the user has not 
opted out of logging
+        if (isEventLoggingEnabled()) {
+            customHeaders.put("X-WMF-UUID", getAppInstallID());
+        }
         String acceptLanguage = getAcceptLanguage();
 
         // TODO: once we're not constraining this to just Chinese, add the 
header unconditionally.

-- 
To view, visit https://gerrit.wikimedia.org/r/181673
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6b9aea9708d382119372febd9b8c849360fd5ef
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Deskana <dga...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to