Bug 1388300 - WIP
MozReview-Commit-ID: JSowqeKlq4j
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -234,30 +234,21 @@ dependencies {
compile "com.android.support:recyclerview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:design:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:customtabs:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:palette-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
compile "com.android.support:mediarouter-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
- compile "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-cast:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
}
- if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
- compile "com.google.android.gms:play-services-ads:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
- compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
- }
-
if (mozconfig.substs.MOZ_ANDROID_GCM) {
- compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
- compile "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
- compile "com.google.android.gms:play-services-measurement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
}
// Include LeakCanary in most gradle based builds. LeakCanary adds about 5k methods, so we disable
// it for the (non-proguarded, non-predex) localOld builds to allow space for other libraries.
// Gradle based tests include the no-op version. Mach based builds only include the no-op version
// of this library.
// It doesn't seem like there is a non-trivial way to be conditional on 'localOld', so instead we explicitly
// define a version of leakcanary for every flavor:
--- a/mobile/android/base/java/org/mozilla/gecko/push/PushManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/push/PushManager.java
@@ -7,16 +7,17 @@ package org.mozilla.gecko.push;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import org.json.JSONObject;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.gcm.GcmTokenClient;
+import org.mozilla.gecko.mma.MmaDelegate;
import org.mozilla.gecko.push.autopush.AutopushClientException;
import org.mozilla.gecko.util.ThreadUtils;
import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
--- a/mobile/android/thirdparty/com/leanplum/internal/Util.java
+++ b/mobile/android/thirdparty/com/leanplum/internal/Util.java
@@ -36,17 +36,16 @@ import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import android.os.Build;
import android.provider.Settings.Secure;
import android.support.annotation.RequiresPermission;
import android.text.TextUtils;
import android.util.TypedValue;
-import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.leanplum.Leanplum;
import com.leanplum.LeanplumActivityHelper;
import com.leanplum.LeanplumDeviceIdMode;
import com.leanplum.LeanplumException;
import com.leanplum.internal.Constants.Methods;
import com.leanplum.internal.Constants.Params;
import org.json.JSONException;
@@ -195,29 +194,16 @@ public class Util {
return null;
}
/**
* Retrieves the advertising ID. Requires Google Play Services. Note: This method must not run on
* the main thread.
*/
private static DeviceIdInfo getAdvertisingId(Context caller) throws Exception {
- try {
- AdvertisingIdClient.Info info = AdvertisingIdClient.getAdvertisingIdInfo(caller);
- if (info != null) {
- String advertisingId = info.getId();
- String deviceId = checkDeviceId("advertising id", advertisingId);
- if (deviceId != null) {
- boolean limitedTracking = info.isLimitAdTrackingEnabled();
- return new DeviceIdInfo(deviceId, limitedTracking);
- }
- }
- } catch (Throwable t) {
- Log.e("Error getting advertising ID. Google Play Services are not available: ", t);
- }
return null;
}
private static String getAndroidId(Context context) {
@SuppressLint("HardwareIds")
String androidId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
if (androidId == null || androidId.isEmpty()) {
Log.i("Skipping Android device id; no id returned.");