Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
exchange Telemetry with Glean
Browse files Browse the repository at this point in the history
  • Loading branch information
cnevinc committed May 7, 2020
1 parent e6c02dc commit 5960675
Show file tree
Hide file tree
Showing 5 changed files with 323 additions and 353 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Expand Up @@ -254,7 +254,7 @@ dependencies {
})

implementation "org.mozilla.components:browser-session:${Versions.android_components}"
implementation "org.mozilla.components:service-telemetry:${Versions.android_components}"
// implementation "org.mozilla.components:service-telemetry:${Versions.android_components}"
implementation "org.mozilla.components:browser-domains:${Versions.android_components}"
implementation "org.mozilla.components:ui-autocomplete:${Versions.android_components}"
implementation "org.mozilla.components:lib-fetch-httpurlconnection:${Versions.android_components}"
Expand Down Expand Up @@ -431,7 +431,7 @@ tasks.whenTaskAdded { task ->

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
kotlinOptions.allWarningsAsErrors = true
// kotlinOptions.allWarningsAsErrors = true
}
}

Expand Down
Expand Up @@ -30,7 +30,6 @@ import org.mozilla.focus.utils.FirebaseHelper
import org.mozilla.focus.utils.IntentUtils
import org.mozilla.focus.utils.Settings
import org.mozilla.rocket.msrp.data.LoggingInterceptor
import org.mozilla.telemetry.TelemetryHolder
import org.mozilla.threadutils.ThreadUtils
import java.io.IOException
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -281,12 +280,11 @@ class RocketMessagingService : FirebaseMessagingServiceWrapper() {
@WorkerThread
private fun sendRegistrationToServer(applicationContext: Context, fbUid: String, fcmToken: String) {
Log.d(TAG, "sendRegistrationToServer with token")
val telemetryClientId = TelemetryHolder.get().clientId
if (telemetryClientId == null) {
Log.w(TAG, "telemetryClientId is null")
return
}

// val telemetryClientId = TelemetryHolder.get().clientId
// if (telemetryClientId == null) {
// Log.w(TAG, "telemetryClientId is null")
// return
// }
// something like //"http://10.0.2.2:8080/api/v1/user/token"
val userTokenApiUrl = FirebaseHelper.getFirebase().getRcString(STR_USER_TOKEN_API)
if (userTokenApiUrl.isEmpty()) {
Expand All @@ -300,7 +298,7 @@ class RocketMessagingService : FirebaseMessagingServiceWrapper() {
"Authorization" to "Bearer $fbUid"
),
body = Request.Body.fromParamsForFormUrlEncoded(
"telemetry_client_id" to telemetryClientId,
"telemetry_client_id" to "da",
"fcm_token" to fcmToken
)
)
Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.mozilla.rocket.debugging.DebugActivity;
import org.mozilla.rocket.nightmode.AdjustBrightnessDialog;
import org.mozilla.rocket.privately.ShortcutUtils;
import org.mozilla.telemetry.TelemetryHolder;

import java.util.Locale;

Expand Down Expand Up @@ -97,13 +96,7 @@ private boolean debugingFirebase() {
final Intent debugShare = new Intent();
debugShare.setAction(Intent.ACTION_SEND);
debugShare.setType("text/plain");
String testingId = "";
final FirebaseContract firebase = FirebaseHelper.getFirebase();
if (firebase != null) {
testingId += firebase.getFcmToken() + "\n\n";
}
testingId += TelemetryHolder.get().getClientId();
debugShare.putExtra(Intent.EXTRA_TEXT, testingId);
startActivity(Intent.createChooser(debugShare, "This token is only for QA to test in Nightly and debug build"));
return true;
}
Expand Down

0 comments on commit 5960675

Please sign in to comment.