Backed out 2 changesets (bug 1532850) for apilint failure. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Sat, 09 Mar 2019 03:13:56 +0200
changeset 521225 2eb9f5061586
parent 521224 b823fe555467
child 521226 c4581e15f19f
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1532850
milestone67.0a1
backs out8feadb1f48f2
d3eed8f55897
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 2 changesets (bug 1532850) for apilint failure. CLOSED TREE Backed out changeset 8feadb1f48f2 (bug 1532850) Backed out changeset d3eed8f55897 (bug 1532850)
layout/style/nsMediaFeatures.cpp
mobile/android/base/AndroidManifest.xml.in
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
widget/android/nsLookAndFeel.cpp
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -456,19 +456,18 @@ void nsMediaFeatures::InitSystemMetrics(
 
   rv = LookAndFeel::GetInt(LookAndFeel::eIntID_GTKCSDReversedPlacement,
                            &metricResult);
   if (NS_SUCCEEDED(rv) && metricResult) {
     sSystemMetrics->AppendElement(
         (nsStaticAtom*)nsGkAtoms::_moz_gtk_csd_reversed_placement);
   }
 
-  rv = LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme,
-                           &metricResult);
-  if (NS_SUCCEEDED(rv) && metricResult) {
+  metricResult = LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme);
+  if (metricResult) {
     sSystemMetrics->AppendElement(
         (nsStaticAtom*)nsGkAtoms::_moz_system_dark_theme);
   }
 }
 
 /* static */
 void nsMediaFeatures::FreeSystemMetrics() {
   delete sSystemMetrics;
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -53,17 +53,17 @@
              org.mozilla.{fennec,firefox,firefox_beta}.  The internal Java
              package hierarchy inside the Android package used to have an
              org.mozilla.{fennec,firefox,firefox_beta} subtree *and* an
              org.mozilla.gecko subtree; it now only has org.mozilla.gecko. -->
         <activity android:name="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
                   android:label="@string/moz_app_displayname"
                   android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
                   android:alwaysRetainTaskState="true"
-                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout|uiMode"
+                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
                   android:resizeableActivity="true"
                   android:supportsPictureInPicture="true"
                   android:windowSoftInputMode="stateUnspecified|adjustResize"
                   android:launchMode="singleTask"
                   android:exported="true"
                   android:theme="@style/Gecko.App" />
 
         <!-- Bug 1256615 / Bug 1268455: We published an .App alias and we need to maintain it
@@ -330,17 +330,17 @@
                 <action android:name="android.intent.action.SEND" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="text/plain" />
             </intent-filter>
 
         </activity>
 
         <activity android:name="org.mozilla.gecko.customtabs.CustomTabsActivity"
-                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout|uiMode"
+                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
                   android:windowSoftInputMode="stateUnspecified|adjustResize"
                   android:theme="@style/GeckoCustomTabs" />
 
         <activity android:name="org.mozilla.gecko.webapps.WebAppActivity"
             android:theme="@style/Theme.AppCompat.NoActionBar" />
 
         <!-- Declare a predefined number of WebApp<num> activities. These are
              used so that each web app can launch in its own activity. -->
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
@@ -2,17 +2,16 @@
  * 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/. */
 
 package org.mozilla.gecko;
 
 import android.content.ContentResolver;
 import android.content.Context;
-import android.content.res.Configuration;
 import android.database.ContentObserver;
 import android.hardware.input.InputManager;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Handler;
 import android.os.Looper;
 import android.provider.Settings;
 import android.support.annotation.RequiresApi;
@@ -27,17 +26,16 @@ public class GeckoSystemStateListener
     private static final String LOGTAG = "GeckoSystemStateListener";
 
     private static final GeckoSystemStateListener listenerInstance = new GeckoSystemStateListener();
 
     private boolean initialized;
     private ContentObserver mContentObserver;
     private static Context sApplicationContext;
     private InputManager mInputManager;
-    private static boolean sIsNightMode;
 
     public static GeckoSystemStateListener getInstance() {
         return listenerInstance;
     }
 
     private GeckoSystemStateListener() {
     }
 
@@ -56,19 +54,16 @@ public class GeckoSystemStateListener
         mContentObserver = new ContentObserver(new Handler(Looper.getMainLooper())) {
             @Override
             public void onChange(boolean selfChange) {
                 onDeviceChanged();
             }
         };
         contentResolver.registerContentObserver(animationSetting, false, mContentObserver);
 
-        sIsNightMode = (sApplicationContext.getResources().getConfiguration().uiMode &
-            Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
-
         initialized = true;
     }
 
     public synchronized void shutdown() {
         if (!initialized) {
             Log.w(LOGTAG, "Already shut down!");
             return;
         }
@@ -109,34 +104,16 @@ public class GeckoSystemStateListener
 
     @WrapForJNI(calledFrom = "gecko")
     private static void notifyPrefersReducedMotionChangedForTest() {
         ContentResolver contentResolver = sApplicationContext.getContentResolver();
         Uri animationSetting = Settings.System.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE);
         contentResolver.notifyChange(animationSetting, null);
     }
 
-    @WrapForJNI(calledFrom = "gecko")
-    /**
-     * For prefers-color-scheme media queries feature.
-     */
-    private static boolean isNightMode() {
-        return sIsNightMode;
-    }
-
-    public void updateNightMode(int newUIMode) {
-        boolean isNightMode = (newUIMode & Configuration.UI_MODE_NIGHT_MASK)
-            == Configuration.UI_MODE_NIGHT_YES;
-        if (isNightMode == sIsNightMode) {
-          return;
-        }
-        sIsNightMode = isNightMode;
-        onDeviceChanged();
-    }
-
     @WrapForJNI(stubName = "OnDeviceChanged", calledFrom = "ui", dispatchTo = "gecko")
     private static native void nativeOnDeviceChanged();
 
     private static void onDeviceChanged() {
         if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
             nativeOnDeviceChanged();
         } else {
             GeckoThread.queueNativeCallUntil(
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
@@ -6,17 +6,16 @@
 
 package org.mozilla.geckoview;
 
 import android.app.ActivityManager;
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ServiceInfo;
-import android.content.res.Configuration;
 import android.os.Build;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.content.Context;
 import android.os.Process;
 import android.support.annotation.AnyThread;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -433,25 +432,24 @@ public final class GeckoRuntime implemen
      */
     @UiThread
     public void orientationChanged() {
         ThreadUtils.assertOnUiThread();
         GeckoScreenOrientation.getInstance().update();
     }
 
     /**
-     * Notify Gecko that the device configuration such as screen orientation has changed.
-     * @param newConfig The new Configuration object,
-     *                  {@link android.content.res.Configuration}.
+     * Notify Gecko that the screen orientation has changed.
+     * @param newOrientation The new screen orientation, as retrieved e.g. from the current
+     *                       {@link android.content.res.Configuration}.
      */
     @UiThread
-    public void configurationChanged(Configuration newConfig) {
+    public void orientationChanged(int newOrientation) {
         ThreadUtils.assertOnUiThread();
-        GeckoScreenOrientation.getInstance().update(newConfig.orientation);
-        GeckoSystemStateListener.getInstance().updateNightMode(newConfig.uiMode);
+        GeckoScreenOrientation.getInstance().update(newOrientation);
     }
 
     @Override // Parcelable
     @AnyThread
     public int describeContents() {
         return 0;
     }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
@@ -460,17 +460,17 @@ public class GeckoView extends FrameLayo
     @Override
     protected void onConfigurationChanged(Configuration newConfig) {
         super.onConfigurationChanged(newConfig);
 
         if (mRuntime != null) {
             // onConfigurationChanged is not called for 180 degree orientation changes,
             // we will miss such rotations and the screen orientation will not be
             // updated.
-            mRuntime.configurationChanged(newConfig);
+            mRuntime.orientationChanged(newConfig.orientation);
         }
     }
 
     @Override
     public boolean gatherTransparentRegion(final Region region) {
         // For detecting changes in SurfaceView layout, we take a shortcut here and
         // override gatherTransparentRegion, instead of registering a layout listener,
         // which is more expensive.
--- a/widget/android/nsLookAndFeel.cpp
+++ b/widget/android/nsLookAndFeel.cpp
@@ -395,26 +395,16 @@ nsresult nsLookAndFeel::GetIntImpl(IntID
 
     case eIntID_PrimaryPointerCapabilities:
       aResult = java::GeckoAppShell::GetPrimaryPointerCapabilities();
       break;
     case eIntID_AllPointerCapabilities:
       aResult = java::GeckoAppShell::GetAllPointerCapabilities();
       break;
 
-    case eIntID_SystemUsesDarkTheme:
-      // Bail out if AndroidBridge hasn't initialized since we try to query
-      // this vailue via nsMediaFeatures::InitSystemMetrics without initializing
-      // AndroidBridge on xpcshell tests.
-      if (!jni::IsAvailable()) {
-        return NS_ERROR_FAILURE;
-      }
-      aResult = java::GeckoSystemStateListener::IsNightMode() ? 1 : 0;
-      break;
-
     default:
       aResult = 0;
       rv = NS_ERROR_FAILURE;
   }
 
   return rv;
 }