Backed out 7 changesets (bug 1419581) for B bustage on /builds/worker/workspace/build/src/widget/android/nsWindow.h:0 on a CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Wed, 17 Jan 2018 00:03:19 +0200
changeset 453825 a6a0d6dc6548ecd11238e8208736c03a17e52e10
parent 453824 b5495d7f42a69017bf88aa697a451faafa4bc39d
child 453833 1080244fbe53820b20613d71ceb1c2b9ac58aead
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1419581
milestone59.0a1
backs out1af5a54e829de694b96b2ee5a0cf5d2478677afb
c9aef37de282ab1dc6c64c978fccc9ed255b068f
8d0855cb17b7168aed64780b1fb127a5ac416661
d0eba5853ab6102049d1abcbb9fc863848a6b86b
bc4cda1cc57cf032ac373911a372f45d1c6d4da8
93547276fba805541a03a47c99516a61846e0cc5
45b5309a73cbde68fab5b75168bbeaba076ff238
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 7 changesets (bug 1419581) for B bustage on /builds/worker/workspace/build/src/widget/android/nsWindow.h:0 on a CLOSED TREE Backed out changeset 1af5a54e829d (bug 1419581) Backed out changeset c9aef37de282 (bug 1419581) Backed out changeset 8d0855cb17b7 (bug 1419581) Backed out changeset d0eba5853ab6 (bug 1419581) Backed out changeset bc4cda1cc57c (bug 1419581) Backed out changeset 93547276fba8 (bug 1419581) Backed out changeset 45b5309a73cb (bug 1419581)
mobile/android/app/build.gradle
mobile/android/app/src/test/java/org/mozilla/gecko/push/TestPushManager.java
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/AppConstants.java.in
mobile/android/base/Makefile.in
mobile/android/base/java/org/mozilla/gecko/PresentationMediaPlayerManager.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaInterface.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaLeanplumImp.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaStubImp.java
mobile/android/base/java/org/mozilla/gecko/push/PushManager.java
mobile/android/config/mozconfigs/android-api-16/nightly-without-google-play-services
mobile/android/docs/mma.rst
mobile/android/moz.configure
taskcluster/ci/build/android.yml
testing/mozharness/configs/builds/releng_sub_android_configs/64_api_16_without_google_play_services.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
widget/android/fennec/FennecJNINatives.h
widget/android/fennec/FennecJNIWrappers.cpp
widget/android/fennec/FennecJNIWrappers.h
widget/android/nsWindow.cpp
widget/android/nsWindow.h
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -118,18 +118,16 @@ android {
                 }
 
                 if (!mozconfig.substs.MOZ_NATIVE_DEVICES) {
                     exclude 'org/mozilla/gecko/ChromeCastDisplay.java'
                     exclude 'org/mozilla/gecko/ChromeCastPlayer.java'
                     exclude 'org/mozilla/gecko/GeckoMediaPlayer.java'
                     exclude 'org/mozilla/gecko/GeckoPresentationDisplay.java'
                     exclude 'org/mozilla/gecko/MediaPlayerManager.java'
-                    exclude 'org/mozilla/gecko/PresentationMediaPlayerManager.java'
-                    exclude 'org/mozilla/gecko/RemotePresentationService.java'
                 }
 
                 if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
                     exclude 'org/mozilla/gecko/adjust/StubAdjustHelper.java'
                 } else {
                     exclude 'org/mozilla/gecko/adjust/AdjustHelper.java'
                 }
 
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/push/TestPushManager.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/push/TestPushManager.java
@@ -185,17 +185,17 @@ public class TestPushManager {
         // Un-subscribing from an unknown channel succeeds: we just ignore the request.
         manager.unsubscribeChannel(UUID.randomUUID().toString());
     }
 
     @Test
     public void testStartupBeforeConfiguration() throws Exception {
         verify(gcmTokenClient, never()).getToken(anyString(), anyBoolean());
         manager.startup(System.currentTimeMillis());
-        verify(gcmTokenClient, times(1)).getToken(AppConstants.MOZ_ANDROID_GCM_SENDERIDS, false);
+        verify(gcmTokenClient, times(1)).getToken(AppConstants.MOZ_ANDROID_GCM_SENDERID, false);
     }
 
     @Test
     public void testStartupBeforeRegistration() throws Exception {
         PushRegistration registration = manager.configure("default", "http://localhost:8080", true, System.currentTimeMillis());
         assertOnlyConfigured(registration, "http://localhost:8080", true);
 
         manager.startup(System.currentTimeMillis());
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -38,23 +38,21 @@
 #else
                  android:debuggable="false">
 #endif
 
         <meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
 
         <meta-data android:name="android.max_aspect" android:value="2.1"/>
 
-#ifdef MOZ_ANDROID_GOOGLE_PLAY_SERVICES
+#ifdef MOZ_NATIVE_DEVICES
         <!-- This resources comes from Google Play Services. Required for casting support. -->
         <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
-#endif
+        <service android:name="org.mozilla.gecko.RemotePresentationService" android:exported="false"/>
 
-#ifdef MOZ_NATIVE_DEVICES
-        <service android:name="org.mozilla.gecko.RemotePresentationService" android:exported="false"/>
 #endif
 
         <!-- This activity handles all incoming Intents and dispatches them to other activities. -->
         <activity android:name="org.mozilla.gecko.LauncherActivity"
             android:theme="@android:style/Theme.Translucent.NoTitleBar"
             android:relinquishTaskIdentity="true"
             android:taskAffinity=""
             android:exported="true"
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -109,26 +109,22 @@ public class AppConstants {
 
     public static final boolean MOZ_ANDROID_GCM =
 //#ifdef MOZ_ANDROID_GCM
     true;
 //#else
     false;
 //#endif
 
-    public static final String MOZ_ANDROID_GCM_SENDERIDS =
-//#ifdef MOZ_MMA_GCM_SENDERID
-    "@MOZ_ANDROID_GCM_SENDERID@,@MOZ_MMA_GCM_SENDERID@";
-//#else
+    public static final String MOZ_ANDROID_GCM_SENDERID =
 //#ifdef MOZ_ANDROID_GCM_SENDERID
     "@MOZ_ANDROID_GCM_SENDERID@";
 //#else
     null;
 //#endif
-//#endif
 
     public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@";
     public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
     public static final String OMNIJAR_NAME = "@OMNIJAR_NAME@";
     public static final String OS_TARGET = "@OS_TARGET@";
     public static final String TARGET_XPCOM_ABI = "@TARGET_XPCOM_ABI@";
 
     public static final String USER_AGENT_BOT_LIKE = "Redirector/" + AppConstants.MOZ_APP_VERSION +
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -49,25 +49,22 @@ JAVA_CLASSPATH += \
     $(ANDROID_ANIMATED_VECTOR_DRAWABLE_AAR_LIB) \
     $(ANDROID_CARDVIEW_V7_AAR_LIB) \
     $(ANDROID_DESIGN_AAR_LIB) \
     $(ANDROID_RECYCLERVIEW_V7_AAR_LIB) \
     $(ANDROID_CUSTOMTABS_AAR_LIB) \
     $(ANDROID_PALETTE_V7_AAR_LIB) \
     $(NULL)
 
-ifdef MOZ_ANDROID_GOOGLE_PLAY_SERVICES
+# If native devices are enabled, add Google Play Services and some of the v7
+# compat libraries.
+ifdef MOZ_NATIVE_DEVICES
     JAVA_CLASSPATH += \
         $(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
         $(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
-        $(NULL)
-endif
-
-ifdef MOZ_NATIVE_DEVICES
-    JAVA_CLASSPATH += \
         $(ANDROID_PLAY_SERVICES_CAST_AAR_LIB) \
         $(ANDROID_MEDIAROUTER_V7_AAR_LIB) \
         $(ANDROID_MEDIAROUTER_V7_AAR_INTERNAL_LIB) \
         $(NULL)
 endif
 
 ifdef MOZ_ANDROID_GCM
     JAVA_CLASSPATH += \
@@ -80,17 +77,17 @@ endif
 
 ifdef MOZ_INSTALL_TRACKING
     JAVA_CLASSPATH += \
         $(ANDROID_PLAY_SERVICES_ADS_AAR_LIB) \
         $(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
         $(NULL)
 endif
 
-# MOZ_ANDROID_MMA requires MOZ_ANDROID_GCM and MOZ_ANDROID_GOOGLE_PLAY_SERVICES,
+# MOZ_ANDROID_MMA requires MOZ_ANDROID_GCM and MOZ_NATIVE_DEVICES,
 # which take care of the Play Services requirements in JAVA_CLASSPATH.
 # Based on the import of
 # `com.google.android.gms.ads.identifier.AdvertisingIdClient` in
 # `com.leanplum.internal.Util` one would assume that
 # `play-services-ads` is required, by in version 8.4.0 (at least) that
 # class is defined in `play-services-basement`.  Therefore, unlike
 # MOZ_INSTALL_TRACKING, we don't need to depend on
 # `play-services-ads`.
@@ -107,23 +104,16 @@ java_bundled_libs := \
     $(ANDROID_ANIMATED_VECTOR_DRAWABLE_AAR_LIB) \
     $(ANDROID_CARDVIEW_V7_AAR_LIB) \
     $(ANDROID_DESIGN_AAR_LIB) \
     $(ANDROID_RECYCLERVIEW_V7_AAR_LIB) \
     $(ANDROID_CUSTOMTABS_AAR_LIB) \
     $(ANDROID_PALETTE_V7_AAR_LIB) \
     $(NULL)
 
-ifdef MOZ_ANDROID_GOOGLE_PLAY_SERVICES
-    java_bundled_libs += \
-        $(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
-        $(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
-        $(NULL)
-endif
-
 ifdef MOZ_NATIVE_DEVICES
     java_bundled_libs += \
         $(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
         $(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
         $(ANDROID_PLAY_SERVICES_CAST_AAR_LIB) \
         $(ANDROID_MEDIAROUTER_V7_AAR_LIB) \
         $(ANDROID_MEDIAROUTER_V7_AAR_INTERNAL_LIB) \
         $(NULL)
@@ -140,17 +130,17 @@ endif
 
 ifdef MOZ_INSTALL_TRACKING
     java_bundled_libs += \
         $(ANDROID_PLAY_SERVICES_ADS_AAR_LIB) \
         $(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
         $(NULL)
 endif
 
-# MOZ_ANDROID_MMA requires MOZ_ANDROID_GCM and MOZ_ANDROID_GOOGLE_PLAY_SERVICES,
+# MOZ_ANDROID_MMA requires MOZ_ANDROID_GCM and MOZ_NATIVE_DEVICES,
 # which take care of the Play Services requirements in
 # java_bundled_libs.  See the note above.
 
 # uniq purloined from http://stackoverflow.com/a/16151140.
 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 
 java_bundled_libs := $(call uniq,$(java_bundled_libs))
 java_bundled_libs := $(subst $(NULL) ,:,$(strip $(java_bundled_libs)))
@@ -555,17 +545,16 @@ endif
 #   GeneratedJNIWrappers.h and GeneratedJNINatives.h
 # FennecJNIWrappers.cpp target also generates
 #   FennecJNIWrappers.h and FennecJNINatives.h
 
 # List of build flags used by auto-generated JNI bindings (through the
 # @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this
 # list to support @BuildFlag(MOZ_FOO).
 BINDING_BUILD_FLAGS = \
-  MOZ_NATIVE_DEVICES \
   $(NULL)
 
 # Preprocess a JNI binding file using the build flags defined above.
 # $(1): JNI binding file to preprocess.
 preprocess-binding = ($(call py_action,preprocessor, \
                       $(foreach flag,$(BINDING_BUILD_FLAGS),$(if $($(flag)),-D$(flag))) \
                       -DMOZ_PREPROCESSOR $(1)) || echo $(1))
 
--- a/mobile/android/base/java/org/mozilla/gecko/PresentationMediaPlayerManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/PresentationMediaPlayerManager.java
@@ -15,23 +15,21 @@ import android.view.Display;
 import android.view.Surface;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
 import android.view.ViewGroup;
 import android.view.WindowManager;
 
 import org.mozilla.gecko.AppConstants.Versions;
 
-import org.mozilla.gecko.annotation.BuildFlag;
 import org.mozilla.gecko.annotation.WrapForJNI;
 
 /**
  * A MediaPlayerManager with API 17+ Presentation support.
  */
-@BuildFlag("MOZ_NATIVE_DEVICES")
 @TargetApi(17)
 public class PresentationMediaPlayerManager extends MediaPlayerManager {
 
     private static final String LOGTAG = "Gecko" + PresentationMediaPlayerManager.class.getSimpleName();
 
     private GeckoPresentation presentation;
 
     public PresentationMediaPlayerManager() {
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
@@ -20,16 +20,17 @@ import android.text.TextUtils;
 import org.mozilla.gecko.Experiments;
 import org.mozilla.gecko.MmaConstants;
 import org.mozilla.gecko.PrefsHelper;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.fxa.FirefoxAccounts;
 import org.mozilla.gecko.preferences.GeckoPreferences;
+import org.mozilla.gecko.push.PushManager;
 import org.mozilla.gecko.switchboard.SwitchBoard;
 import org.mozilla.gecko.util.ContextUtils;
 
 import java.lang.ref.WeakReference;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
@@ -69,16 +70,17 @@ public class MmaDelegate {
     private static WeakReference<Context> applicationContext;
 
     public static void init(Activity activity) {
         applicationContext = new WeakReference<>(activity.getApplicationContext());
         // Since user attributes are gathered in Fennec, not in MMA implementation,
         // we gather the information here then pass to mmaHelper.init()
         // Note that generateUserAttribute always return a non null HashMap.
         final Map<String, Object> attributes = gatherUserAttributes(activity);
+        mmaHelper.setGcmSenderId(PushManager.getSenderIds());
         final String deviceId = getDeviceId(activity);
         mmaHelper.setDeviceId(deviceId);
         PrefsHelper.setPref(GeckoPreferences.PREFS_MMA_DEVICE_ID, deviceId);
         // above two config setup required to be invoked before mmaHelper.init.
         mmaHelper.init(activity, attributes);
 
         if (!isDefaultBrowser(activity)) {
             mmaHelper.event(MmaDelegate.LAUNCH_BUT_NOT_DEFAULT_BROWSER);
@@ -154,16 +156,20 @@ public class MmaDelegate {
         if (isMmaEnabled(context)) {
             mmaHelper.setCustomIcon(R.drawable.ic_status_logo);
             return mmaHelper.handleGcmMessage(context, from, bundle);
         } else {
             return false;
         }
     }
 
+    public static String getMmaSenderId() {
+        return mmaHelper.getMmaSenderId();
+    }
+
     private static String getDeviceId(Activity activity) {
         if (SwitchBoard.isInExperiment(activity, Experiments.LEANPLUM_DEBUG)) {
             return DEBUG_LEANPLUM_DEVICE_ID;
         }
 
         final SharedPreferences sharedPreferences = activity.getPreferences(Context.MODE_PRIVATE);
         String deviceId = sharedPreferences.getString(KEY_ANDROID_PREF_STRING_LEANPLUM_DEVICE_ID, null);
         if (deviceId == null) {
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaInterface.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaInterface.java
@@ -15,22 +15,26 @@ import android.support.annotation.NonNul
 
 import java.util.Map;
 
 
 public interface MmaInterface {
 
     void init(Activity Activity, Map<String, ?> attributes);
 
+    void setGcmSenderId(String senderIds);
+
     void setCustomIcon(@DrawableRes int iconResId);
 
     void start(Context context);
 
     void event(String mmaEvent);
 
     void event(String mmaEvent, double value);
 
     void stop();
 
     @CheckResult boolean handleGcmMessage(Context context, String from, Bundle bundle);
 
+    String getMmaSenderId();
+
     void setDeviceId(@NonNull String deviceId);
 }
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaLeanplumImp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaLeanplumImp.java
@@ -41,18 +41,16 @@ public class MmaLeanplumImp implements M
         LeanplumActivityHelper.enableLifecycleCallbacks(activity.getApplication());
 
         if (AppConstants.MOZILLA_OFFICIAL) {
             Leanplum.setAppIdForProductionMode(MmaConstants.MOZ_LEANPLUM_SDK_CLIENTID, MmaConstants.MOZ_LEANPLUM_SDK_KEY);
         } else {
             Leanplum.setAppIdForDevelopmentMode(MmaConstants.MOZ_LEANPLUM_SDK_CLIENTID, MmaConstants.MOZ_LEANPLUM_SDK_KEY);
         }
 
-        LeanplumPushService.setGcmSenderId(AppConstants.MOZ_ANDROID_GCM_SENDERIDS);
-
         if (attributes != null) {
             Leanplum.start(activity, attributes);
         } else {
             Leanplum.start(activity);
         }
 
         // this is special to Leanplum. Since we defer LeanplumActivityHelper's onResume call till
         // switchboard completes loading. We miss the call to LeanplumActivityHelper.onResume.
@@ -67,16 +65,21 @@ public class MmaLeanplumImp implements M
             @Override
             public void run() {
                 LeanplumActivityHelper.onResume(activity);
             }
         });
     }
 
     @Override
+    public void setGcmSenderId(String senderIds) {
+        LeanplumPushService.setGcmSenderId(senderIds);
+    }
+
+    @Override
     public void setCustomIcon(@DrawableRes final int iconResId) {
         LeanplumPushService.setCustomizer(new LeanplumPushNotificationCustomizer() {
             @Override
             public void customize(NotificationCompat.Builder builder, Bundle notificationPayload) {
                 builder.setSmallIcon(iconResId);
                 builder.setDefaults(Notification.DEFAULT_SOUND);
             }
 
@@ -110,13 +113,18 @@ public class MmaLeanplumImp implements M
         if (from != null && from.equals(MmaConstants.MOZ_MMA_SENDER_ID) && bundle.containsKey(Constants.Keys.PUSH_MESSAGE_TEXT)) {
             LeanplumPushService.handleNotification(context, bundle);
             return true;
         }
         return false;
     }
 
     @Override
+    public String getMmaSenderId() {
+        return MmaConstants.MOZ_MMA_SENDER_ID;
+    }
+
+    @Override
     public void setDeviceId(@NonNull String deviceId) {
         Leanplum.setDeviceId(deviceId);
     }
 
 }
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaStubImp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaStubImp.java
@@ -17,16 +17,21 @@ import java.util.Map;
 
 public class MmaStubImp implements MmaInterface {
     @Override
     public void init(Activity activity, Map<String, ?> attributes) {
 
     }
 
     @Override
+    public void setGcmSenderId(String senderIds) {
+
+    }
+
+    @Override
     public void setCustomIcon(@DrawableRes int iconResId) {
 
     }
 
     @Override
     public void start(Context context) {
 
     }
@@ -47,13 +52,18 @@ public class MmaStubImp implements MmaIn
     }
 
     @Override
     public boolean handleGcmMessage(Context context, String from, Bundle bundle) {
         return false;
     }
 
     @Override
+    public String getMmaSenderId() {
+        return "";
+    }
+
+    @Override
     public void setDeviceId(@NonNull String deviceId) {
 
     }
 
 }
--- a/mobile/android/base/java/org/mozilla/gecko/push/PushManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/push/PushManager.java
@@ -52,16 +52,25 @@ public class PushManager {
     }
 
     public PushManager(@NonNull PushState state, @NonNull GcmTokenClient gcmClient, @NonNull PushClientFactory pushClientFactory) {
         this.state = state;
         this.gcmClient = gcmClient;
         this.pushClientFactory = pushClientFactory;
     }
 
+    public static String getSenderIds() {
+        final String mmaSenderId = MmaDelegate.getMmaSenderId();
+        if (mmaSenderId != null && mmaSenderId.length() > 0) {
+            return AppConstants.MOZ_ANDROID_GCM_SENDERID + "," + mmaSenderId;
+        } else {
+            return AppConstants.MOZ_ANDROID_GCM_SENDERID;
+        }
+    }
+
     public PushRegistration registrationForSubscription(String chid) {
         // chids are globally unique, so we're not concerned about finding a chid associated to
         // any particular profile.
         for (Map.Entry<String, PushRegistration> entry : state.getRegistrations().entrySet()) {
             final PushSubscription subscription = entry.getValue().getSubscription(chid);
             if (subscription != null) {
                 return entry.getValue();
             }
@@ -239,17 +248,17 @@ public class PushManager {
         if (registration == null || registration.autopushEndpoint == null) {
             Log.i(LOG_TAG, "Cannot advance to registered: registration needs configuration.");
             throw new ProfileNeedsConfigurationException();
         }
         return advanceRegistration(registration, profileName, now);
     }
 
     protected @NonNull PushRegistration advanceRegistration(final PushRegistration registration, final @NonNull String profileName, final long now) throws AutopushClientException, PushClient.LocalException, GcmTokenClient.NeedsGooglePlayServicesException, IOException {
-        final Fetched gcmToken = gcmClient.getToken(AppConstants.MOZ_ANDROID_GCM_SENDERIDS, registration.debug);
+        final Fetched gcmToken = gcmClient.getToken(getSenderIds(), registration.debug);
 
         final PushClient pushClient = pushClientFactory.getPushClient(registration.autopushEndpoint, registration.debug);
 
         if (registration.uaid.value == null) {
             if (registration.debug) {
                 Log.i(LOG_TAG, "No uaid; requesting from autopush endpoint: " + registration.autopushEndpoint);
             } else {
                 Log.i(LOG_TAG, "No uaid: requesting from autopush endpoint.");
@@ -291,17 +300,17 @@ public class PushManager {
 
     public void invalidateGcmToken() {
         gcmClient.invalidateToken();
     }
 
     public void startup(long now) {
         try {
             Log.i(LOG_TAG, "Startup: requesting GCM token.");
-            gcmClient.getToken(AppConstants.MOZ_ANDROID_GCM_SENDERIDS, false); // For side-effects.
+            gcmClient.getToken(getSenderIds(), false); // For side-effects.
         } catch (GcmTokenClient.NeedsGooglePlayServicesException e) {
             // Requires user intervention.  At App startup, we don't want to address this.  In
             // response to user activity, we do want to try to have the user address this.
             Log.w(LOG_TAG, "Startup: needs Google Play Services.  Ignoring until GCM is requested in response to user activity.");
             return;
         } catch (IOException e) {
             // We're temporarily unable to get a GCM token.  There's nothing to be done; we'll
             // try to advance the App's state in response to user activity or at next startup.
deleted file mode 100644
--- a/mobile/android/config/mozconfigs/android-api-16/nightly-without-google-play-services
+++ /dev/null
@@ -1,12 +0,0 @@
-. "$topsrcdir/build/mozconfig.artifact.automation"
-
-. "$topsrcdir/mobile/android/config/mozconfigs/common"
-
-. "$topsrcdir/mobile/android/config/mozconfigs/android-api-16/nightly"
-
-ac_add_options --without-google-play-services
-
-unset MOZ_ANDROID_MMA
-unset MOZ_ANDROID_POCKET
-
-. "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/docs/mma.rst
+++ b/mobile/android/docs/mma.rst
@@ -197,17 +197,17 @@ Technical notes
 Build flags controlling the Leanplum SDK integration
 ======================================================
 
 To test this locally, add lines like:
 
 export MOZ_ANDROID_MMA=1
 ac_add_options --with-leanplum-sdk-keyfile=/path/to/leanplum-sdk-developer.token
 
-MOZ_ANDROID_MMA depends on MOZ_ANDROID_GOOGLE_PLAY_SERVICES and MOZ_ANDROID_GCM.
+MOZ_ANDROID_MMA depends on MOZ_NATIVE_DEVICES and MOZ_ANDROID_GCM.
 Since Leanplum requires Google Play Services library, those flags are a proxy for it, and enable respectively.
 
 We want to enable MOZ_ANDROID_MMA in Nightly, but only for
 MOZILLA_OFFICIAL builds.  Since MOZILLA_OFFICIAL is still defined in
 old-configure.in, we can't integrate it in
 mobile/android/moz.configure, and therefore we enable using the
 automation mozconfigs.
 
--- a/mobile/android/moz.configure
+++ b/mobile/android/moz.configure
@@ -3,51 +3,35 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 project_flag('MOZ_ANDROID_EXCLUDE_FONTS',
              help='Whether to exclude font files from the build',
              default=True)
 
-option('--with-google-play-services',
-       help='Enable features that depend on non-free Google Play Services',
-       default=True)
-
-@depends('--with-google-play-services')
-def google_play_services(value):
-    return bool(value)
-
-set_config('MOZ_ANDROID_GOOGLE_PLAY_SERVICES', depends_if(google_play_services)(lambda _: True))
-
-set_config('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
-add_old_configure_assignment('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
-
-option(env='MOZ_ANDROID_GCM',
-       help='Enable GCM (Google Cloud Messaging) registration',
-       default=google_play_services)
-
-set_config('MOZ_ANDROID_GCM',
-           depends_if('MOZ_ANDROID_GCM')(lambda _: True))
-add_old_configure_assignment('MOZ_ANDROID_GCM',
-                             depends_if('MOZ_ANDROID_GCM')(lambda _: True))
+project_flag('MOZ_ANDROID_GCM',
+             help='Enable GCM (Google Cloud Messaging) registration',
+             default=True,
+             set_for_old_configure=True)
 
 option(env='MOZ_NATIVE_DEVICES',
        help='Enable second screen support using native Android libraries.',
-       default=google_play_services)
+       default=True)
 
 set_config('MOZ_NATIVE_DEVICES',
            depends_if('MOZ_NATIVE_DEVICES')(lambda _: True))
 add_old_configure_assignment('MOZ_NATIVE_DEVICES',
                              depends_if('MOZ_NATIVE_DEVICES')(lambda _: True))
 
-# Enable install tracking SDK if we have Google Play support.
-@depends(milestone, google_play_services, '--help')
-def install_tracking_default(milestone, google_play_services, help):
-    return bool(milestone.is_release_or_beta and google_play_services)
+# Enable install tracking SDK if we have Google Play support; MOZ_NATIVE_DEVICES
+# is a proxy flag for that support.
+@depends(milestone, 'MOZ_NATIVE_DEVICES', '--help')
+def install_tracking_default(milestone, native_devices, help):
+    return bool(milestone.is_release_or_beta and native_devices)
 
 option(env='MOZ_INSTALL_TRACKING',
        help='Enable install tracking (currently using the Adjust SDK).',
        default=install_tracking_default)
 
 set_config('MOZ_INSTALL_TRACKING',
            depends_if('MOZ_INSTALL_TRACKING')(lambda _: True))
 add_old_configure_assignment('MOZ_INSTALL_TRACKING',
@@ -114,69 +98,63 @@ set_config('MOZ_ANDROID_MOZILLA_ONLINE',
 
 imply_option('MOZ_SERVICES_HEALTHREPORT', True)
 imply_option('MOZ_ANDROID_HISTORY', True)
 imply_option('--enable-small-chunk-size', True)
 
 set_config('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0')
 add_old_configure_assignment('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0')
 
+set_config('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
+add_old_configure_assignment('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
+
 @depends(target)
 def check_target(target):
     if target.os != 'Android':
         log.error('You must specify --target=arm-linux-androideabi (or some '
                   'other valid Android target) when building mobile/android.')
         die('See https://developer.mozilla.org/docs/Mozilla/Developer_guide/'
             'Build_Instructions/Simple_Firefox_for_Android_build '
             'for more information about the necessary options.')
 
 include('../../toolkit/moz.configure')
 include('../../build/moz.configure/java.configure')
 include('gradle.configure')
 
 # Must come after the ../../toolkit/moz.configure.
-@depends('MOZ_INSTALL_TRACKING', google_play_services, '--with-adjust-sdk-keyfile')
+@depends('MOZ_INSTALL_TRACKING', 'MOZ_NATIVE_DEVICES', '--with-adjust-sdk-keyfile')
 def check_install_tracking(install_tracking,
-                           google_play_services,
+                           native_devices,
                            adjust_sdk_keyfile):
     if install_tracking:
-        if not google_play_services:
-            die('You must specify --with-google-play-services when'
+        if not native_devices:
+            die('You must specify MOZ_NATIVE_DEVICES=1 when'
                 ' building with MOZ_INSTALL_TRACKING=1')
         if not adjust_sdk_keyfile:
             die('You must specify --with-adjust-sdk-keyfile=/path/to/keyfile when'
                 ' building with MOZ_INSTALL_TRACKING=1')
 
 # Must come after the ../../toolkit/moz.configure.
 @depends('MOZ_ANDROID_MMA',
-         google_play_services,
+         'MOZ_NATIVE_DEVICES',
          'MOZ_ANDROID_GCM',
          '--with-leanplum-sdk-keyfile')
 def check_android_mma(android_mma,
-                      google_play_services,
+                      native_devices,
                       android_gcm,
                       leanplum_sdk_keyfile):
     if android_mma:
-        if not google_play_services:
-            die('You must specify --with-google-play-services when'
+        if not native_devices:
+            die('You must specify MOZ_NATIVE_DEVICES=1 when'
                 ' building with MOZ_ANDROID_MMA=1')
         if not android_gcm:
             die('You must specify MOZ_ANDROID_GCM=1 when'
                 ' building with MOZ_ANDROID_MMA=1')
         if not leanplum_sdk_keyfile:
             die('You must specify --with-leanplum-sdk-keyfile=/path/to/keyfile when'
                 ' building with MOZ_ANDROID_MMA=1')
 
 @depends('MOZ_ANDROID_POCKET',
          '--with-pocket-api-keyfile')
 def check_android_pocket(android_pocket, pocket_api_keyfile):
     if android_pocket and not pocket_api_keyfile:
         die('You must specify --with-pocket-api-keyfile=/path/to/keyfile when'
             ' building with MOZ_ANDROID_POCKET=1')
-
-# Must come after the ../../toolkit/moz.configure.
-@depends('MOZ_ANDROID_GCM', google_play_services)
-def check_android_gcm(android_gcm,
-                      google_play_services):
-    if android_gcm:
-        if not google_play_services:
-            die('You must specify --with-google-play-services when'
-                ' building with MOZ_ANDROID_GCM=1')
--- a/taskcluster/ci/build/android.yml
+++ b/taskcluster/ci/build/android.yml
@@ -197,65 +197,16 @@ android-api-16/opt:
     toolchains:
         - android-gradle-dependencies
         - android-sdk-linux
         - linux64-clang
         - linux64-rust-android
         - linux64-sccache
         - proguard-jar
 
-android-api-16-without-google-play-services/opt:
-    description: "Android 4.0 api-16+ (without Google Play Services) Opt"
-    index:
-        product: mobile
-        job-name: android-api-16-without-google-play-services-opt
-    treeherder:
-        platform: android-4-0-armv7-api16/opt
-        symbol: tc(BnoGPS)
-    worker-type: aws-provisioner-v1/gecko-{level}-b-android
-    worker:
-        docker-image: {in-tree: android-build}
-        max-run-time: 7200
-        env:
-            GRADLE_USER_HOME: "/builds/worker/workspace/build/src/mobile/android/gradle/dotgradle-offline"
-            PERFHERDER_EXTRA_OPTIONS: android-api-16-without-google-play-services
-            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
-        artifacts:
-            - name: public/android/R
-              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/R
-              type: directory
-            - name: public/android/maven
-              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview/maven/
-              type: directory
-            - name: public/build/geckoview_example.apk
-              path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview_example/outputs/apk/geckoview_example-withGeckoBinaries.apk
-              type: file
-            - name: public/build
-              path: /builds/worker/artifacts/
-              type: directory
-    run:
-        using: mozharness
-        actions: [get-secrets build multi-l10n update]
-        config:
-            - builds/releng_base_android_64_builds.py
-            - disable_signing.py
-            - platform_supports_post_upload_to_latest.py
-        script: "mozharness/scripts/fx_desktop_build.py"
-        secrets: true
-        custom-build-variant-cfg: api-16-without-google-play-services
-        tooltool-downloads: internal
-    run-on-projects: ['mozilla-central']
-    toolchains:
-        - android-gradle-dependencies
-        - android-sdk-linux
-        - linux64-clang
-        - linux64-rust-android
-        - linux64-sccache
-        - proguard-jar
-
 android-api-16-nightly/opt:
     description: "Android 4.0 api-16+ Nightly"
     attributes:
         nightly: true
     shipping-phase: promote
     shipping-product: fennec
     index:
         product: mobile
deleted file mode 100644
--- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_api_16_without_google_play_services.py
+++ /dev/null
@@ -1,8 +0,0 @@
-config = {
-    'base_name': 'Android armv7 api-16+ %(branch)s --without-google-play-services',
-    'stage_platform': 'android-api-16',
-    'build_type': 'api-16-opt',
-    'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-16/nightly-without-google-play-services',
-    'multi_locale_config_platform': 'android',
-    'artifact_flag_build_variant_in_try': None, # There's no artifact equivalent.
-}
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -429,17 +429,16 @@ class BuildOptionParser(object):
         'api-16-gradle-dependencies': 'builds/releng_sub_%s_configs/%s_api_16_gradle_dependencies.py',
         'api-16': 'builds/releng_sub_%s_configs/%s_api_16.py',
         'api-16-old-id': 'builds/releng_sub_%s_configs/%s_api_16_old_id.py',
         'api-16-artifact': 'builds/releng_sub_%s_configs/%s_api_16_artifact.py',
         'api-16-debug': 'builds/releng_sub_%s_configs/%s_api_16_debug.py',
         'api-16-debug-artifact': 'builds/releng_sub_%s_configs/%s_api_16_debug_artifact.py',
         'api-16-gradle': 'builds/releng_sub_%s_configs/%s_api_16_gradle.py',
         'api-16-gradle-artifact': 'builds/releng_sub_%s_configs/%s_api_16_gradle_artifact.py',
-        'api-16-without-google-play-services': 'builds/releng_sub_%s_configs/%s_api_16_without_google_play_services.py',
         'rusttests': 'builds/releng_sub_%s_configs/%s_rusttests.py',
         'rusttests-debug': 'builds/releng_sub_%s_configs/%s_rusttests_debug.py',
         'x86': 'builds/releng_sub_%s_configs/%s_x86.py',
         'x86-old-id': 'builds/releng_sub_%s_configs/%s_x86_old_id.py',
         'x86-artifact': 'builds/releng_sub_%s_configs/%s_x86_artifact.py',
         'api-16-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_16_partner_sample1.py',
         'aarch64': 'builds/releng_sub_%s_configs/%s_aarch64.py',
         'android-test': 'builds/releng_sub_%s_configs/%s_test.py',
--- a/widget/android/fennec/FennecJNINatives.h
+++ b/widget/android/fennec/FennecJNINatives.h
@@ -78,17 +78,16 @@ public:
 template<class Impl>
 const JNINativeMethod MemoryMonitor::Natives<Impl>::methods[] = {
 
     mozilla::jni::MakeNativeMethod<MemoryMonitor::DispatchMemoryPressure_t>(
             mozilla::jni::NativeStub<MemoryMonitor::DispatchMemoryPressure_t, Impl>
             ::template Wrap<&Impl::DispatchMemoryPressure>)
 };
 
-#ifdef MOZ_NATIVE_DEVICES
 template<class Impl>
 class PresentationMediaPlayerManager::Natives : public mozilla::jni::NativeImpl<PresentationMediaPlayerManager, Impl>
 {
 public:
     static const JNINativeMethod methods[3];
 };
 
 template<class Impl>
@@ -102,17 +101,16 @@ const JNINativeMethod PresentationMediaP
             mozilla::jni::NativeStub<PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t, Impl>
             ::template Wrap<&Impl::InvalidateAndScheduleComposite>),
 
     mozilla::jni::MakeNativeMethod<PresentationMediaPlayerManager::RemovePresentationSurface_t>(
             mozilla::jni::NativeStub<PresentationMediaPlayerManager::RemovePresentationSurface_t, Impl>
             ::template Wrap<&Impl::RemovePresentationSurface>)
 };
 
-#endif // MOZ_NATIVE_DEVICES
 template<class Impl>
 class Telemetry::Natives : public mozilla::jni::NativeImpl<Telemetry, Impl>
 {
 public:
     static const JNINativeMethod methods[5];
 };
 
 template<class Impl>
--- a/widget/android/fennec/FennecJNIWrappers.cpp
+++ b/widget/android/fennec/FennecJNIWrappers.cpp
@@ -169,30 +169,28 @@ auto GlobalHistory::SetURITitle(mozilla:
 }
 
 const char MemoryMonitor::name[] =
         "org/mozilla/gecko/MemoryMonitor";
 
 constexpr char MemoryMonitor::DispatchMemoryPressure_t::name[];
 constexpr char MemoryMonitor::DispatchMemoryPressure_t::signature[];
 
-#ifdef MOZ_NATIVE_DEVICES
 const char PresentationMediaPlayerManager::name[] =
         "org/mozilla/gecko/PresentationMediaPlayerManager";
 
 constexpr char PresentationMediaPlayerManager::AddPresentationSurface_t::name[];
 constexpr char PresentationMediaPlayerManager::AddPresentationSurface_t::signature[];
 
 constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t::name[];
 constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t::signature[];
 
 constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::name[];
 constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::signature[];
 
-#endif // MOZ_NATIVE_DEVICES
 const char Telemetry::name[] =
         "org/mozilla/gecko/Telemetry";
 
 constexpr char Telemetry::AddHistogram_t::name[];
 constexpr char Telemetry::AddHistogram_t::signature[];
 
 constexpr char Telemetry::AddKeyedHistogram_t::name[];
 constexpr char Telemetry::AddKeyedHistogram_t::signature[];
--- a/widget/android/fennec/FennecJNIWrappers.h
+++ b/widget/android/fennec/FennecJNIWrappers.h
@@ -513,17 +513,16 @@ public:
     };
 
     static const mozilla::jni::CallingThread callingThread =
             mozilla::jni::CallingThread::UI;
 
     template<class Impl> class Natives;
 };
 
-#ifdef MOZ_NATIVE_DEVICES
 class PresentationMediaPlayerManager : public mozilla::jni::ObjectBase<PresentationMediaPlayerManager>
 {
 public:
     static const char name[];
 
     explicit PresentationMediaPlayerManager(const Context& ctx) : ObjectBase<PresentationMediaPlayerManager>(ctx) {}
 
     struct AddPresentationSurface_t {
@@ -581,17 +580,16 @@ public:
     };
 
     static const mozilla::jni::CallingThread callingThread =
             mozilla::jni::CallingThread::UI;
 
     template<class Impl> class Natives;
 };
 
-#endif // MOZ_NATIVE_DEVICES
 class Telemetry : public mozilla::jni::ObjectBase<Telemetry>
 {
 public:
     static const char name[];
 
     explicit Telemetry(const Context& ctx) : ObjectBase<Telemetry>(ctx) {}
 
     struct AddHistogram_t {
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1131,17 +1131,16 @@ public:
            aPixels->CopyTo(mem.get<int32_t>(), mem.Size<int32_t>());
            if (!child->ToolbarPixelsToCompositor(mem, ScreenIntSize(aWidth, aHeight))) {
                child->DeallocPixelBuffer(mem);
            }
         }
     }
 };
 
-#ifdef MOZ_NATIVE_DEVICES
 template<> const char
 nsWindow::NativePtr<nsWindow::LayerViewSupport>::sName[] = "LayerViewSupport";
 
 /* PresentationMediaPlayerManager native calls access inner nsWindow functionality so PMPMSupport is a child class of nsWindow */
 class nsWindow::PMPMSupport final
     : public PresentationMediaPlayerManager::Natives<PMPMSupport>
 {
     PMPMSupport() = delete;
@@ -1219,17 +1218,16 @@ public:
             ANativeWindow_release(sWindow);
             sWindow = nullptr;
         }
     }
 };
 
 ANativeWindow* nsWindow::PMPMSupport::sWindow;
 EGLSurface nsWindow::PMPMSupport::sSurface;
-#endif
 
 
 nsWindow::GeckoViewSupport::~GeckoViewSupport()
 {
     // Disassociate our GeckoEditable instance with our native object.
     if (window.mEditableSupport) {
         window.mEditableSupport.Detach();
         window.mEditableParent = nullptr;
@@ -1387,21 +1385,19 @@ nsWindow::GeckoViewSupport::AttachEditab
 }
 
 void
 nsWindow::InitNatives()
 {
     nsWindow::GeckoViewSupport::Base::Init();
     nsWindow::LayerViewSupport::Init();
     nsWindow::NPZCSupport::Init();
-#ifdef MOZ_NATIVE_DEVICES
     if (jni::IsFennec()) {
         nsWindow::PMPMSupport::Init();
     }
-#endif
 
     GeckoEditableSupport::Init();
 }
 
 nsWindow*
 nsWindow::TopWindow()
 {
     if (!gTopLevelWindows.IsEmpty())
@@ -2073,37 +2069,33 @@ nsWindow::GetNativeData(uint32_t aDataTy
         }
 
         case NS_JAVA_SURFACE:
             if (NativePtr<LayerViewSupport>::Locked lvs{mLayerViewSupport}) {
                 return lvs->GetSurface().Get();
             }
             return nullptr;
 
-#ifdef MOZ_NATIVE_DEVICES
         case NS_PRESENTATION_WINDOW:
             return PMPMSupport::sWindow;
 
         case NS_PRESENTATION_SURFACE:
             return PMPMSupport::sSurface;
-#endif
     }
 
     return nullptr;
 }
 
 void
 nsWindow::SetNativeData(uint32_t aDataType, uintptr_t aVal)
 {
     switch (aDataType) {
-#ifdef MOZ_NATIVE_DEVICES
         case NS_PRESENTATION_SURFACE:
             PMPMSupport::sSurface = reinterpret_cast<EGLSurface>(aVal);
             break;
-#endif
     }
 }
 
 void
 nsWindow::DispatchHitTest(const WidgetTouchEvent& aEvent)
 {
     if (aEvent.mMessage == eTouchStart && aEvent.mTouches.Length() == 1) {
         // Since touch events don't get retargeted by PositionedEventTargeting.cpp
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -188,20 +188,18 @@ private:
 
     class GeckoViewSupport;
     // Object that implements native GeckoView calls and associated states.
     // nullptr for nsWindows that were not opened from GeckoView.
     // Because other objects get destroyed in the mGeckOViewSupport destructor,
     // keep it last in the list, so its destructor is called first.
     mozilla::UniquePtr<GeckoViewSupport> mGeckoViewSupport;
 
-#ifdef MOZ_NATIVE_DEVICES
     // Class that implements native PresentationMediaPlayerManager calls.
     class PMPMSupport;
-#endif
 
     mozilla::Atomic<bool, mozilla::ReleaseAcquire> mContentDocumentDisplayed;
 
 public:
     static nsWindow* TopWindow();
 
     static mozilla::Modifiers GetModifiers(int32_t aMetaState);
     static mozilla::TimeStamp GetEventTimeStamp(int64_t aEventTime);