Backed out 2 changesets (bug 1724480) for causing Bug 1745152 and Bug 1745153 CLOSED TREE

Backed out changeset f988b79d58f4 (bug 1724480)
Backed out changeset 8a2fb9a2a3db (bug 1724480)
This commit is contained in:
Noemi Erli 2021-12-09 18:58:02 +02:00
Родитель cfd2352f90
Коммит 88ea88a467
30 изменённых файлов: 147 добавлений и 200 удалений

Просмотреть файл

@ -57,9 +57,6 @@ allprojects {
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url repository
if (gradle.mozconfig.substs.ALLOW_INSECURE_GRADLE_REPOSITORIES) {
allowInsecureProtocol = true
}
}
}
}
@ -97,9 +94,6 @@ buildscript {
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url repository
if (gradle.mozconfig.substs.ALLOW_INSECURE_GRADLE_REPOSITORIES) {
allowInsecureProtocol = true
}
}
}
}
@ -107,8 +101,8 @@ buildscript {
ext.kotlin_version = '1.5.20'
dependencies {
classpath 'org.mozilla.apilint:apilint:0.5.1'
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'org.mozilla.apilint:apilint:0.4.4'
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
classpath 'org.apache.commons:commons-exec:1.3'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.16.0'

2
gradle/wrapper/gradle-wrapper.properties поставляемый
Просмотреть файл

@ -3,6 +3,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
# Bug 1596208, Android Studio has a bug that prevents us from using this
# distributionSha256Sum=53b71812f18cdb2777e9f1b2a0f2038683907c90bdc406bc64d8b400e1fb2c3b

Просмотреть файл

@ -3,9 +3,9 @@ buildDir "${topobjdir}/gradle/build/mobile/android/annotations"
apply plugin: 'java'
dependencies {
implementation 'com.android.tools.lint:lint:30.0.3'
implementation 'com.android.tools.lint:lint-checks:30.0.3'
implementation 'com.android.tools.lint:lint:26.2.1'
implementation 'com.android.tools.lint:lint-checks:26.2.1'
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

Просмотреть файл

@ -56,7 +56,6 @@ package org.mozilla.gecko.annotationProcessors;
*/
import com.android.tools.lint.LintCliClient;
import com.android.tools.lint.checks.ApiLookup;
import com.android.tools.lint.client.api.LintClient;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
@ -212,7 +211,7 @@ public class SDKProcessor {
sMaxSdkVersion = Integer.parseInt(args[1]);
final String outdir = args[2];
final LintCliClient lintClient = new LintCliClient(LintClient.CLIENT_CLI);
final LintCliClient lintClient = new LintCliClient();
sApiLookup = ApiLookup.get(lintClient);
for (int argIndex = 3; argIndex < args.length; argIndex += 2) {

Просмотреть файл

@ -13,8 +13,6 @@ NO_NDK=1
ac_add_options --with-gradle
# We want to use (and populate!) the local Nexus repositories.
export GRADLE_MAVEN_REPOSITORIES="http://localhost:8081/nexus/content/repositories/mozilla/","http://localhost:8081/nexus/content/repositories/google/","http://localhost:8081/nexus/content/repositories/central/","http://localhost:8081/nexus/content/repositories/gradle-plugins/"
# Nexus runs on HTTP
ac_add_options --allow-insecure-gradle-repositories
# From here on, just like ../android-arm/nightly.

Просмотреть файл

@ -23,8 +23,8 @@ You need to add or edit four stanzas inside your module's ``build.gradle`` file.
.. code-block:: groovy
ext {
geckoviewChannel = <channel>
geckoviewVersion = <version>
geckoviewChannel = "nightly"
geckoviewVersion = "70.0.20190712095934"
}
@ -39,15 +39,15 @@ You need to add or edit four stanzas inside your module's ``build.gradle`` file.
}
**3. Java 11 required support**
**3. Java 8 required support**
As GeckoView uses some Java 11 APIs, it requires these compatibility flags:
As GeckoView uses some Java 8 APIs, it requires these compatibility flags:
.. code-block:: groovy
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
**4. Add GeckoView Implementations**

Просмотреть файл

@ -9,8 +9,8 @@ android {
compileSdkVersion project.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "32g"

Просмотреть файл

@ -9,8 +9,8 @@ android {
compileSdkVersion project.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "32g"

Просмотреть файл

@ -56,9 +56,7 @@ import java.lang.String;
import java.lang.Throwable;
import java.lang.Void;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.net.InetAddress;
import java.nio.ByteBuffer;
@ -158,11 +156,11 @@ package org.mozilla.geckoview {
method @AnyThread @NonNull public Autocomplete.Address.Builder tel(@Nullable String);
}
public static class Autocomplete.AddressSaveOption extends Autocomplete.SaveOption<Autocomplete.Address> {
public static class Autocomplete.AddressSaveOption extends Autocomplete.SaveOption {
ctor public AddressSaveOption(@NonNull Autocomplete.Address);
}
public static class Autocomplete.AddressSelectOption extends Autocomplete.SelectOption<Autocomplete.Address> {
public static class Autocomplete.AddressSelectOption extends Autocomplete.SelectOption {
ctor public AddressSelectOption(@NonNull Autocomplete.Address);
}
@ -191,11 +189,11 @@ package org.mozilla.geckoview {
method @AnyThread @NonNull public Autocomplete.CreditCard.Builder number(@Nullable String);
}
public static class Autocomplete.CreditCardSaveOption extends Autocomplete.SaveOption<Autocomplete.CreditCard> {
public static class Autocomplete.CreditCardSaveOption extends Autocomplete.SaveOption {
ctor public CreditCardSaveOption(@NonNull Autocomplete.CreditCard);
}
public static class Autocomplete.CreditCardSelectOption extends Autocomplete.SelectOption<Autocomplete.CreditCard> {
public static class Autocomplete.CreditCardSelectOption extends Autocomplete.SelectOption {
ctor public CreditCardSelectOption(@NonNull Autocomplete.CreditCard);
}
@ -226,11 +224,11 @@ package org.mozilla.geckoview {
method @AnyThread @NonNull public Autocomplete.LoginEntry.Builder username(@NonNull String);
}
public static class Autocomplete.LoginSaveOption extends Autocomplete.SaveOption<Autocomplete.LoginEntry> {
public static class Autocomplete.LoginSaveOption extends Autocomplete.SaveOption {
ctor public LoginSaveOption(@NonNull Autocomplete.LoginEntry);
}
public static class Autocomplete.LoginSelectOption extends Autocomplete.SelectOption<Autocomplete.LoginEntry> {
public static class Autocomplete.LoginSelectOption extends Autocomplete.SelectOption {
ctor public LoginSelectOption(@NonNull Autocomplete.LoginEntry);
}
@ -240,7 +238,7 @@ package org.mozilla.geckoview {
field @NonNull public final T value;
}
public abstract static class Autocomplete.SaveOption<T> extends Autocomplete.Option<T> {
public abstract static class Autocomplete.SaveOption<T> extends Autocomplete.Option {
ctor public SaveOption(@NonNull T, int);
}
@ -251,7 +249,7 @@ package org.mozilla.geckoview {
field public static final int NONE = 0;
}
public abstract static class Autocomplete.SelectOption<T> extends Autocomplete.Option<T> {
public abstract static class Autocomplete.SelectOption<T> extends Autocomplete.Option {
ctor public SelectOption(@NonNull T, int);
}
@ -502,7 +500,7 @@ package org.mozilla.geckoview {
field public static final Parcelable.Creator<ContentBlocking.Settings> CREATOR;
}
@AnyThread public static class ContentBlocking.Settings.Builder extends RuntimeSettings.Builder<ContentBlocking.Settings> {
@AnyThread public static class ContentBlocking.Settings.Builder extends RuntimeSettings.Builder {
ctor public Builder();
method @NonNull public ContentBlocking.Settings.Builder antiTracking(int);
method @NonNull public ContentBlocking.Settings.Builder cookieBehavior(int);
@ -569,7 +567,7 @@ package org.mozilla.geckoview {
method @AnyThread @NonNull public static GeckoResult<String> sendCrashReport(@NonNull String, @NonNull File, @NonNull JSONObject);
}
@Documented @Retention(value=RetentionPolicy.RUNTIME) @Target(value={ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PACKAGE, ElementType.PARAMETER, ElementType.TYPE}) public interface DeprecationSchedule {
@Documented @Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME) @Target(value={java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE}) public interface DeprecationSchedule {
element public String id();
element public int version();
}
@ -604,7 +602,7 @@ package org.mozilla.geckoview {
ctor public GeckoResult(GeckoResult<T>);
method @NonNull public GeckoResult<Void> accept(@Nullable GeckoResult.Consumer<T>);
method @NonNull public GeckoResult<Void> accept(@Nullable GeckoResult.Consumer<T>, @Nullable GeckoResult.Consumer<Throwable>);
method @NonNull @SafeVarargs public static <V> GeckoResult<List<V>> allOf(@NonNull GeckoResult<V>...);
method @NonNull @SafeVarargs public static <V> GeckoResult<List<V>> allOf(@NonNull GeckoResult<V>);
method @NonNull public static <V> GeckoResult<List<V>> allOf(@Nullable List<GeckoResult<V>>);
method @AnyThread @NonNull public static GeckoResult<AllowOrDeny> allow();
method @NonNull public synchronized GeckoResult<Boolean> cancel();
@ -714,7 +712,7 @@ package org.mozilla.geckoview {
method @Nullable public String getConfigFilePath();
method public boolean getConsoleOutputEnabled();
method @NonNull public ContentBlocking.Settings getContentBlocking();
method @Nullable public Class<? extends android.app.Service> getCrashHandler();
method @Nullable public Class<?> getCrashHandler();
method @Nullable public Float getDisplayDensityOverride();
method @Nullable public Integer getDisplayDpiOverride();
method public boolean getDoubleTapZoomingEnabled();
@ -766,7 +764,7 @@ package org.mozilla.geckoview {
field public static final int HTTPS_ONLY_PRIVATE = 1;
}
@AnyThread public static final class GeckoRuntimeSettings.Builder extends RuntimeSettings.Builder<GeckoRuntimeSettings> {
@AnyThread public static final class GeckoRuntimeSettings.Builder extends RuntimeSettings.Builder {
ctor public Builder();
method @NonNull public GeckoRuntimeSettings.Builder aboutConfigEnabled(boolean);
method @NonNull public GeckoRuntimeSettings.Builder allowInsecureConnections(int);
@ -775,7 +773,7 @@ package org.mozilla.geckoview {
method @NonNull public GeckoRuntimeSettings.Builder configFilePath(@Nullable String);
method @NonNull public GeckoRuntimeSettings.Builder consoleOutput(boolean);
method @NonNull public GeckoRuntimeSettings.Builder contentBlocking(@NonNull ContentBlocking.Settings);
method @NonNull public GeckoRuntimeSettings.Builder crashHandler(@Nullable Class<? extends android.app.Service>);
method @NonNull public GeckoRuntimeSettings.Builder crashHandler(@Nullable Class<?>);
method @NonNull public GeckoRuntimeSettings.Builder debugLogging(boolean);
method @NonNull public GeckoRuntimeSettings.Builder displayDensityOverride(float);
method @NonNull public GeckoRuntimeSettings.Builder displayDpiOverride(int);
@ -949,7 +947,7 @@ package org.mozilla.geckoview {
method @AnyThread @NonNull default public String getUri();
}
public static interface GeckoSession.HistoryDelegate.HistoryList implements List<GeckoSession.HistoryDelegate.HistoryItem> {
public static interface GeckoSession.HistoryDelegate.HistoryList implements List {
method @AnyThread default public int getCurrentIndex();
}
@ -1171,10 +1169,6 @@ package org.mozilla.geckoview {
field @Nullable public final String title;
}
protected static interface GeckoSession.PromptDelegate.BasePrompt.Observer {
method @AnyThread default public void onPromptCompleted(@NonNull GeckoSession.PromptDelegate.BasePrompt);
}
public static class GeckoSession.PromptDelegate.BeforeUnloadPrompt extends GeckoSession.PromptDelegate.BasePrompt {
ctor protected BeforeUnloadPrompt(@NonNull String, @NonNull GeckoSession.PromptDelegate.BasePrompt.Observer);
method @NonNull @UiThread public GeckoSession.PromptDelegate.PromptResponse confirm(@Nullable AllowOrDeny);
@ -1353,7 +1347,7 @@ package org.mozilla.geckoview {
field @NonNull public final String text;
}
@AnyThread public static class GeckoSession.SessionState extends AbstractSequentialList<GeckoSession.HistoryDelegate.HistoryItem> implements Parcelable GeckoSession.HistoryDelegate.HistoryList {
@AnyThread public static class GeckoSession.SessionState extends AbstractSequentialList implements GeckoSession.HistoryDelegate.HistoryList Parcelable {
ctor public SessionState(@NonNull GeckoSession.SessionState);
method @Nullable public static GeckoSession.SessionState fromString(@Nullable String);
method public void readFromParcel(@NonNull Parcel);
@ -1446,12 +1440,9 @@ package org.mozilla.geckoview {
ctor public GeckoView(Context, AttributeSet);
method @NonNull @UiThread public GeckoResult<Bitmap> capturePixels();
method public void coverUntilFirstPaint(int);
method public void dispatchDraw(@Nullable Canvas);
method public boolean getAutofillEnabled();
method @NonNull public PanZoomController getPanZoomController();
method @AnyThread @Nullable public GeckoSession getSession();
method public void onAttachedToWindow();
method public void onDetachedFromWindow();
method @NonNull public GeckoResult<PanZoomController.InputResultDetail> onTouchEventForDetailResult(@NonNull MotionEvent);
method @Nullable @UiThread public GeckoSession releaseSession();
method public void setAutofillEnabled(boolean);
@ -1645,7 +1636,7 @@ package org.mozilla.geckoview {
method @AnyThread default public void onStringScalar(@NonNull RuntimeTelemetry.Metric<String>);
}
public static class RuntimeTelemetry.Histogram extends RuntimeTelemetry.Metric<long[]> {
public static class RuntimeTelemetry.Histogram extends RuntimeTelemetry.Metric {
ctor protected Histogram();
field public final boolean isCategorical;
}
@ -2197,5 +2188,9 @@ package org.mozilla.geckoview {
method @NonNull public WebResponse.Builder statusCode(int);
}
protected static interface GeckoSession.PromptDelegate.BasePrompt.Observer {
method @AnyThread default public void onPromptCompleted(@NonNull GeckoSession.PromptDelegate.BasePrompt);
}
}

Просмотреть файл

@ -137,8 +137,8 @@ android {
project.configureProductFlavors()
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
@ -224,7 +224,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
allWarningsAsErrors = true
jvmTarget = JavaVersion.VERSION_11
}
doFirst {
@ -280,7 +279,7 @@ dependencies {
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
@ -329,7 +328,7 @@ android.libraryVariants.all { variant ->
def results = []
def listener = {
if (!it.toLowerCase().contains("warning:") && !it.toLowerCase().contains("error:")) {
if (!it.toLowerCase().contains("warning") && !it.toLowerCase().contains("error")) {
// Likely not an error or a warning
return
}
@ -367,42 +366,45 @@ android.libraryVariants.all { variant ->
variant.generateBuildConfigProvider.get().sourceOutputDir.asFile.get() +
variant.aidlCompileProvider.get().sourceOutputDir.asFile.get()
)
options.addStringOption("Xmaxwarns", "1000")
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += variant.javaCompileProvider.get().classpath
// javadoc 8 has a bug that requires the rt.jar file from the JRE to be
// in the bootclasspath (https://stackoverflow.com/a/30458820).
options.bootClasspath = [
file("${System.properties['java.home']}/lib/rt.jar")] + android.bootClasspath
options.memberLevel = JavadocMemberLevel.PROTECTED
options.source = 11
options.links("https://developer.android.com/reference")
options.source = 8
options.links("https://d.android.com/reference/")
options.docTitle = "GeckoView ${mozconfig.substs.MOZ_APP_VERSION} API"
options.header = "GeckoView ${mozconfig.substs.MOZ_APP_VERSION} API"
options.noTimestamp = true
options.noIndex = true
options.noQualifiers = ['java.lang']
options.tags = ['hide:a:']
}
def javadocJar = task("javadocJar${name.capitalize()}", type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
destinationDirectory = javadoc.destinationDir
from javadoc.destinationDir
}
// This task is used by `mach android geckoview-docs`.
task("javadocCopyJar${name.capitalize()}", type: Copy) {
from(javadocJar.destinationDirectory) {
from(javadocJar.destinationDir) {
include 'geckoview-*-javadoc.jar'
rename { _ -> 'geckoview-javadoc.jar' }
}
into javadocJar.destinationDirectory
into javadocJar.destinationDir
dependsOn javadocJar
}
def sourcesJar = task("sourcesJar${name.capitalize()}", type: Jar) {
classifier 'sources'
description = "Generate Javadoc for build variant $name"
destinationDirectory =
file("${topobjdir}/mobile/android/geckoview/sources/${variant.baseName}")
destinationDir = new File(destinationDir, variant.baseName)
from files(variant.sourceSets.collect({ it.java.srcDirs }).flatten())
}
@ -559,7 +561,6 @@ android.libraryVariants.all configureVariantDebugLevel
task("generateSDKBindings", type: JavaExec) {
classpath project(':annotations').jar.archivePath
classpath project(':annotations').compileJava.classpath
classpath project(':annotations').sourceSets.main.runtimeClasspath
// To use the lint APIs: "Lint must be invoked with the System property
// com.android.tools.lint.bindir pointing to the ANDROID_SDK tools
@ -568,7 +569,7 @@ task("generateSDKBindings", type: JavaExec) {
'com.android.tools.lint.bindir': "${android.sdkDirectory}/tools",
]
mainClass = 'org.mozilla.gecko.annotationProcessors.SDKProcessor'
main = 'org.mozilla.gecko.annotationProcessors.SDKProcessor'
// We only want to generate bindings for the main framework JAR,
// but not any of the additional android.test libraries.
args android.bootClasspath.findAll { it.getName().startsWith('android.jar') }
@ -595,10 +596,7 @@ apiLint {
// TODO: Change this to `org` after hiding org.mozilla.gecko
packageFilter = 'org.mozilla.geckoview'
changelogFileName = 'src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md'
skipClassesRegex = [
'^org.mozilla.geckoview.BuildConfig$',
'^org.mozilla.geckoview.R$',
]
skipClassesRegex = ['^org.mozilla.geckoview.BuildConfig$']
lintFilters = ['GV']
deprecationAnnotation = 'org.mozilla.geckoview.DeprecationSchedule'
libraryVersion = mozconfig.substs.MOZILLA_VERSION.split('\\.')[0] as Integer

Просмотреть файл

@ -15,7 +15,6 @@ import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
import androidx.annotation.RequiresApi;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@ -32,7 +31,6 @@ import java.util.UUID;
import org.mozilla.gecko.util.ProxySelector;
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
public class GeckoMediaDrmBridgeV21 implements GeckoMediaDrm {
protected final String LOGTAG;
private static final String INVALID_SESSION_ID = "Invalid";

Просмотреть файл

@ -6,7 +6,6 @@
package org.mozilla.geckoview;
import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
@ -519,7 +518,7 @@ public class ContentBlocking {
*
* @return The categories of resources to be blocked.
*/
public @CBSafeBrowsing int getSafeBrowsingCategories() {
public @CBAntiTracking int getSafeBrowsingCategories() {
return ContentBlocking.sbMalwareToSbCat(mSbMalware.get())
| ContentBlocking.sbPhishingToSbCat(mSbPhishing.get());
}
@ -529,7 +528,6 @@ public class ContentBlocking {
*
* @return The assigned behavior, as one of {@link CookieBehavior} flags.
*/
@SuppressLint("WrongConstant")
public @CBCookieBehavior int getCookieBehavior() {
return mCookieBehavior.get();
}
@ -551,7 +549,6 @@ public class ContentBlocking {
*
* @return The assigned behavior, as one of {@link CookieBehavior} flags.
*/
@SuppressLint("WrongConstant")
public @CBCookieBehavior int getCookieBehaviorPrivateMode() {
return mCookieBehaviorPrivateMode.get();
}
@ -573,7 +570,6 @@ public class ContentBlocking {
*
* @return The assigned lifetime, as one of {@link CookieLifetime} flags.
*/
@SuppressLint("WrongConstant")
public @CBCookieLifetime int getCookieLifetime() {
return mCookieLifetime.get();
}

Просмотреть файл

@ -149,7 +149,7 @@ public class ContentBlockingController {
}
protected BlockingData() {
category = Event.BLOCKED_TRACKING_CONTENT;
category = 0;
blocked = false;
count = 0;
}

Просмотреть файл

@ -2756,9 +2756,9 @@ public class GeckoSession {
/** Empty constructor for tests */
protected SecurityInformation() {
mixedModePassive = CONTENT_UNKNOWN;
mixedModeActive = CONTENT_UNKNOWN;
securityMode = SECURITY_MODE_UNKNOWN;
mixedModePassive = 0;
mixedModeActive = 0;
securityMode = 0;
isSecure = false;
isException = false;
origin = "";
@ -3416,11 +3416,7 @@ public class GeckoSession {
@Retention(RetentionPolicy.SOURCE)
@IntDef(
flag = true,
value = {
SelectionActionDelegate.FLAG_IS_COLLAPSED,
SelectionActionDelegate.FLAG_IS_EDITABLE,
SelectionActionDelegate.FLAG_IS_PASSWORD
})
value = {SelectionActionDelegate.FLAG_IS_COLLAPSED, SelectionActionDelegate.FLAG_IS_EDITABLE})
/* package */ @interface SelectionActionDelegateFlag {}
@Retention(RetentionPolicy.SOURCE)
@ -3506,7 +3502,7 @@ public class GeckoSession {
protected LoadRequest() {
uri = "";
triggerUri = null;
target = TARGET_WINDOW_NONE;
target = 0;
isRedirect = false;
hasUserGesture = false;
isDirectNavigation = false;
@ -4030,7 +4026,7 @@ public class GeckoSession {
protected AuthOptions() {
flags = 0;
uri = "";
level = Level.NONE;
level = 0;
username = "";
password = "";
}
@ -5491,8 +5487,8 @@ public class GeckoSession {
id = null;
rawId = null;
name = null;
source = SOURCE_CAMERA;
type = TYPE_VIDEO;
source = 0;
type = 0;
}
}

Просмотреть файл

@ -711,7 +711,7 @@ public class GeckoView extends FrameLayout {
}
@Override
public void dispatchDraw(final @Nullable Canvas canvas) {
public void dispatchDraw(final Canvas canvas) {
super.dispatchDraw(canvas);
if (mSession != null) {

Просмотреть файл

@ -8,6 +8,9 @@ package org.mozilla.geckoview;
import android.content.Context;
import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.os.Build;
import android.widget.EdgeEffect;
@ -72,12 +75,28 @@ public final class OverscrollEdgeEffect {
}
private void setBlendMode(final EdgeEffect edgeEffect) {
if (Build.VERSION.SDK_INT < 29) {
// setBlendMode is only supported on SDK_INT >= 29 and above.
if (Build.VERSION.SDK_INT >= 29) {
edgeEffect.setBlendMode(BlendMode.SRC);
return;
}
edgeEffect.setBlendMode(BlendMode.SRC);
if (sPaintField == null) {
try {
sPaintField = EdgeEffect.class.getDeclaredField("mPaint");
sPaintField.setAccessible(true);
} catch (final NoSuchFieldException e) {
// Cannot get the field, nothing we can do here
return;
}
}
try {
final Paint paint = (Paint) sPaintField.get(edgeEffect);
final PorterDuffXfermode mode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
paint.setXfermode(mode);
} catch (final IllegalAccessException ex) {
// Nothing we can do
}
}
/**

Просмотреть файл

@ -4,7 +4,6 @@
package org.mozilla.geckoview;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.util.Log;
import androidx.annotation.AnyThread;
@ -1399,9 +1398,6 @@ public class WebExtension {
return;
}
// The .accept method will be called from the UIThread in this case because
// the GeckoResult instance was created on the UIThread
@SuppressLint("WrongThread")
final GeckoResult<GeckoSession> popup = delegate.onTogglePopup(mExtension, this);
openPopup(popup, uri);
});
@ -2519,6 +2515,7 @@ public class WebExtension {
}
@NonNull
@UiThread
/* package */ static GeckoBundle downloadInfoToBundle(final @NonNull Info data) {
final GeckoBundle dataBundle = new GeckoBundle();

Просмотреть файл

@ -4,7 +4,6 @@
package org.mozilla.geckoview;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.Log;
import android.util.SparseArray;
@ -871,7 +870,6 @@ public class WebExtensionController {
}));
}
@SuppressLint("WrongThread") // for .toGeckoBundle
private void getSettings(final Message message, final WebExtension extension) {
final WebExtension.BrowsingDataDelegate delegate = mListener.getBrowsingDataDelegate(extension);
if (delegate == null) {

Просмотреть файл

@ -1107,4 +1107,4 @@ to allow adding gecko profiler markers.
[65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
[65.25]: {{javadoc_uri}}/GeckoResult.html
[api-version]: fca366198e2c55035433eb9bc148b1bec846d069
[api-version]: f109d55f4da6ba24b94fa8cb8f42fe7e68d11426

Просмотреть файл

@ -21,8 +21,8 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {

Просмотреть файл

@ -600,17 +600,6 @@ option(
help="Comma-separated URLs of Maven repositories containing Gradle dependencies.",
)
option(
"--allow-insecure-gradle-repositories",
help="Gradle is allowed to connect to insecure Maven repositories.",
)
set_config(
"ALLOW_INSECURE_GRADLE_REPOSITORIES",
True,
when="--allow-insecure-gradle-repositories",
)
@depends("GRADLE_MAVEN_REPOSITORIES")
@imports(_from="os.path", _import="isdir")

Просмотреть файл

@ -192,22 +192,19 @@ ext.configureVariantWithGeckoBinaries = { variant ->
def omnijarDir = "${topobjdir}/dist/geckoview"
def distDir = "${topobjdir}/dist/geckoview"
def syncOmnijarFromDistDir
if (mozconfig.substs.COMPILE_ENVIRONMENT) {
syncOmnijarFromDistDir = task("syncOmnijarFromDistDirFor${variant.name.capitalize()}", type: Sync) {
onlyIf {
if (source.empty) {
throw new StopExecutionException("Required omnijar not found in ${omnijarDir}/{omni.ja,assets/omni.ja}. Have you built and packaged?")
}
return true
def syncOmnijarFromDistDir = task("syncOmnijarFromDistDirFor${variant.name.capitalize()}", type: Sync) {
onlyIf {
if (source.empty) {
throw new StopExecutionException("Required omnijar not found in ${omnijarDir}/{omni.ja,assets/omni.ja}. Have you built and packaged?")
}
return true
}
into("${project.buildDir}/moz.build/src/${variant.name}/omnijar")
from("${omnijarDir}/omni.ja",
"${omnijarDir}/assets/omni.ja") {
// Throw an exception if we find multiple, potentially conflicting omni.ja files.
duplicatesStrategy 'fail'
}
into("${project.buildDir}/moz.build/src/${variant.name}/omnijar")
from("${omnijarDir}/omni.ja",
"${omnijarDir}/assets/omni.ja") {
// Throw an exception if we find multiple, potentially conflicting omni.ja files.
duplicatesStrategy 'fail'
}
}
@ -267,33 +264,31 @@ ext.configureVariantWithGeckoBinaries = { variant ->
}
}
if (mozconfig.substs.COMPILE_ENVIRONMENT) {
// Local (read, not 'official') builds want to reflect developer changes to
// the omnijar sources, and (when compiling) to reflect developer changes to
// the native binaries. To do this, the Gradle build calls out to the
// moz.build system, which can be re-entrant. Official builds are driven by
// the moz.build system and should never be re-entrant in this way.
if (!mozconfig.substs.MOZILLA_OFFICIAL) {
syncOmnijarFromDistDir.dependsOn rootProject.machStagePackage
syncLibsFromDistDir.dependsOn rootProject.machStagePackage
syncAssetsFromDistDir.dependsOn rootProject.machStagePackage
}
// Local (read, not 'official') builds want to reflect developer changes to
// the omnijar sources, and (when compiling) to reflect developer changes to
// the native binaries. To do this, the Gradle build calls out to the
// moz.build system, which can be re-entrant. Official builds are driven by
// the moz.build system and should never be re-entrant in this way.
if (!mozconfig.substs.MOZILLA_OFFICIAL) {
syncOmnijarFromDistDir.dependsOn rootProject.machStagePackage
syncLibsFromDistDir.dependsOn rootProject.machStagePackage
syncAssetsFromDistDir.dependsOn rootProject.machStagePackage
}
def assetGenTask = tasks.findByName("generate${variant.name.capitalize()}Assets")
def jniLibFoldersTask = tasks.findByName("merge${variant.name.capitalize()}JniLibFolders")
if ((variant.productFlavors*.name).contains('withGeckoBinaries')) {
assetGenTask.dependsOn syncOmnijarFromDistDir
assetGenTask.dependsOn syncAssetsFromDistDir
jniLibFoldersTask.dependsOn syncLibsFromDistDir
def assetGenTask = tasks.findByName("generate${variant.name.capitalize()}Assets")
def jniLibFoldersTask = tasks.findByName("merge${variant.name.capitalize()}JniLibFolders")
if ((variant.productFlavors*.name).contains('withGeckoBinaries')) {
assetGenTask.dependsOn syncOmnijarFromDistDir
assetGenTask.dependsOn syncAssetsFromDistDir
jniLibFoldersTask.dependsOn syncLibsFromDistDir
android.sourceSets."${variant.name}".assets.srcDir syncOmnijarFromDistDir.destinationDir
android.sourceSets."${variant.name}".assets.srcDir syncAssetsFromDistDir.destinationDir
android.sourceSets."${variant.name}".assets.srcDir syncOmnijarFromDistDir.destinationDir
android.sourceSets."${variant.name}".assets.srcDir syncAssetsFromDistDir.destinationDir
if (!mozconfig.substs.MOZ_ANDROID_FAT_AAR_ARCHITECTURES) {
android.sourceSets."${variant.name}".jniLibs.srcDir syncLibsFromDistDir.destinationDir
} else {
android.sourceSets."${variant.name}".jniLibs.srcDir "${topobjdir}/dist/fat-aar/output/jni"
}
if (!mozconfig.substs.MOZ_ANDROID_FAT_AAR_ARCHITECTURES) {
android.sourceSets."${variant.name}".jniLibs.srcDir syncLibsFromDistDir.destinationDir
} else {
android.sourceSets."${variant.name}".jniLibs.srcDir "${topobjdir}/dist/fat-aar/output/jni"
}
}
}
@ -319,9 +314,11 @@ ext.configureLibraryVariantWithJNIWrappers = { variant, module ->
// configuration-time: see above comment.
doFirst {
classpath variant.javaCompileProvider.get().classpath
// Include android.jar.
classpath variant.javaCompileProvider.get().options.bootstrapClasspath
}
mainClass = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
main = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
args module
args bundleJar

Просмотреть файл

@ -21,8 +21,8 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {

Просмотреть файл

@ -47,9 +47,9 @@ AVD_MANIFEST_ARM64 = os.path.abspath(
os.path.join(os.path.dirname(__file__), "android-avds/arm64.json")
)
JAVA_VERSION_MAJOR = "17"
JAVA_VERSION_MINOR = "0.1"
JAVA_VERSION_PATCH = "12"
JAVA_VERSION_MAJOR = "8"
JAVA_VERSION_MINOR = "u312"
JAVA_VERSION_PATCH = "b07"
ANDROID_NDK_EXISTS = """
Looks like you have the correct version of the Android NDK installed at:
@ -840,12 +840,8 @@ def ensure_java(os_name, os_arch):
else:
os_tag = os_name
if os_arch == "x86_64":
arch = "x64"
elif os_arch == "arm64":
arch = "aarch64"
else:
arch = os_arch
# One we migrate to Java 17 we will be able to use native arm64 binaries
arch = "x64"
ext = "zip" if os_name == "windows" else "tar.gz"
@ -854,12 +850,12 @@ def ensure_java(os_name, os_arch):
raise NotImplementedError(f"Could not bootstrap java for {os_name}.")
if not os.path.exists(java_path):
# e.g. https://github.com/adoptium/temurin17-binaries/releases/
# download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz
# e.g. https://github.com/adoptium/temurin8-binaries/releases/
# download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz
java_url = (
"https://github.com/adoptium/temurin{major}-binaries/releases/"
"download/jdk-{major}.{minor}%2B{patch}/"
"OpenJDK{major}U-jdk_{arch}_{os}_hotspot_{major}.{minor}_{patch}.{ext}"
"download/jdk{major}{minor}-{patch}/"
"OpenJDK{major}U-jdk_{arch}_{os}_hotspot_{major}{minor}{patch}.{ext}"
).format(
major=JAVA_VERSION_MAJOR,
minor=JAVA_VERSION_MINOR,
@ -873,8 +869,7 @@ def ensure_java(os_name, os_arch):
def java_bin_path(os_name, toolchain_path):
# Like jdk-17.0.1+12
jdk_folder = "jdk-{major}.{minor}+{patch}".format(
jdk_folder = "jdk{major}{minor}-{patch}".format(
major=JAVA_VERSION_MAJOR, minor=JAVA_VERSION_MINOR, patch=JAVA_VERSION_PATCH
)

Просмотреть файл

@ -596,7 +596,7 @@ class TestChecksConfigure(unittest.TestCase):
javac = mozpath.abspath("/usr/bin/javac")
paths = {java: None, javac: None}
expected_error_message = (
"ERROR: Could not locate Java at /mozbuild/jdk/jdk-17.0.1+12/bin, "
"ERROR: Could not locate Java at /mozbuild/jdk/jdk8u312-b07/bin, "
"please run ./mach bootstrap --no-system-changes\n"
)

Просмотреть файл

@ -461,17 +461,6 @@ sonatype-nexus:
strip-components: 1
add-prefix: sonatype-nexus/
jdk-8-linux64:
description: Java 8 JDK
fetch:
type: static-url
url: https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz
sha256: 699981083983b60a7eeb511ad640fae3ae4b879de5a3980fe837e8ade9c34a08
size: 103016010
artifact-name: jdk-8.tar.zst
strip-components: 1
add-prefix: jdk-8/
makecab:
description: makecab source code
fetch:

Просмотреть файл

@ -114,7 +114,7 @@ linux64-jdk-repack:
toolchain-artifact: project/gecko/jdk/jdk-linux.tar.zst
toolchain-alias: linux64-jdk
toolchain-env:
JAVA_HOME: "/builds/worker/fetches/jdk/jdk-17.0.1+12"
JAVA_HOME: "/builds/worker/fetches/jdk/jdk8u312-b07"
linux64-android-sdk-linux-repack:
description: "Android SDK (Linux) repack toolchain build"
@ -194,8 +194,6 @@ linux64-android-gradle-dependencies:
fetches:
fetch:
- sonatype-nexus
# Nexus needs Java 8
- jdk-8-linux64
toolchain:
# Aliases aren't allowed for toolchains depending on toolchains.
- linux64-android-sdk-linux-repack
@ -224,8 +222,6 @@ linux64-android-gradle-dependencies-lite:
fetches:
fetch:
- sonatype-nexus
# Nexus needs Java 8
- jdk-8-linux64
toolchain:
# Aliases aren't allowed for toolchains depending on toolchains.
- linux64-android-sdk-linux-repack

Просмотреть файл

@ -9,7 +9,7 @@ set -v
cd $GECKO_PATH
# Needed for Nexus
export PATH=$MOZ_FETCHES_DIR/jdk-8/bin:$PATH
export PATH=$JAVA_HOME/bin:$PATH
. taskcluster/scripts/misc/android-gradle-dependencies/before.sh

Просмотреть файл

@ -8,8 +8,8 @@ set -v
cd $GECKO_PATH
# Nexus needs Java 8
export PATH=$MOZ_FETCHES_DIR/jdk-8/bin:$PATH
# Needed for Nexus
export PATH=$JAVA_HOME/bin:$PATH
. taskcluster/scripts/misc/android-gradle-dependencies/before.sh

Просмотреть файл

@ -194,10 +194,7 @@ def javadoc(config, **lintargs):
for issue in issues:
issue["path"] = issue["path"].replace(lintargs["root"], "")
# We want warnings to be errors for linting purposes.
# TODO: Bug 1316188 - resolve missing javadoc comments
issue["level"] = (
"error" if issue["message"] != ": no comment" else "warning"
)
issue["level"] = "error"
results.append(result.from_config(config, **issue))
return results
@ -232,10 +229,6 @@ def lint(config, **lintargs):
for issue in root.findall("issue"):
location = issue[0]
if "third_party" in location.get("file") or "thirdparty" in location.get(
"file"
):
continue
err = {
"level": issue.get("severity").lower(),
"rule": issue.get("id"),