mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Backed out 2 changesets (bug 1532850) for Android bustage on a CLOSED TREE
Backed out changeset d32559ed093f (bug 1532850) Backed out changeset 439686eac8d6 (bug 1532850)
This commit is contained in:
parent
a304dfa6a6
commit
45aa39f3f6
@ -462,9 +462,8 @@ void nsMediaFeatures::InitSystemMetrics() {
|
||||
(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);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@
|
||||
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"
|
||||
@ -352,7 +352,7 @@
|
||||
</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" />
|
||||
|
||||
|
@ -177,7 +177,6 @@ package org.mozilla.geckoview {
|
||||
public final class GeckoRuntime implements android.os.Parcelable {
|
||||
ctor public GeckoRuntime();
|
||||
method @android.support.annotation.UiThread public void attachTo(@android.support.annotation.NonNull android.content.Context);
|
||||
method @android.support.annotation.UiThread public void configurationChanged(@android.support.annotation.NonNull android.content.res.Configuration);
|
||||
method @android.support.annotation.UiThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoRuntime create(@android.support.annotation.NonNull android.content.Context);
|
||||
method @android.support.annotation.UiThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoRuntime create(@android.support.annotation.NonNull android.content.Context, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoRuntimeSettings);
|
||||
method @android.support.annotation.UiThread @android.support.annotation.NonNull public static synchronized org.mozilla.geckoview.GeckoRuntime getDefault(@android.support.annotation.NonNull android.content.Context);
|
||||
|
@ -7,7 +7,6 @@ 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;
|
||||
@ -32,7 +31,6 @@ public class GeckoSystemStateListener
|
||||
private ContentObserver mContentObserver;
|
||||
private static Context sApplicationContext;
|
||||
private InputManager mInputManager;
|
||||
private static boolean sIsNightMode;
|
||||
|
||||
public static GeckoSystemStateListener getInstance() {
|
||||
return listenerInstance;
|
||||
@ -61,9 +59,6 @@ public class GeckoSystemStateListener
|
||||
};
|
||||
contentResolver.registerContentObserver(animationSetting, false, mContentObserver);
|
||||
|
||||
sIsNightMode = (sApplicationContext.getResources().getConfiguration().uiMode &
|
||||
Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
|
||||
|
||||
mInitialized = true;
|
||||
}
|
||||
|
||||
@ -114,24 +109,6 @@ public class GeckoSystemStateListener
|
||||
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();
|
||||
|
||||
|
@ -11,7 +11,6 @@ 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;
|
||||
@ -434,17 +433,6 @@ public final class GeckoRuntime implements Parcelable {
|
||||
GeckoScreenOrientation.getInstance().update();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify Gecko that the device configuration has changed.
|
||||
* @param newConfig The new Configuration object,
|
||||
* {@link android.content.res.Configuration}.
|
||||
*/
|
||||
@UiThread
|
||||
public void configurationChanged(@NonNull Configuration newConfig) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
GeckoSystemStateListener.getInstance().updateNightMode(newConfig.uiMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify Gecko that the screen orientation has changed.
|
||||
* @param newOrientation The new screen orientation, as retrieved e.g. from the current
|
||||
|
@ -465,7 +465,6 @@ public class GeckoView extends FrameLayout {
|
||||
// we will miss such rotations and the screen orientation will not be
|
||||
// updated.
|
||||
mRuntime.orientationChanged(newConfig.orientation);
|
||||
mRuntime.configurationChanged(newConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,6 @@ exclude: true
|
||||
|
||||
<h1> GeckoView API Changelog. </h1>
|
||||
|
||||
## v68
|
||||
- Added [`GeckoRuntime#configurationChanged`][68.1] to notify the device
|
||||
configuration has changed.
|
||||
|
||||
[68.1]: ../GeckoRuntime.html#configurationChanged
|
||||
|
||||
## v67
|
||||
- Added [`setAutomaticFontSizeAdjustment`][67.2] to
|
||||
[`GeckoRuntimeSettings`][67.3] for automatically adjusting font size settings
|
||||
|
@ -400,16 +400,6 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user