summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-14 16:57:01 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-01 15:17:54 +0200
commit28a3cd1028612b3b577768519d11fa6fbcda6f09 (patch)
tree61a64f843d3bfed644305987dbe1482d7b39c11a
parentf987138760b344a8869e319f28400acc438d0553 (diff)
downloaduxp-28a3cd1028612b3b577768519d11fa6fbcda6f09.tar.gz
Issue #1053 - First pass Android defines and remove Android Annotation
processors, some Andoid packaging stuff, Eclipse IDE support et al.
-rw-r--r--build/annotationProcessors/AnnotationInfo.java54
-rw-r--r--build/annotationProcessors/AnnotationProcessor.java175
-rw-r--r--build/annotationProcessors/CodeGenerator.java627
-rw-r--r--build/annotationProcessors/Makefile.in10
-rw-r--r--build/annotationProcessors/SDKProcessor.java258
-rw-r--r--build/annotationProcessors/classloader/AnnotatableEntity.java62
-rw-r--r--build/annotationProcessors/classloader/ClassWithOptions.java15
-rw-r--r--build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java75
-rw-r--r--build/annotationProcessors/classloader/JarClassIterator.java84
-rw-r--r--build/annotationProcessors/moz.build23
-rw-r--r--build/annotationProcessors/utils/AlphabeticAnnotatableEntityComparator.java81
-rw-r--r--build/annotationProcessors/utils/GeneratableElementIterator.java267
-rw-r--r--build/annotationProcessors/utils/Utils.java288
-rw-r--r--build/autoconf/compiler-opts.m415
-rw-r--r--build/gyp.mozbuild14
-rw-r--r--build/moz.build8
-rw-r--r--build/moz.configure/memory.configure8
-rw-r--r--config/android-common.mk51
-rw-r--r--config/external/nss/Makefile.in9
-rw-r--r--config/makefiles/java-build.mk159
-rw-r--r--config/rules.mk7
-rw-r--r--dom/html/HTMLInputElement.cpp18
-rw-r--r--dom/html/HTMLInputElement.h2
-rw-r--r--dom/ipc/ProcessPriorityManager.cpp15
-rw-r--r--dom/media/MediaManager.cpp25
-rw-r--r--dom/media/MediaStreamGraph.cpp9
-rw-r--r--dom/media/moz.build6
-rw-r--r--dom/media/systemservices/LoadMonitor.cpp4
-rw-r--r--dom/system/OSFileConstants.cpp11
-rw-r--r--js/src/ctypes/libffi/src/closures.c2
-rw-r--r--js/src/ds/MemoryProtectionExceptionHandler.cpp6
-rw-r--r--js/src/jit/ExecutableAllocator.h2
-rw-r--r--js/src/jit/arm/Architecture-arm.cpp9
-rw-r--r--js/src/jscntxt.cpp61
-rw-r--r--js/src/jsmath.cpp2
-rw-r--r--js/src/jsnativestack.cpp44
-rw-r--r--js/src/vtune/jitprofiling.c7
-rw-r--r--js/src/wasm/WasmSignalHandlers.cpp106
-rw-r--r--js/xpconnect/loader/mozJSComponentLoader.cpp6
-rw-r--r--js/xpconnect/src/Sandbox.cpp4
-rw-r--r--js/xpconnect/src/XPCJSContext.cpp6
-rw-r--r--js/xpconnect/src/XPCShellImpl.cpp7
-rw-r--r--old-configure.in100
-rw-r--r--python/mozbuild/mozbuild/backend/recursivemake.py57
-rw-r--r--python/mozbuild/mozbuild/frontend/context.py86
-rw-r--r--python/mozbuild/mozbuild/frontend/emitter.py28
-rw-r--r--python/mozbuild/mozbuild/frontend/reader.py29
-rw-r--r--security/manager/android_stub.h44
-rw-r--r--toolkit/components/telemetry/Histograms.json251
-rw-r--r--toolkit/components/telemetry/histogram-whitelists.json50
-rw-r--r--toolkit/modules/AppConstants.jsm1
-rw-r--r--toolkit/modules/moz.build3
52 files changed, 31 insertions, 3260 deletions
diff --git a/build/annotationProcessors/AnnotationInfo.java b/build/annotationProcessors/AnnotationInfo.java
deleted file mode 100644
index a8dbc53ce9..0000000000
--- a/build/annotationProcessors/AnnotationInfo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* 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.annotationProcessors;
-
-/**
- * Object holding annotation data. Used by GeneratableElementIterator.
- */
-public class AnnotationInfo {
- public enum ExceptionMode {
- ABORT,
- NSRESULT,
- IGNORE;
-
- String nativeValue() {
- return "mozilla::jni::ExceptionMode::" + name();
- }
- }
-
- public enum CallingThread {
- GECKO,
- UI,
- ANY;
-
- String nativeValue() {
- return "mozilla::jni::CallingThread::" + name();
- }
- }
-
- public enum DispatchTarget {
- GECKO,
- PROXY,
- CURRENT;
-
- String nativeValue() {
- return "mozilla::jni::DispatchTarget::" + name();
- }
- }
-
- public final String wrapperName;
- public final ExceptionMode exceptionMode;
- public final CallingThread callingThread;
- public final DispatchTarget dispatchTarget;
-
- public AnnotationInfo(String wrapperName, ExceptionMode exceptionMode,
- CallingThread callingThread, DispatchTarget dispatchTarget) {
-
- this.wrapperName = wrapperName;
- this.exceptionMode = exceptionMode;
- this.callingThread = callingThread;
- this.dispatchTarget = dispatchTarget;
- }
-}
diff --git a/build/annotationProcessors/AnnotationProcessor.java b/build/annotationProcessors/AnnotationProcessor.java
deleted file mode 100644
index 4f53317cd4..0000000000
--- a/build/annotationProcessors/AnnotationProcessor.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* 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.annotationProcessors;
-
-import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
-import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
-import org.mozilla.gecko.annotationProcessors.classloader.IterableJarLoadingURLClassLoader;
-import org.mozilla.gecko.annotationProcessors.utils.GeneratableElementIterator;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Iterator;
-
-public class AnnotationProcessor {
- public static final String GENERATED_COMMENT =
- "// GENERATED CODE\n" +
- "// Generated by the Java program at /build/annotationProcessors at compile time\n" +
- "// from annotations on Java methods. To update, change the annotations on the\n" +
- "// corresponding Java methods and rerun the build. Manually updating this file\n" +
- "// will cause your build to fail.\n" +
- "\n";
-
- private static final StringBuilder headerFile = new StringBuilder(GENERATED_COMMENT);
- private static final StringBuilder implementationFile = new StringBuilder(GENERATED_COMMENT);
- private static final StringBuilder nativesFile = new StringBuilder(GENERATED_COMMENT);
-
- public static void main(String[] args) {
- // We expect a list of jars on the commandline. If missing, whinge about it.
- if (args.length <= 2) {
- System.err.println("Usage: java AnnotationProcessor outprefix jarfiles ...");
- System.exit(1);
- }
-
- final String OUTPUT_PREFIX = args[0];
- final String SOURCE_FILE = OUTPUT_PREFIX + "JNIWrappers.cpp";
- final String HEADER_FILE = OUTPUT_PREFIX + "JNIWrappers.h";
- final String NATIVES_FILE = OUTPUT_PREFIX + "JNINatives.h";
-
- System.out.println("Processing annotations...");
-
- // We want to produce the same output as last time as often as possible. Ordering of
- // generated statements, therefore, needs to be consistent.
- final String[] jars = Arrays.copyOfRange(args, 1, args.length);
- Arrays.sort(jars);
-
- // Start the clock!
- long s = System.currentTimeMillis();
-
- // Get an iterator over the classes in the jar files given...
- Iterator<ClassWithOptions> jarClassIterator = IterableJarLoadingURLClassLoader.getIteratorOverJars(jars);
-
- headerFile.append(
- "#ifndef " + getHeaderGuardName(HEADER_FILE) + "\n" +
- "#define " + getHeaderGuardName(HEADER_FILE) + "\n" +
- "\n" +
- "#include \"mozilla/jni/Refs.h\"\n" +
- "\n" +
- "namespace mozilla {\n" +
- "namespace java {\n" +
- "\n");
-
- implementationFile.append(
- "#include \"" + HEADER_FILE + "\"\n" +
- "#include \"mozilla/jni/Accessors.h\"\n" +
- "\n" +
- "namespace mozilla {\n" +
- "namespace java {\n" +
- "\n");
-
- nativesFile.append(
- "#ifndef " + getHeaderGuardName(NATIVES_FILE) + "\n" +
- "#define " + getHeaderGuardName(NATIVES_FILE) + "\n" +
- "\n" +
- "#include \"" + HEADER_FILE + "\"\n" +
- "#include \"mozilla/jni/Natives.h\"\n" +
- "\n" +
- "namespace mozilla {\n" +
- "namespace java {\n" +
- "\n");
-
- while (jarClassIterator.hasNext()) {
- generateClass(jarClassIterator.next());
- }
-
- implementationFile.append(
- "} /* java */\n" +
- "} /* mozilla */\n");
-
- headerFile.append(
- "} /* java */\n" +
- "} /* mozilla */\n" +
- "#endif // " + getHeaderGuardName(HEADER_FILE) + "\n");
-
- nativesFile.append(
- "} /* java */\n" +
- "} /* mozilla */\n" +
- "#endif // " + getHeaderGuardName(NATIVES_FILE) + "\n");
-
- writeOutputFile(SOURCE_FILE, implementationFile);
- writeOutputFile(HEADER_FILE, headerFile);
- writeOutputFile(NATIVES_FILE, nativesFile);
-
- long e = System.currentTimeMillis();
- System.out.println("Annotation processing complete in " + (e - s) + "ms");
- }
-
- private static void generateClass(final ClassWithOptions annotatedClass) {
- // Get an iterator over the appropriately generated methods of this class
- final GeneratableElementIterator methodIterator
- = new GeneratableElementIterator(annotatedClass);
- final ClassWithOptions[] innerClasses = methodIterator.getInnerClasses();
-
- if (!methodIterator.hasNext() && innerClasses.length == 0) {
- return;
- }
-
- final CodeGenerator generatorInstance = new CodeGenerator(annotatedClass);
- generatorInstance.generateClasses(innerClasses);
-
- // Iterate all annotated members in this class..
- while (methodIterator.hasNext()) {
- AnnotatableEntity aElementTuple = methodIterator.next();
- switch (aElementTuple.mEntityType) {
- case METHOD:
- generatorInstance.generateMethod(aElementTuple);
- break;
- case NATIVE:
- generatorInstance.generateNative(aElementTuple);
- break;
- case FIELD:
- generatorInstance.generateField(aElementTuple);
- break;
- case CONSTRUCTOR:
- generatorInstance.generateConstructor(aElementTuple);
- break;
- }
- }
-
- headerFile.append(generatorInstance.getHeaderFileContents());
- implementationFile.append(generatorInstance.getWrapperFileContents());
- nativesFile.append(generatorInstance.getNativesFileContents());
-
- for (ClassWithOptions innerClass : innerClasses) {
- generateClass(innerClass);
- }
- }
-
- private static String getHeaderGuardName(final String name) {
- return name.replaceAll("\\W", "_");
- }
-
- private static void writeOutputFile(final String name,
- final StringBuilder content) {
- FileOutputStream outStream = null;
- try {
- outStream = new FileOutputStream(name);
- outStream.write(content.toString().getBytes());
- } catch (IOException e) {
- System.err.println("Unable to write " + name + ". Perhaps a permissions issue?");
- e.printStackTrace(System.err);
- } finally {
- if (outStream != null) {
- try {
- outStream.close();
- } catch (IOException e) {
- System.err.println("Unable to close outStream due to "+e);
- e.printStackTrace(System.err);
- }
- }
- }
- }
-}
diff --git a/build/annotationProcessors/CodeGenerator.java b/build/annotationProcessors/CodeGenerator.java
deleted file mode 100644
index 56d257c037..0000000000
--- a/build/annotationProcessors/CodeGenerator.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/* 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.annotationProcessors;
-
-import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
-import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
-import org.mozilla.gecko.annotationProcessors.utils.Utils;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.HashSet;
-
-public class CodeGenerator {
- private static final Class<?>[] EMPTY_CLASS_ARRAY = new Class<?>[0];
-
- // Buffers holding the strings to ultimately be written to the output files.
- private final StringBuilder cpp = new StringBuilder();
- private final StringBuilder header = new StringBuilder();
- private final StringBuilder natives = new StringBuilder();
- private final StringBuilder nativesInits = new StringBuilder();
-
- private final Class<?> cls;
- private final String clsName;
- private AnnotationInfo.CallingThread callingThread = null;
- private int numNativesInits;
-
- private final HashSet<String> takenMethodNames = new HashSet<String>();
-
- public CodeGenerator(ClassWithOptions annotatedClass) {
- this.cls = annotatedClass.wrappedClass;
- this.clsName = annotatedClass.generatedName;
-
- final String unqualifiedName = Utils.getUnqualifiedName(clsName);
- header.append(
- "class " + clsName + " : public mozilla::jni::ObjectBase<" +
- unqualifiedName + ">\n" +
- "{\n" +
- "public:\n" +
- " static const char name[];\n" +
- "\n" +
- " explicit " + unqualifiedName + "(const Context& ctx) : ObjectBase<" +
- unqualifiedName + ">(ctx) {}\n" +
- "\n");
-
- cpp.append(
- "const char " + clsName + "::name[] =\n" +
- " \"" + cls.getName().replace('.', '/') + "\";\n" +
- "\n");
-
- natives.append(
- "template<class Impl>\n" +
- "class " + clsName + "::Natives : " +
- "public mozilla::jni::NativeImpl<" + unqualifiedName + ", Impl>\n" +
- "{\n" +
- "public:\n");
- }
-
- private String getTraitsName(String uniqueName, boolean includeScope) {
- return (includeScope ? clsName + "::" : "") + uniqueName + "_t";
- }
-
- /**
- * Return the C++ type name for this class or any class within the chain
- * of declaring classes, if the target class matches the given type.
- *
- * Return null if the given type does not match any class searched.
- */
- private String getMatchingClassType(final Class<?> type) {
- Class<?> cls = this.cls;
- String clsName = this.clsName;
-
- while (cls != null) {
- if (type.equals(cls)) {
- return clsName;
- }
- cls = cls.getDeclaringClass();
- clsName = clsName.substring(0, Math.max(0, clsName.lastIndexOf("::")));
- }
- return null;
- }
-
- private String getNativeParameterType(Class<?> type, AnnotationInfo info) {
- final String clsName = getMatchingClassType(type);
- if (clsName != null) {
- return Utils.getUnqualifiedName(clsName) + "::Param";
- }
- return Utils.getNativeParameterType(type, info);
- }
-
- private String getNativeReturnType(Class<?> type, AnnotationInfo info) {
- final String clsName = getMatchingClassType(type);
- if (clsName != null) {
- return Utils.getUnqualifiedName(clsName) + "::LocalRef";
- }
- return Utils.getNativeReturnType(type, info);
- }
-
- private void generateMember(AnnotationInfo info, Member member,
- String uniqueName, Class<?> type, Class<?>[] argTypes) {
- final StringBuilder args = new StringBuilder();
- for (Class<?> argType : argTypes) {
- args.append("\n " + getNativeParameterType(argType, info) + ",");
- }
- if (args.length() > 0) {
- args.setLength(args.length() - 1);
- }
-
- header.append(
- " struct " + getTraitsName(uniqueName, /* includeScope */ false) + " {\n" +
- " typedef " + Utils.getUnqualifiedName(clsName) + " Owner;\n" +
- " typedef " + getNativeReturnType(type, info) + " ReturnType;\n" +
- " typedef " + getNativeParameterType(type, info) + " SetterType;\n" +
- " typedef mozilla::jni::Args<" + args + "> Args;\n" +
- " static constexpr char name[] = \"" +
- Utils.getMemberName(member) + "\";\n" +
- " static constexpr char signature[] =\n" +
- " \"" + Utils.getSignature(member) + "\";\n" +
- " static const bool isStatic = " + Utils.isStatic(member) + ";\n" +
- " static const mozilla::jni::ExceptionMode exceptionMode =\n" +
- " " + info.exceptionMode.nativeValue() + ";\n" +
- " static const mozilla::jni::CallingThread callingThread =\n" +
- " " + info.callingThread.nativeValue() + ";\n" +
- " static const mozilla::jni::DispatchTarget dispatchTarget =\n" +
- " " + info.dispatchTarget.nativeValue() + ";\n" +
- " };\n" +
- "\n");
-
- cpp.append(
- "constexpr char " + getTraitsName(uniqueName, /* includeScope */ true) +
- "::name[];\n" +
- "constexpr char " + getTraitsName(uniqueName, /* includeScope */ true) +
- "::signature[];\n" +
- "\n");
-
- if (this.callingThread == null) {
- this.callingThread = info.callingThread;
- } else if (this.callingThread != info.callingThread) {
- // We have a mix of calling threads, so specify "any" for the whole class.
- this.callingThread = AnnotationInfo.CallingThread.ANY;
- }
- }
-
- private String getUniqueMethodName(String basename) {
- String newName = basename;
- int index = 1;
-
- while (takenMethodNames.contains(newName)) {
- newName = basename + (++index);
- }
-
- takenMethodNames.add(newName);
- return newName;
- }
-
- /**
- * Generate a method prototype that includes return and argument types,
- * without specifiers (static, const, etc.).
- */
- private String generatePrototype(String name, Class<?>[] argTypes,
- Class<?> returnType, AnnotationInfo info,
- boolean includeScope, boolean includeArgName,
- boolean isConst) {
-
- final StringBuilder proto = new StringBuilder();
- int argIndex = 0;
-
- proto.append("auto ");
-
- if (includeScope) {
- proto.append(clsName).append("::");
- }
-
- proto.append(name).append('(');
-
- for (Class<?> argType : argTypes) {
- proto.append(getNativeParameterType(argType, info));
- if (includeArgName) {
- proto.append(" a").append(argIndex++);
- }
- proto.append(", ");
- }
-
- if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT &&
- !returnType.equals(void.class)) {
- proto.append(getNativeReturnType(returnType, info)).append('*');
- if (includeArgName) {
- proto.append(" a").append(argIndex++);
- }
- proto.append(", ");
- }
-
- if (proto.substring(proto.length() - 2).equals(", ")) {
- proto.setLength(proto.length() - 2);
- }
-
- proto.append(')');
-
- if (isConst) {
- proto.append(" const");
- }
-
- if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
- proto.append(" -> nsresult");
- } else {
- proto.append(" -> ").append(getNativeReturnType(returnType, info));
- }
- return proto.toString();
- }
-
- /**
- * Generate a method declaration that includes the prototype with specifiers,
- * but without the method body.
- */
- private String generateDeclaration(String name, Class<?>[] argTypes,
- Class<?> returnType, AnnotationInfo info,
- boolean isStatic) {
-
- return (isStatic ? "static " : "") +
- generatePrototype(name, argTypes, returnType, info,
- /* includeScope */ false, /* includeArgName */ false,
- /* isConst */ !isStatic) + ';';
- }
-
- /**
- * Generate a method definition that includes the prototype with specifiers,
- * and with the method body.
- */
- private String generateDefinition(String accessorName, String name, Class<?>[] argTypes,
- Class<?> returnType, AnnotationInfo info, boolean isStatic) {
-
- final StringBuilder def = new StringBuilder(
- generatePrototype(name, argTypes, returnType, info,
- /* includeScope */ true, /* includeArgName */ true,
- /* isConst */ !isStatic));
- def.append("\n{\n");
-
-
- // Generate code to handle the return value, if needed.
- // We initialize rv to NS_OK instead of NS_ERROR_* because loading NS_OK (0) uses
- // fewer instructions. We are guaranteed to set rv to the correct value later.
-
- if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT &&
- returnType.equals(void.class)) {
- def.append(
- " nsresult rv = NS_OK;\n" +
- " ");
-
- } else if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
- // Non-void return type
- final String resultArg = "a" + argTypes.length;
- def.append(
- " MOZ_ASSERT(" + resultArg + ");\n" +
- " nsresult rv = NS_OK;\n" +
- " *" + resultArg + " = ");
-
- } else {
- def.append(
- " return ");
- }
-
-
- // Generate a call, e.g., Method<Traits>::Call(a0, a1, a2);
-
- def.append(accessorName).append("(")
- .append(Utils.getUnqualifiedName(clsName) +
- (isStatic ? "::Context()" : "::mCtx"));
-
- if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
- def.append(", &rv");
- } else {
- def.append(", nullptr");
- }
-
- // Generate the call argument list.
- for (int argIndex = 0; argIndex < argTypes.length; argIndex++) {
- def.append(", a").append(argIndex);
- }
-
- def.append(");\n");
-
-
- if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
- def.append(" return rv;\n");
- }
-
- return def.append("}").toString();
- }
-
- /**
- * Append the appropriate generated code to the buffers for the method provided.
- *
- * @param annotatedMethod The Java method, plus annotation data.
- */
- public void generateMethod(AnnotatableEntity annotatedMethod) {
- // Unpack the tuple and extract some useful fields from the Method..
- final Method method = annotatedMethod.getMethod();
- final AnnotationInfo info = annotatedMethod.mAnnotationInfo;
- final String uniqueName = getUniqueMethodName(info.wrapperName);
- final Class<?>[] argTypes = method.getParameterTypes();
- final Class<?> returnType = method.getReturnType();
-
- if (method.isSynthetic()) {
- return;
- }
-
- // Sanity check
- if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT) {
- throw new IllegalStateException("Invalid dispatch target \"" +
- info.dispatchTarget.name().toLowerCase() +
- "\" for non-native method " + clsName + "::" + uniqueName);
- }
-
- generateMember(info, method, uniqueName, returnType, argTypes);
-
- final boolean isStatic = Utils.isStatic(method);
-
- header.append(
- " " + generateDeclaration(info.wrapperName, argTypes,
- returnType, info, isStatic) + "\n" +
- "\n");
-
- cpp.append(
- generateDefinition(
- "mozilla::jni::Method<" +
- getTraitsName(uniqueName, /* includeScope */ false) + ">::Call",
- info.wrapperName, argTypes, returnType, info, isStatic) + "\n" +
- "\n");
- }
-
- /**
- * Append the appropriate generated code to the buffers for the native method provided.
- *
- * @param annotatedMethod The Java native method, plus annotation data.
- */
- public void generateNative(AnnotatableEntity annotatedMethod) {
- // Unpack the tuple and extract some useful fields from the Method..
- final Method method = annotatedMethod.getMethod();
- final AnnotationInfo info = annotatedMethod.mAnnotationInfo;
- final String uniqueName = getUniqueMethodName(info.wrapperName);
- final Class<?>[] argTypes = method.getParameterTypes();
- final Class<?> returnType = method.getReturnType();
-
- // Sanity check
- if (info.exceptionMode != AnnotationInfo.ExceptionMode.ABORT &&
- info.exceptionMode != AnnotationInfo.ExceptionMode.IGNORE) {
- throw new IllegalStateException("Invalid exception mode \"" +
- info.exceptionMode.name().toLowerCase() +
- "\" for native method " + clsName + "::" + uniqueName);
- }
- if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT &&
- returnType != void.class) {
- throw new IllegalStateException(
- "Must return void when not dispatching to current thread for native method " +
- clsName + "::" + uniqueName);
- }
-
- generateMember(info, method, uniqueName, returnType, argTypes);
-
- final String traits = getTraitsName(uniqueName, /* includeScope */ true);
-
- if (nativesInits.length() > 0) {
- nativesInits.append(',');
- }
-
- nativesInits.append(
- "\n" +
- "\n" +
- " mozilla::jni::MakeNativeMethod<" + traits + ">(\n" +
- " mozilla::jni::NativeStub<" + traits + ", Impl>\n" +
- " ::template Wrap<&Impl::" + info.wrapperName + ">)");
- numNativesInits++;
- }
-
- private String getLiteral(Object val, AnnotationInfo info) {
- final Class<?> type = val.getClass();
-
- if (type.equals(char.class) || type.equals(Character.class)) {
- final char c = (char) val;
- if (c >= 0x20 && c < 0x7F) {
- return "'" + c + '\'';
- }
- return "u'\\u" + Integer.toHexString(0x10000 | (int) c).substring(1) + '\'';
-
- } else if (type.equals(CharSequence.class) || type.equals(String.class)) {
- final CharSequence str = (CharSequence) val;
- final StringBuilder out = new StringBuilder("u\"");
- for (int i = 0; i < str.length(); i++) {
- final char c = str.charAt(i);
- if (c >= 0x20 && c < 0x7F) {
- out.append(c);
- } else {
- out.append("\\u").append(Integer.toHexString(0x10000 | (int) c).substring(1));
- }
- }
- return out.append('"').toString();
- }
-
- return String.valueOf(val);
- }
-
- public void generateField(AnnotatableEntity annotatedField) {
- final Field field = annotatedField.getField();
- final AnnotationInfo info = annotatedField.mAnnotationInfo;
- final String uniqueName = info.wrapperName;
- final Class<?> type = field.getType();
-
- // Handles a peculiar case when dealing with enum types. We don't care about this field.
- // It just gets in the way and stops our code from compiling.
- if (field.isSynthetic() || field.getName().equals("$VALUES")) {
- return;
- }
-
- // Sanity check
- if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT) {
- throw new IllegalStateException("Invalid dispatch target \"" +
- info.dispatchTarget.name().toLowerCase() +
- "\" for field " + clsName + "::" + uniqueName);
- }
-
- final boolean isStatic = Utils.isStatic(field);
- final boolean isFinal = Utils.isFinal(field);
-
- if (isStatic && isFinal && (type.isPrimitive() || type.equals(String.class))) {
- Object val = null;
- try {
- field.setAccessible(true);
- val = field.get(null);
- } catch (final IllegalAccessException e) {
- }
-
- if (val != null && type.isPrimitive()) {
- // For static final primitive fields, we can use a "static const" declaration.
- header.append(
- " static const " + Utils.getNativeReturnType(type, info) +
- ' ' + info.wrapperName + " = " + getLiteral(val, info) + ";\n" +
- "\n");
- return;
-
- } else if (val != null && type.equals(String.class)) {
- final String nativeType = "char16_t";
-
- header.append(
- " static const " + nativeType + ' ' + info.wrapperName + "[];\n" +
- "\n");
-
- cpp.append(
- "const " + nativeType + ' ' + clsName + "::" + info.wrapperName +
- "[] = " + getLiteral(val, info) + ";\n" +
- "\n");
- return;
- }
-
- // Fall back to using accessors if we encounter an exception.
- }
-
- generateMember(info, field, uniqueName, type, EMPTY_CLASS_ARRAY);
-
- final Class<?>[] getterArgs = EMPTY_CLASS_ARRAY;
-
- header.append(
- " " + generateDeclaration(info.wrapperName, getterArgs,
- type, info, isStatic) + "\n" +
- "\n");
-
- cpp.append(
- generateDefinition(
- "mozilla::jni::Field<" +
- getTraitsName(uniqueName, /* includeScope */ false) + ">::Get",
- info.wrapperName, getterArgs, type, info, isStatic) + "\n" +
- "\n");
-
- if (isFinal) {
- return;
- }
-
- final Class<?>[] setterArgs = new Class<?>[] { type };
-
- header.append(
- " " + generateDeclaration(info.wrapperName, setterArgs,
- void.class, info, isStatic) + "\n" +
- "\n");
-
- cpp.append(
- generateDefinition(
- "mozilla::jni::Field<" +
- getTraitsName(uniqueName, /* includeScope */ false) + ">::Set",
- info.wrapperName, setterArgs, void.class, info, isStatic) + "\n" +
- "\n");
- }
-
- public void generateConstructor(AnnotatableEntity annotatedConstructor) {
- // Unpack the tuple and extract some useful fields from the Method..
- final Constructor<?> method = annotatedConstructor.getConstructor();
- final AnnotationInfo info = annotatedConstructor.mAnnotationInfo;
- final String wrapperName = "New";
- final String uniqueName = getUniqueMethodName(wrapperName);
- final Class<?>[] argTypes = method.getParameterTypes();
- final Class<?> returnType = cls;
-
- if (method.isSynthetic()) {
- return;
- }
-
- // Sanity check
- if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT) {
- throw new IllegalStateException("Invalid dispatch target \"" +
- info.dispatchTarget.name().toLowerCase() +
- "\" for constructor " + clsName + "::" + uniqueName);
- }
-
- generateMember(info, method, uniqueName, returnType, argTypes);
-
- header.append(
- " " + generateDeclaration(wrapperName, argTypes,
- returnType, info, /* isStatic */ true) + "\n" +
- "\n");
-
- cpp.append(
- generateDefinition(
- "mozilla::jni::Constructor<" +
- getTraitsName(uniqueName, /* includeScope */ false) + ">::Call",
- wrapperName, argTypes, returnType, info, /* isStatic */ true) + "\n" +
- "\n");
- }
-
- public void generateMembers(Member[] members) {
- for (Member m : members) {
- if (!Modifier.isPublic(m.getModifiers())) {
- continue;
- }
-
- String name = Utils.getMemberName(m);
- name = name.substring(0, 1).toUpperCase() + name.substring(1);
-
- // Default for SDK bindings.
- final AnnotationInfo info = new AnnotationInfo(name,
- AnnotationInfo.ExceptionMode.NSRESULT,
- AnnotationInfo.CallingThread.ANY,
- AnnotationInfo.DispatchTarget.CURRENT);
- final AnnotatableEntity entity = new AnnotatableEntity(m, info);
-
- if (m instanceof Constructor) {
- generateConstructor(entity);
- } else if (m instanceof Method) {
- generateMethod(entity);
- } else if (m instanceof Field) {
- generateField(entity);
- } else {
- throw new IllegalArgumentException(
- "expected member to be Constructor, Method, or Field");
- }
- }
- }
-
- public void generateClasses(final ClassWithOptions[] classes) {
- if (classes.length == 0) {
- return;
- }
-
- for (final ClassWithOptions cls : classes) {
- // Extract "Inner" from "Outer::Inner".
- header.append(
- " class " + Utils.getUnqualifiedName(cls.generatedName) + ";\n");
- }
- header.append('\n');
- }
-
- /**
- * Get the finalised bytes to go into the generated wrappers file.
- *
- * @return The bytes to be written to the wrappers file.
- */
- public String getWrapperFileContents() {
- return cpp.toString();
- }
-
- /**
- * Get the finalised bytes to go into the generated header file.
- *
- * @return The bytes to be written to the header file.
- */
- public String getHeaderFileContents() {
- if (this.callingThread == null) {
- this.callingThread = AnnotationInfo.CallingThread.ANY;
- }
-
- header.append(
- " static const mozilla::jni::CallingThread callingThread =\n" +
- " " + this.callingThread.nativeValue() + ";\n" +
- "\n");
-
- if (nativesInits.length() > 0) {
- header.append(
- " template<class Impl> class Natives;\n");
- }
- header.append(
- "};\n" +
- "\n");
- return header.toString();
- }
-
- /**
- * Get the finalised bytes to go into the generated natives header file.
- *
- * @return The bytes to be written to the header file.
- */
- public String getNativesFileContents() {
- if (nativesInits.length() == 0) {
- return "";
- }
- natives.append(
- " static const JNINativeMethod methods[" + numNativesInits + "];\n" +
- "};\n" +
- "\n" +
- "template<class Impl>\n" +
- "const JNINativeMethod " + clsName + "::Natives<Impl>::methods[] = {" + nativesInits + '\n' +
- "};\n" +
- "\n");
- return natives.toString();
- }
-}
diff --git a/build/annotationProcessors/Makefile.in b/build/annotationProcessors/Makefile.in
deleted file mode 100644
index 55b455e0a6..0000000000
--- a/build/annotationProcessors/Makefile.in
+++ /dev/null
@@ -1,10 +0,0 @@
-# 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/.
-
-include $(topsrcdir)/config/rules.mk
-
-# Include Android specific java flags, instead of what's in rules.mk.
-include $(topsrcdir)/config/android-common.mk
-
-export:: annotationProcessors.jar
diff --git a/build/annotationProcessors/SDKProcessor.java b/build/annotationProcessors/SDKProcessor.java
deleted file mode 100644
index 7928978c05..0000000000
--- a/build/annotationProcessors/SDKProcessor.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/* 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.annotationProcessors;
-
-import com.android.tools.lint.checks.ApiLookup;
-import com.android.tools.lint.LintCliClient;
-
-import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
-import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
-import org.mozilla.gecko.annotationProcessors.classloader.IterableJarLoadingURLClassLoader;
-import org.mozilla.gecko.annotationProcessors.utils.GeneratableElementIterator;
-import org.mozilla.gecko.annotationProcessors.utils.Utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Scanner;
-import java.util.Vector;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-public class SDKProcessor {
- public static final String GENERATED_COMMENT =
- "// GENERATED CODE\n" +
- "// Generated by the Java program at /build/annotationProcessors at compile time\n" +
- "// from annotations on Java methods. To update, change the annotations on the\n" +
- "// corresponding Javamethods and rerun the build. Manually updating this file\n" +
- "// will cause your build to fail.\n" +
- "\n";
-
- private static ApiLookup sApiLookup;
- private static int sMaxSdkVersion;
-
- public static void main(String[] args) throws Exception {
- // We expect a list of jars on the commandline. If missing, whinge about it.
- if (args.length < 5) {
- System.err.println("Usage: java SDKProcessor sdkjar classlistfile outdir fileprefix max-sdk-version");
- System.exit(1);
- }
-
- System.out.println("Processing platform bindings...");
-
- String sdkJar = args[0];
- Vector classes = getClassList(args[1]);
- String outdir = args[2];
- String generatedFilePrefix = args[3];
- sMaxSdkVersion = Integer.parseInt(args[4]);
-
- LintCliClient lintClient = new LintCliClient();
- sApiLookup = ApiLookup.get(lintClient);
-
- // Start the clock!
- long s = System.currentTimeMillis();
-
- // Get an iterator over the classes in the jar files given...
- // Iterator<ClassWithOptions> jarClassIterator = IterableJarLoadingURLClassLoader.getIteratorOverJars(args);
-
- StringBuilder headerFile = new StringBuilder(GENERATED_COMMENT);
- headerFile.append(
- "#ifndef " + generatedFilePrefix + "_h__\n" +
- "#define " + generatedFilePrefix + "_h__\n" +
- "\n" +
- "#include \"mozilla/jni/Refs.h\"\n" +
- "\n" +
- "namespace mozilla {\n" +
- "namespace java {\n" +
- "namespace sdk {\n" +
- "\n");
-
- StringBuilder implementationFile = new StringBuilder(GENERATED_COMMENT);
- implementationFile.append(
- "#include \"" + generatedFilePrefix + ".h\"\n" +
- "#include \"mozilla/jni/Accessors.h\"\n" +
- "\n" +
- "namespace mozilla {\n" +
- "namespace java {\n" +
- "namespace sdk {\n" +
- "\n");
-
- // Used to track the calls to the various class-specific initialisation functions.
- ClassLoader loader = null;
- try {
- loader = URLClassLoader.newInstance(new URL[] { new URL("file://" + sdkJar) },
- SDKProcessor.class.getClassLoader());
- } catch (Exception e) {
- throw new RuntimeException(e.toString());
- }
-
- for (Iterator<String> i = classes.iterator(); i.hasNext(); ) {
- String className = i.next();
- System.out.println("Looking up: " + className);
-
- generateClass(Class.forName(className, true, loader),
- implementationFile,
- headerFile);
- }
-
- implementationFile.append(
- "} /* sdk */\n" +
- "} /* java */\n" +
- "} /* mozilla */\n");
-
- headerFile.append(
- "} /* sdk */\n" +
- "} /* java */\n" +
- "} /* mozilla */\n" +
- "#endif\n");
-
- writeOutputFiles(outdir, generatedFilePrefix, headerFile, implementationFile);
- long e = System.currentTimeMillis();
- System.out.println("SDK processing complete in " + (e - s) + "ms");
- }
-
- private static int getAPIVersion(Class<?> cls, Member m) {
- if (m instanceof Method || m instanceof Constructor) {
- return sApiLookup.getCallVersion(
- cls.getName().replace('.', '/'),
- Utils.getMemberName(m),
- Utils.getSignature(m));
- } else if (m instanceof Field) {
- return sApiLookup.getFieldVersion(
- Utils.getClassDescriptor(m.getDeclaringClass()), m.getName());
- } else {
- throw new IllegalArgumentException("expected member to be Method, Constructor, or Field");
- }
- }
-
- private static Member[] sortAndFilterMembers(Class<?> cls, Member[] members) {
- Arrays.sort(members, new Comparator<Member>() {
- @Override
- public int compare(Member a, Member b) {
- return a.getName().compareTo(b.getName());
- }
- });
-
- ArrayList<Member> list = new ArrayList<>();
- for (Member m : members) {
- // Sometimes (e.g. Bundle) has methods that moved to/from a superclass in a later SDK
- // version, so we check for both classes and see if we can find a minimum SDK version.
- int version = getAPIVersion(cls, m);
- final int version2 = getAPIVersion(m.getDeclaringClass(), m);
- if (version2 > 0 && version2 < version) {
- version = version2;
- }
- if (version > sMaxSdkVersion) {
- System.out.println("Skipping " + m.getDeclaringClass().getName() + "." + m.getName() +
- ", version " + version + " > " + sMaxSdkVersion);
- continue;
- }
-
- // Sometimes (e.g. KeyEvent) a field can appear in both a class and a superclass. In
- // that case we want to filter out the version that appears in the superclass, or
- // we'll have bindings with duplicate names.
- try {
- if (m instanceof Field && !m.equals(cls.getField(m.getName()))) {
- // m is a field in a superclass that has been hidden by
- // a field with the same name in a subclass.
- System.out.println("Skipping " + m.getName() +
- " from " + m.getDeclaringClass());
- continue;
- }
- } catch (final NoSuchFieldException e) {
- }
-
- list.add(m);
- }
-
- return list.toArray(new Member[list.size()]);
- }
-
- private static void generateClass(Class<?> clazz,
- StringBuilder implementationFile,
- StringBuilder headerFile) {
- String generatedName = clazz.getSimpleName();
-
- CodeGenerator generator = new CodeGenerator(new ClassWithOptions(clazz, generatedName));
-
- generator.generateMembers(sortAndFilterMembers(clazz, clazz.getConstructors()));
- generator.generateMembers(sortAndFilterMembers(clazz, clazz.getMethods()));
- generator.generateMembers(sortAndFilterMembers(clazz, clazz.getFields()));
-
- headerFile.append(generator.getHeaderFileContents());
- implementationFile.append(generator.getWrapperFileContents());
- }
-
- private static Vector<String> getClassList(String path) {
- Scanner scanner = null;
- try {
- scanner = new Scanner(new FileInputStream(path));
-
- Vector lines = new Vector();
- while (scanner.hasNextLine()) {
- lines.add(scanner.nextLine());
- }
- return lines;
- } catch (Exception e) {
- System.out.println(e.toString());
- return null;
- } finally {
- if (scanner != null) {
- scanner.close();
- }
- }
- }
-
- private static void writeOutputFiles(String aOutputDir, String aPrefix, StringBuilder aHeaderFile,
- StringBuilder aImplementationFile) {
- FileOutputStream implStream = null;
- try {
- implStream = new FileOutputStream(new File(aOutputDir, aPrefix + ".cpp"));
- implStream.write(aImplementationFile.toString().getBytes());
- } catch (IOException e) {
- System.err.println("Unable to write " + aOutputDir + ". Perhaps a permissions issue?");
- e.printStackTrace(System.err);
- } finally {
- if (implStream != null) {
- try {
- implStream.close();
- } catch (IOException e) {
- System.err.println("Unable to close implStream due to "+e);
- e.printStackTrace(System.err);
- }
- }
- }
-
- FileOutputStream headerStream = null;
- try {
- headerStream = new FileOutputStream(new File(aOutputDir, aPrefix + ".h"));
- headerStream.write(aHeaderFile.toString().getBytes());
- } catch (IOException e) {
- System.err.println("Unable to write " + aOutputDir + ". Perhaps a permissions issue?");
- e.printStackTrace(System.err);
- } finally {
- if (headerStream != null) {
- try {
- headerStream.close();
- } catch (IOException e) {
- System.err.println("Unable to close headerStream due to "+e);
- e.printStackTrace(System.err);
- }
- }
- }
- }
-}
diff --git a/build/annotationProcessors/classloader/AnnotatableEntity.java b/build/annotationProcessors/classloader/AnnotatableEntity.java
deleted file mode 100644
index b11a6c49a6..0000000000
--- a/build/annotationProcessors/classloader/AnnotatableEntity.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* 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.annotationProcessors.classloader;
-
-import org.mozilla.gecko.annotationProcessors.AnnotationInfo;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-/**
- * Union type to hold either a method, field, or ctor. Allows us to iterate "The generatable stuff", despite
- * the fact that such things can be of either flavour.
- */
-public class AnnotatableEntity {
- public enum ENTITY_TYPE {METHOD, NATIVE, FIELD, CONSTRUCTOR}
-
- private final Member mMember;
- public final ENTITY_TYPE mEntityType;
-
- public final AnnotationInfo mAnnotationInfo;
-
- public AnnotatableEntity(Member aObject, AnnotationInfo aAnnotationInfo) {
- mMember = aObject;
- mAnnotationInfo = aAnnotationInfo;
-
- if (aObject instanceof Method) {
- if (Modifier.isNative(aObject.getModifiers())) {
- mEntityType = ENTITY_TYPE.NATIVE;
- } else {
- mEntityType = ENTITY_TYPE.METHOD;
- }
- } else if (aObject instanceof Field) {
- mEntityType = ENTITY_TYPE.FIELD;
- } else {
- mEntityType = ENTITY_TYPE.CONSTRUCTOR;
- }
- }
-
- public Method getMethod() {
- if (mEntityType != ENTITY_TYPE.METHOD && mEntityType != ENTITY_TYPE.NATIVE) {
- throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
- }
- return (Method) mMember;
- }
- public Field getField() {
- if (mEntityType != ENTITY_TYPE.FIELD) {
- throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
- }
- return (Field) mMember;
- }
- public Constructor<?> getConstructor() {
- if (mEntityType != ENTITY_TYPE.CONSTRUCTOR) {
- throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
- }
- return (Constructor<?>) mMember;
- }
-}
diff --git a/build/annotationProcessors/classloader/ClassWithOptions.java b/build/annotationProcessors/classloader/ClassWithOptions.java
deleted file mode 100644
index 070cff8b67..0000000000
--- a/build/annotationProcessors/classloader/ClassWithOptions.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/* 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.annotationProcessors.classloader;
-
-public class ClassWithOptions {
- public final Class<?> wrappedClass;
- public final String generatedName;
-
- public ClassWithOptions(Class<?> someClass, String name) {
- wrappedClass = someClass;
- generatedName = name;
- }
-}
diff --git a/build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java b/build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java
deleted file mode 100644
index 7e74399ca9..0000000000
--- a/build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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.annotationProcessors.classloader;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-/**
- * A classloader which can be initialised with a list of jar files and which can provide an iterator
- * over the top level classes in the jar files it was initialised with.
- * classNames is kept sorted to ensure iteration order is consistent across program invocations.
- * Otherwise, we'd forever be reporting the outdatedness of the generated code as we permute its
- * contents.
- */
-public class IterableJarLoadingURLClassLoader extends URLClassLoader {
- LinkedList<String> classNames = new LinkedList<String>();
-
- /**
- * Create an instance and return its iterator. Provides an iterator over the classes in the jar
- * files provided as arguments.
- * Inner classes are not supported.
- *
- * @param args A list of jar file names an iterator over the classes of which is desired.
- * @return An iterator over the top level classes in the jar files provided, in arbitrary order.
- */
- public static Iterator<ClassWithOptions> getIteratorOverJars(String[] args) {
- URL[] urlArray = new URL[args.length];
- LinkedList<String> aClassNames = new LinkedList<String>();
-
- for (int i = 0; i < args.length; i++) {
- try {
- urlArray[i] = (new File(args[i])).toURI().toURL();
-
- Enumeration<JarEntry> entries = new JarFile(args[i]).entries();
- while (entries.hasMoreElements()) {
- JarEntry e = entries.nextElement();
- String fName = e.getName();
- if (!fName.endsWith(".class")) {
- continue;
- }
- final String className = fName.substring(0, fName.length() - 6).replace('/', '.');
-
- aClassNames.add(className);
- }
- } catch (IOException e) {
- System.err.println("Error loading jar file \"" + args[i] + '"');
- e.printStackTrace(System.err);
- }
- }
- Collections.sort(aClassNames);
- return new JarClassIterator(new IterableJarLoadingURLClassLoader(urlArray, aClassNames));
- }
-
- /**
- * Constructs a classloader capable of loading all classes given as URLs in urls. Used by static
- * method above.
- *
- * @param urls URLs for all classes the new instance shall be capable of loading.
- * @param aClassNames A list of names of the classes this instance shall be capable of loading.
- */
- protected IterableJarLoadingURLClassLoader(URL[] urls, LinkedList<String> aClassNames) {// Array to populate with URLs for each class in the given jars.
- super(urls);
- classNames = aClassNames;
- }
-}
diff --git a/build/annotationProcessors/classloader/JarClassIterator.java b/build/annotationProcessors/classloader/JarClassIterator.java
deleted file mode 100644
index 452de8131e..0000000000
--- a/build/annotationProcessors/classloader/JarClassIterator.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* 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.annotationProcessors.classloader;
-
-import java.util.Iterator;
-
-/**
- * Class for iterating over an IterableJarLoadingURLClassLoader's classes.
- *
- * This class is not thread safe: use it only from a single thread.
- */
-public class JarClassIterator implements Iterator<ClassWithOptions> {
- private IterableJarLoadingURLClassLoader mTarget;
- private Iterator<String> mTargetClassListIterator;
-
- private ClassWithOptions lookAhead;
-
- public JarClassIterator(IterableJarLoadingURLClassLoader aTarget) {
- mTarget = aTarget;
- mTargetClassListIterator = aTarget.classNames.iterator();
- }
-
- @Override
- public boolean hasNext() {
- return fillLookAheadIfPossible();
- }
-
- @Override
- public ClassWithOptions next() {
- if (!fillLookAheadIfPossible()) {
- throw new IllegalStateException("Failed to look ahead in next()!");
- }
- ClassWithOptions next = lookAhead;
- lookAhead = null;
- return next;
- }
-
- private boolean fillLookAheadIfPossible() {
- if (lookAhead != null) {
- return true;
- }
-
- if (!mTargetClassListIterator.hasNext()) {
- return false;
- }
-
- String className = mTargetClassListIterator.next();
- try {
- Class<?> ret = mTarget.loadClass(className);
-
- // Incremental builds can leave stale classfiles in the jar. Such classfiles will cause
- // an exception at this point. We can safely ignore these classes - they cannot possibly
- // ever be loaded as they conflict with their parent class and will be killed by
- // Proguard later on anyway.
- final Class<?> enclosingClass;
- try {
- enclosingClass = ret.getEnclosingClass();
- } catch (IncompatibleClassChangeError e) {
- return fillLookAheadIfPossible();
- }
-
- if (enclosingClass != null) {
- // Anonymous inner class - unsupported.
- // Or named inner class, which will be processed when we process the outer class.
- return fillLookAheadIfPossible();
- }
-
- lookAhead = new ClassWithOptions(ret, ret.getSimpleName());
- return true;
- } catch (ClassNotFoundException e) {
- System.err.println("Unable to enumerate class: " + className + ". Corrupted jar file?");
- e.printStackTrace();
- System.exit(2);
- }
- return false;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Removal of classes from iterator not supported.");
- }
-}
diff --git a/build/annotationProcessors/moz.build b/build/annotationProcessors/moz.build
deleted file mode 100644
index f5db824749..0000000000
--- a/build/annotationProcessors/moz.build
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# 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/.
-
-jar = add_java_jar('annotationProcessors')
-jar.sources += [
- 'AnnotationInfo.java',
- 'AnnotationProcessor.java',
- 'classloader/AnnotatableEntity.java',
- 'classloader/ClassWithOptions.java',
- 'classloader/IterableJarLoadingURLClassLoader.java',
- 'classloader/JarClassIterator.java',
- 'CodeGenerator.java',
- 'SDKProcessor.java',
- 'utils/AlphabeticAnnotatableEntityComparator.java',
- 'utils/GeneratableElementIterator.java',
- 'utils/Utils.java',
-]
-jar.extra_jars += [
- CONFIG['ANDROID_TOOLS'] + '/lib/lint.jar',
- CONFIG['ANDROID_TOOLS'] + '/lib/lint-checks.jar',
-]
diff --git a/build/annotationProcessors/utils/AlphabeticAnnotatableEntityComparator.java b/build/annotationProcessors/utils/AlphabeticAnnotatableEntityComparator.java
deleted file mode 100644
index 2ee2ae56a5..0000000000
--- a/build/annotationProcessors/utils/AlphabeticAnnotatableEntityComparator.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 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.annotationProcessors.utils;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.util.Comparator;
-
-public class AlphabeticAnnotatableEntityComparator<T extends Member> implements Comparator<T> {
- @Override
- public int compare(T aLhs, T aRhs) {
- // Constructors, Methods, Fields.
- boolean lIsConstructor = aLhs instanceof Constructor;
- boolean rIsConstructor = aRhs instanceof Constructor;
- boolean lIsMethod = aLhs instanceof Method;
- boolean rIsField = aRhs instanceof Field;
-
- if (lIsConstructor) {
- if (!rIsConstructor) {
- return -1;
- }
- } else if (lIsMethod) {
- if (rIsConstructor) {
- return 1;
- } else if (rIsField) {
- return -1;
- }
- } else {
- if (!rIsField) {
- return 1;
- }
- }
-
- // Verify these objects are the same type and cast them.
- if (aLhs instanceof Method) {
- return compare((Method) aLhs, (Method) aRhs);
- } else if (aLhs instanceof Field) {
- return compare((Field) aLhs, (Field) aRhs);
- } else {
- return compare((Constructor) aLhs, (Constructor) aRhs);
- }
- }
-
- // Alas, the type system fails us.
- private static int compare(Method aLhs, Method aRhs) {
- // Initially, attempt to differentiate the methods be name alone..
- String lName = aLhs.getName();
- String rName = aRhs.getName();
-
- int ret = lName.compareTo(rName);
- if (ret != 0) {
- return ret;
- }
-
- // The names were the same, so we need to compare signatures to find their uniqueness..
- lName = Utils.getSignature(aLhs);
- rName = Utils.getSignature(aRhs);
-
- return lName.compareTo(rName);
- }
-
- private static int compare(Constructor<?> aLhs, Constructor<?> aRhs) {
- // The names will be the same, so we need to compare signatures to find their uniqueness..
- String lName = Utils.getSignature(aLhs);
- String rName = Utils.getSignature(aRhs);
-
- return lName.compareTo(rName);
- }
-
- private static int compare(Field aLhs, Field aRhs) {
- // Compare field names..
- String lName = aLhs.getName();
- String rName = aRhs.getName();
-
- return lName.compareTo(rName);
- }
-}
diff --git a/build/annotationProcessors/utils/GeneratableElementIterator.java b/build/annotationProcessors/utils/GeneratableElementIterator.java
deleted file mode 100644
index 8f94c8afa4..0000000000
--- a/build/annotationProcessors/utils/GeneratableElementIterator.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/* 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.annotationProcessors.utils;
-
-import org.mozilla.gecko.annotationProcessors.AnnotationInfo;
-import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
-import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Iterator;
-
-/**
- * Iterator over the methods in a given method list which have the WrappedJNIMethod
- * annotation. Returns an object containing both the annotation (Which may contain interesting
- * parameters) and the argument.
- */
-public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
- private final ClassWithOptions mClass;
- private final Member[] mObjects;
- private AnnotatableEntity mNextReturnValue;
- private int mElementIndex;
- private AnnotationInfo mClassInfo;
-
- private boolean mIterateEveryEntry;
- private boolean mSkipCurrentEntry;
-
- public GeneratableElementIterator(ClassWithOptions annotatedClass) {
- mClass = annotatedClass;
-
- final Class<?> aClass = annotatedClass.wrappedClass;
- // Get all the elements of this class as AccessibleObjects.
- Member[] aMethods = aClass.getDeclaredMethods();
- Member[] aFields = aClass.getDeclaredFields();
- Member[] aCtors = aClass.getDeclaredConstructors();
-
- // Shove them all into one buffer.
- Member[] objs = new Member[aMethods.length + aFields.length + aCtors.length];
-
- int offset = 0;
- System.arraycopy(aMethods, 0, objs, 0, aMethods.length);
- offset += aMethods.length;
- System.arraycopy(aFields, 0, objs, offset, aFields.length);
- offset += aFields.length;
- System.arraycopy(aCtors, 0, objs, offset, aCtors.length);
-
- // Sort the elements to ensure determinism.
- Arrays.sort(objs, new AlphabeticAnnotatableEntityComparator<Member>());
- mObjects = objs;
-
- // Check for "Wrap ALL the things" flag.
- for (Annotation annotation : aClass.getDeclaredAnnotations()) {
- mClassInfo = buildAnnotationInfo(aClass, annotation);
- if (mClassInfo != null) {
- mIterateEveryEntry = true;
- break;
- }
- }
-
- if (mSkipCurrentEntry) {
- throw new IllegalArgumentException("Cannot skip entire class");
- }
-
- findNextValue();
- }
-
- private Class<?>[] getFilteredInnerClasses() {
- // Go through all inner classes and see which ones we want to generate.
- final Class<?>[] candidates = mClass.wrappedClass.getDeclaredClasses();
- int count = 0;
-
- for (int i = 0; i < candidates.length; ++i) {
- final GeneratableElementIterator testIterator
- = new GeneratableElementIterator(new ClassWithOptions(candidates[i], null));
- if (testIterator.hasNext()
- || testIterator.getFilteredInnerClasses() != null) {
- count++;
- continue;
- }
- // Clear out ones that don't match.
- candidates[i] = null;
- }
- return count > 0 ? candidates : null;
- }
-
- public ClassWithOptions[] getInnerClasses() {
- final Class<?>[] candidates = getFilteredInnerClasses();
- if (candidates == null) {
- return new ClassWithOptions[0];
- }
-
- int count = 0;
- for (Class<?> candidate : candidates) {
- if (candidate != null) {
- count++;
- }
- }
-
- final ClassWithOptions[] ret = new ClassWithOptions[count];
- count = 0;
- for (Class<?> candidate : candidates) {
- if (candidate != null) {
- ret[count++] = new ClassWithOptions(
- candidate, mClass.generatedName + "::" + candidate.getSimpleName());
- }
- }
- assert ret.length == count;
-
- Arrays.sort(ret, new Comparator<ClassWithOptions>() {
- @Override public int compare(ClassWithOptions lhs, ClassWithOptions rhs) {
- return lhs.generatedName.compareTo(rhs.generatedName);
- }
- });
- return ret;
- }
-
- private static <T extends Enum<T>> T getEnumValue(Class<T> type, String name)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
- try {
- return Enum.valueOf(type, name.toUpperCase());
-
- } catch (IllegalArgumentException e) {
- Object[] values = (Object[]) type.getDeclaredMethod("values").invoke(null);
- StringBuilder names = new StringBuilder();
-
- for (int i = 0; i < values.length; i++) {
- if (i != 0) {
- names.append(", ");
- }
- names.append(values[i].toString().toLowerCase());
- }
-
- System.err.println("***");
- System.err.println("*** Invalid value \"" + name + "\" for " + type.getSimpleName());
- System.err.println("*** Specify one of " + names.toString());
- System.err.println("***");
- e.printStackTrace(System.err);
- System.exit(6);
- return null;
- }
- }
-
- private AnnotationInfo buildAnnotationInfo(AnnotatedElement element, Annotation annotation) {
- Class<? extends Annotation> annotationType = annotation.annotationType();
- final String annotationTypeName = annotationType.getName();
- if (!annotationTypeName.equals("org.mozilla.gecko.annotation.WrapForJNI")) {
- return null;
- }
-
- String stubName = null;
- AnnotationInfo.ExceptionMode exceptionMode = null;
- AnnotationInfo.CallingThread callingThread = null;
- AnnotationInfo.DispatchTarget dispatchTarget = null;
-
- try {
- final Method skipMethod = annotationType.getDeclaredMethod("skip");
- skipMethod.setAccessible(true);
- if ((Boolean) skipMethod.invoke(annotation)) {
- mSkipCurrentEntry = true;
- return null;
- }
-
- // Determine the explicitly-given name of the stub to generate, if any.
- final Method stubNameMethod = annotationType.getDeclaredMethod("stubName");
- stubNameMethod.setAccessible(true);
- stubName = (String) stubNameMethod.invoke(annotation);
-
- final Method exceptionModeMethod = annotationType.getDeclaredMethod("exceptionMode");
- exceptionModeMethod.setAccessible(true);
- exceptionMode = getEnumValue(
- AnnotationInfo.ExceptionMode.class,
- (String) exceptionModeMethod.invoke(annotation));
-
- final Method calledFromMethod = annotationType.getDeclaredMethod("calledFrom");
- calledFromMethod.setAccessible(true);
- callingThread = getEnumValue(
- AnnotationInfo.CallingThread.class,
- (String) calledFromMethod.invoke(annotation));
-
- final Method dispatchToMethod = annotationType.getDeclaredMethod("dispatchTo");
- dispatchToMethod.setAccessible(true);
- dispatchTarget = getEnumValue(
- AnnotationInfo.DispatchTarget.class,
- (String) dispatchToMethod.invoke(annotation));
-
- } catch (NoSuchMethodException e) {
- System.err.println("Unable to find expected field on WrapForJNI annotation. Did the signature change?");
- e.printStackTrace(System.err);
- System.exit(3);
- } catch (IllegalAccessException e) {
- System.err.println("IllegalAccessException reading fields on WrapForJNI annotation. Seems the semantics of Reflection have changed...");
- e.printStackTrace(System.err);
- System.exit(4);
- } catch (InvocationTargetException e) {
- System.err.println("InvocationTargetException reading fields on WrapForJNI annotation. This really shouldn't happen.");
- e.printStackTrace(System.err);
- System.exit(5);
- }
-
- // If the method name was not explicitly given in the annotation generate one...
- if (stubName.isEmpty()) {
- stubName = Utils.getNativeName(element);
- }
-
- return new AnnotationInfo(stubName, exceptionMode, callingThread, dispatchTarget);
- }
-
- /**
- * Find and cache the next appropriately annotated method, plus the annotation parameter, if
- * one exists. Otherwise cache null, so hasNext returns false.
- */
- private void findNextValue() {
- while (mElementIndex < mObjects.length) {
- Member candidateElement = mObjects[mElementIndex];
- mElementIndex++;
- for (Annotation annotation : ((AnnotatedElement) candidateElement).getDeclaredAnnotations()) {
- AnnotationInfo info = buildAnnotationInfo((AnnotatedElement)candidateElement, annotation);
- if (info != null) {
- mNextReturnValue = new AnnotatableEntity(candidateElement, info);
- return;
- }
- }
-
- if (mSkipCurrentEntry) {
- mSkipCurrentEntry = false;
- continue;
- }
-
- // If no annotation found, we might be expected to generate anyway
- // using default arguments, thanks to the "Generate everything" annotation.
- if (mIterateEveryEntry) {
- AnnotationInfo annotationInfo = new AnnotationInfo(
- Utils.getNativeName(candidateElement),
- mClassInfo.exceptionMode,
- mClassInfo.callingThread,
- mClassInfo.dispatchTarget);
- mNextReturnValue = new AnnotatableEntity(candidateElement, annotationInfo);
- return;
- }
- }
- mNextReturnValue = null;
- }
-
- @Override
- public boolean hasNext() {
- return mNextReturnValue != null;
- }
-
- @Override
- public AnnotatableEntity next() {
- AnnotatableEntity ret = mNextReturnValue;
- findNextValue();
- return ret;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Removal of methods from GeneratableElementIterator not supported.");
- }
-}
diff --git a/build/annotationProcessors/utils/Utils.java b/build/annotationProcessors/utils/Utils.java
deleted file mode 100644
index aea88cfbf3..0000000000
--- a/build/annotationProcessors/utils/Utils.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/* 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.annotationProcessors.utils;
-
-import org.mozilla.gecko.annotationProcessors.AnnotationInfo;
-
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-
-/**
- * A collection of utility methods used by CodeGenerator. Largely used for translating types.
- */
-public class Utils {
-
- // A collection of lookup tables to simplify the functions to follow...
- private static final HashMap<String, String> NATIVE_TYPES = new HashMap<String, String>();
-
- static {
- NATIVE_TYPES.put("void", "void");
- NATIVE_TYPES.put("boolean", "bool");
- NATIVE_TYPES.put("byte", "int8_t");
- NATIVE_TYPES.put("char", "char16_t");
- NATIVE_TYPES.put("short", "int16_t");
- NATIVE_TYPES.put("int", "int32_t");
- NATIVE_TYPES.put("long", "int64_t");
- NATIVE_TYPES.put("float", "float");
- NATIVE_TYPES.put("double", "double");
- }
-
- private static final HashMap<String, String> NATIVE_ARRAY_TYPES = new HashMap<String, String>();
-
- static {
- NATIVE_ARRAY_TYPES.put("boolean", "mozilla::jni::BooleanArray");
- NATIVE_ARRAY_TYPES.put("byte", "mozilla::jni::ByteArray");
- NATIVE_ARRAY_TYPES.put("char", "mozilla::jni::CharArray");
- NATIVE_ARRAY_TYPES.put("short", "mozilla::jni::ShortArray");
- NATIVE_ARRAY_TYPES.put("int", "mozilla::jni::IntArray");
- NATIVE_ARRAY_TYPES.put("long", "mozilla::jni::LongArray");
- NATIVE_ARRAY_TYPES.put("float", "mozilla::jni::FloatArray");
- NATIVE_ARRAY_TYPES.put("double", "mozilla::jni::DoubleArray");
- }
-
- private static final HashMap<String, String> CLASS_DESCRIPTORS = new HashMap<String, String>();
-
- static {
- CLASS_DESCRIPTORS.put("void", "V");
- CLASS_DESCRIPTORS.put("boolean", "Z");
- CLASS_DESCRIPTORS.put("byte", "B");
- CLASS_DESCRIPTORS.put("char", "C");
- CLASS_DESCRIPTORS.put("short", "S");
- CLASS_DESCRIPTORS.put("int", "I");
- CLASS_DESCRIPTORS.put("long", "J");
- CLASS_DESCRIPTORS.put("float", "F");
- CLASS_DESCRIPTORS.put("double", "D");
- }
-
- /**
- * Get the C++ type corresponding to the provided type parameter.
- *
- * @param type Class to determine the corresponding JNI type for.
- * @return C++ type as a String
- */
- public static String getNativeParameterType(Class<?> type, AnnotationInfo info) {
- final String name = type.getName().replace('.', '/');
-
- if (NATIVE_TYPES.containsKey(name)) {
- return NATIVE_TYPES.get(name);
- }
-
- if (type.isArray()) {
- final String compName = type.getComponentType().getName();
- if (NATIVE_ARRAY_TYPES.containsKey(compName)) {
- return NATIVE_ARRAY_TYPES.get(compName) + "::Param";
- }
- return "mozilla::jni::ObjectArray::Param";
- }
-
- if (type.equals(String.class) || type.equals(CharSequence.class)) {
- return "mozilla::jni::String::Param";
- }
-
- if (type.equals(Class.class)) {
- // You're doing reflection on Java objects from inside C, returning Class objects
- // to C, generating the corresponding code using this Java program. Really?!
- return "mozilla::jni::Class::Param";
- }
-
- if (type.equals(Throwable.class)) {
- return "mozilla::jni::Throwable::Param";
- }
-
- if (type.equals(ByteBuffer.class)) {
- return "mozilla::jni::ByteBuffer::Param";
- }
-
- return "mozilla::jni::Object::Param";
- }
-
- public static String getNativeReturnType(Class<?> type, AnnotationInfo info) {
- final String name = type.getName().replace('.', '/');
-
- if (NATIVE_TYPES.containsKey(name)) {
- return NATIVE_TYPES.get(name);
- }
-
- if (type.isArray()) {
- final String compName = type.getComponentType().getName();
- if (NATIVE_ARRAY_TYPES.containsKey(compName)) {
- return NATIVE_ARRAY_TYPES.get(compName) + "::LocalRef";
- }
- return "mozilla::jni::ObjectArray::LocalRef";
- }
-
- if (type.equals(String.class)) {
- return "mozilla::jni::String::LocalRef";
- }
-
- if (type.equals(Class.class)) {
- // You're doing reflection on Java objects from inside C, returning Class objects
- // to C, generating the corresponding code using this Java program. Really?!
- return "mozilla::jni::Class::LocalRef";
- }
-
- if (type.equals(Throwable.class)) {
- return "mozilla::jni::Throwable::LocalRef";
- }
-
- if (type.equals(ByteBuffer.class)) {
- return "mozilla::jni::ByteBuffer::LocalRef";
- }
-
- return "mozilla::jni::Object::LocalRef";
- }
-
- /**
- * Get the JNI class descriptor corresponding to the provided type parameter.
- *
- * @param type Class to determine the corresponding JNI descriptor for.
- * @return Class descripor as a String
- */
- public static String getClassDescriptor(Class<?> type) {
- final String name = type.getName().replace('.', '/');
-
- if (CLASS_DESCRIPTORS.containsKey(name)) {
- return CLASS_DESCRIPTORS.get(name);
- }
-
- if (type.isArray()) {
- // Array names are already in class descriptor form.
- return name;
- }
-
- return "L" + name + ';';
- }
-
- /**
- * Get the JNI signaure for a member.
- *
- * @param member Member to get the signature for.
- * @return JNI signature as a string
- */
- public static String getSignature(Member member) {
- return member instanceof Field ? getSignature((Field) member) :
- member instanceof Method ? getSignature((Method) member) :
- getSignature((Constructor<?>) member);
- }
-
- /**
- * Get the JNI signaure for a field.
- *
- * @param member Field to get the signature for.
- * @return JNI signature as a string
- */
- public static String getSignature(Field member) {
- return getClassDescriptor(member.getType());
- }
-
- private static String getSignature(Class<?>[] args, Class<?> ret) {
- final StringBuilder sig = new StringBuilder("(");
- for (int i = 0; i < args.length; i++) {
- sig.append(getClassDescriptor(args[i]));
- }
- return sig.append(')').append(getClassDescriptor(ret)).toString();
- }
-
- /**
- * Get the JNI signaure for a method.
- *
- * @param member Method to get the signature for.
- * @return JNI signature as a string
- */
- public static String getSignature(Method member) {
- return getSignature(member.getParameterTypes(), member.getReturnType());
- }
-
- /**
- * Get the JNI signaure for a constructor.
- *
- * @param member Constructor to get the signature for.
- * @return JNI signature as a string
- */
- public static String getSignature(Constructor<?> member) {
- return getSignature(member.getParameterTypes(), void.class);
- }
-
- /**
- * Get the C++ name for a member.
- *
- * @param member Member to get the name for.
- * @return JNI name as a string
- */
- public static String getNativeName(Member member) {
- final String name = getMemberName(member);
- return name.substring(0, 1).toUpperCase() + name.substring(1);
- }
-
- /**
- * Get the C++ name for a member.
- *
- * @param member Member to get the name for.
- * @return JNI name as a string
- */
- public static String getNativeName(Class<?> clz) {
- final String name = clz.getName();
- return name.substring(0, 1).toUpperCase() + name.substring(1);
- }
-
- /**
- * Get the C++ name for a member.
- *
- * @param member Member to get the name for.
- * @return JNI name as a string
- */
- public static String getNativeName(AnnotatedElement element) {
- if (element instanceof Class<?>) {
- return getNativeName((Class<?>)element);
- } else if (element instanceof Member) {
- return getNativeName((Member)element);
- } else {
- return null;
- }
- }
-
- /**
- * Get the JNI name for a member.
- *
- * @param member Member to get the name for.
- * @return JNI name as a string
- */
- public static String getMemberName(Member member) {
- if (member instanceof Constructor) {
- return "<init>";
- }
- return member.getName();
- }
-
- public static String getUnqualifiedName(String name) {
- return name.substring(name.lastIndexOf(':') + 1);
- }
-
- /**
- * Determine if a member is declared static.
- *
- * @param member The Member to check.
- * @return true if the member is declared static, false otherwise.
- */
- public static boolean isStatic(final Member member) {
- return Modifier.isStatic(member.getModifiers());
- }
-
- /**
- * Determine if a member is declared final.
- *
- * @param member The Member to check.
- * @return true if the member is declared final, false otherwise.
- */
- public static boolean isFinal(final Member member) {
- return Modifier.isFinal(member.getModifiers());
- }
-}
diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4
index 77c2e85b5e..077a3e6f19 100644
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -270,18 +270,9 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
fi
fi
-# bionic in Android < 4.1 doesn't support PIE
-# On OSX, the linker defaults to building PIE programs when targetting OSX 10.7+,
-# but not when targetting OSX < 10.7. OSX < 10.7 doesn't support running PIE
-# programs, so as long as support for OSX 10.6 is kept, we can't build PIE.
-# Even after dropping 10.6 support, MOZ_PIE would not be useful since it's the
-# default (and clang says the -pie option is not used).
-# On other Unix systems, some file managers (Nautilus) can't start PIE programs
-if test -n "$gonkdir" && test "$ANDROID_VERSION" -ge 16; then
- MOZ_PIE=1
-else
- MOZ_PIE=
-fi
+# On some Unix systems, some file managers (e.g. Nautilus) can't start PIE programs
+# so don't enable it by default.
+MOZ_PIE=
MOZ_ARG_ENABLE_BOOL(pie,
[ --enable-pie Enable Position Independent Executables],
diff --git a/build/gyp.mozbuild b/build/gyp.mozbuild
index 08c9976ac4..9e6b63d7ad 100644
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -18,8 +18,6 @@ gyp_vars = {
'clang_use_chrome_plugins': 0,
'enable_protobuf': 0,
'include_tests': 0,
- 'enable_android_opensl': 1,
- 'enable_android_opensl_output': 0,
# use_system_lib* still seems to be in use in trunk/build
'use_system_libjpeg': 0,
'use_system_libvpx': 0,
@@ -76,16 +74,9 @@ if os == 'WINNT':
MSVS_VERSION=CONFIG['_MSVS_VERSION'],
MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
)
-elif os == 'Android':
- gyp_vars.update(
- gtest_target_type='executable',
- moz_webrtc_mediacodec=1,
- android_toolchain=CONFIG.get('ANDROID_TOOLCHAIN', ''),
- )
flavors = {
'WINNT': 'win',
- 'Android': 'android',
'Linux': 'linux',
'SunOS': 'solaris',
'GNU/kFreeBSD': 'freebsd',
@@ -108,11 +99,8 @@ if CONFIG['ARM_ARCH']:
if int(CONFIG['ARM_ARCH']) < 7:
gyp_vars['armv7'] = 0
gyp_vars['arm_neon_optional'] = 0
- elif os == 'Android':
- gyp_vars['armv7'] = 1
else:
- # CPU detection for ARM works on Android only. armv7 always uses CPU
- # detection, so we have to set armv7=0 for non-Android target
+ # armv7 always uses CPU detection, so we have to set armv7=0
gyp_vars['armv7'] = 0
# For libyuv
gyp_vars['arm_version'] = int(CONFIG['ARM_ARCH'])
diff --git a/build/moz.build b/build/moz.build
index 4d205f93a2..27f681369d 100644
--- a/build/moz.build
+++ b/build/moz.build
@@ -3,9 +3,6 @@
# 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/.
-with Files('**'):
- BUG_COMPONENT = ('Core', 'Build Config')
-
# This cannot be named "build" because of bug 922191.
SPHINX_TREES['buildsystem'] = 'docs'
@@ -14,9 +11,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
else:
DIRS += ['unix']
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DIRS += ['annotationProcessors']
-
for var in ('GRE_MILESTONE',
'MOZ_APP_VERSION',
'MOZ_APP_BASENAME',
@@ -70,7 +64,7 @@ if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
if CONFIG['MOZ_APP_BASENAME']:
FINAL_TARGET_PP_FILES += ['application.ini']
- if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
+ if CONFIG['MOZ_UPDATER']:
FINAL_TARGET_PP_FILES += ['update-settings.ini']
if CONFIG['MOZ_APP_STATIC_INI']:
diff --git a/build/moz.configure/memory.configure b/build/moz.configure/memory.configure
index 262714e261..e8e074f897 100644
--- a/build/moz.configure/memory.configure
+++ b/build/moz.configure/memory.configure
@@ -64,14 +64,6 @@ def jemalloc_os_define(jemalloc, target):
set_define(jemalloc_os_define, '1')
-@depends(jemalloc, target)
-def jemalloc_os_define_android(jemalloc, target):
- if jemalloc and target.os == 'Android':
- return 'MOZ_MEMORY_ANDROID'
-
-set_define(jemalloc_os_define_android, '1')
-
-
option('--enable-replace-malloc',
help='Enable ability to dynamically replace the malloc implementation')
diff --git a/config/android-common.mk b/config/android-common.mk
deleted file mode 100644
index a54f20b88e..0000000000
--- a/config/android-common.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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/.
-
-# Ensure ANDROID_SDK is defined before including this file.
-# We use common android defaults for boot class path and java version.
-ifndef ANDROID_SDK
- $(error ANDROID_SDK must be defined before including android-common.mk)
-endif
-
-# DEBUG_JARSIGNER always debug signs.
-DEBUG_JARSIGNER=$(PYTHON) $(abspath $(topsrcdir)/mobile/android/debug_sign_tool.py) \
- --keytool=$(KEYTOOL) \
- --jarsigner=$(JARSIGNER) \
- $(NULL)
-
-# RELEASE_JARSIGNER release signs if possible.
-ifdef MOZ_SIGN_CMD
-RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar
-else
-RELEASE_JARSIGNER := $(DEBUG_JARSIGNER)
-endif
-
-# $(1) is the full path to input: foo-debug-unsigned-unaligned.apk.
-# $(2) is the full path to output: foo.apk.
-# Use this like: $(call RELEASE_SIGN_ANDROID_APK,foo-debug-unsigned-unaligned.apk,foo.apk)
-#
-# The |zip -d| there to handle re-signing previously signed APKs. Gradle
-# produces signed, unaligned APK files, but this expects unsigned, unaligned
-# APK files. The |zip -d| discards any existing signature, turning a signed,
-# unaligned APK into an unsigned, unaligned APK. Sadly |zip -q| doesn't
-# silence a warning about "nothing to do" so we pipe to /dev/null.
-RELEASE_SIGN_ANDROID_APK = \
- cp $(1) $(2)-unaligned.apk && \
- ($(ZIP) -d $(2)-unaligned.apk 'META-INF/*' > /dev/null || true) && \
- $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \
- $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \
- $(RM) $(2)-unaligned.apk
-
-# For Android, we default to 1.7
-ifndef JAVA_VERSION
- JAVA_VERSION = 1.7
-endif
-
-JAVAC_FLAGS = \
- -target $(JAVA_VERSION) \
- -source $(JAVA_VERSION) \
- -encoding UTF8 \
- -g:source,lines \
- -Werror \
- $(NULL)
diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in
index 7289e57f4c..f01426d512 100644
--- a/config/external/nss/Makefile.in
+++ b/config/external/nss/Makefile.in
@@ -193,15 +193,6 @@ DEFAULT_GMAKE_FLAGS += \
CPU_ARCH='$(TARGET_CPU)' \
$(NULL)
-# Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing
-ifeq ($(OS_TARGET), Android)
-DEFAULT_GMAKE_FLAGS += \
- OS_RELEASE='2.6' \
- OS_PTHREAD= \
- $(NULL)
-
-DEFAULT_GMAKE_FLAGS += ARCHFLAG='$(filter-out -W%,$(CFLAGS)) -DCHECK_FORK_GETPID $(addprefix -DANDROID_VERSION=,$(ANDROID_VERSION)) -include $(topsrcdir)/security/manager/android_stub.h'
-endif
endif
ifdef WRAP_LDFLAGS
diff --git a/config/makefiles/java-build.mk b/config/makefiles/java-build.mk
deleted file mode 100644
index bf667ac446..0000000000
--- a/config/makefiles/java-build.mk
+++ /dev/null
@@ -1,159 +0,0 @@
-# -*- makefile -*-
-# vim:set ts=8 sw=8 sts=8 noet:
-#
-# 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/.
-
-ifndef INCLUDED_JAVA_BUILD_MK #{
-
-ifdef JAVAFILES #{
-GENERATED_DIRS += classes
-
-export:: classes
-classes: $(call mkdir_deps,classes)
-endif #} JAVAFILES
-
-default_bootclasspath_jars := \
- $(ANDROID_SDK)/android.jar \
- $(NULL)
-
-default_classpath_jars := \
- $(NULL)
-
-# Turn a possibly empty list of JAR files into a Java classpath, like a.jar:b.jar.
-# Arg 1: Possibly empty list of JAR files.
-define classpath_template
-$(subst $(NULL) ,:,$(strip $(1)))
-endef
-
-ifdef ANDROID_APK_NAME #{
-$(if $(ANDROID_APK_PACKAGE),,$(error Missing ANDROID_APK_PACKAGE with ANDROID_APK_NAME))
-
-android_res_dirs := $(or $(ANDROID_RES_DIRS),$(srcdir)/res)
-_ANDROID_RES_FLAG := $(addprefix -S ,$(android_res_dirs))
-_ANDROID_ASSETS_FLAG := $(if $(ANDROID_ASSETS_DIRS),$(addprefix -A ,$(ANDROID_ASSETS_DIRS)))
-android_manifest := $(or $(ANDROID_MANIFEST_FILE),AndroidManifest.xml)
-
-GENERATED_DIRS += classes generated
-
-generated_r_java := generated/$(subst .,/,$(ANDROID_APK_PACKAGE))/R.java
-
-classes.dex: $(call mkdir_deps,classes)
-classes.dex: $(generated_r_java)
-classes.dex: $(ANDROID_APK_NAME).ap_
-classes.dex: $(default_classpath_jars) $(ANDROID_CLASSPATH_JARS)
-classes.dex: $(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS) $(ANDROID_EXTRA_JARS)
-classes.dex: $(JAVAFILES)
- $(JAVAC) $(JAVAC_FLAGS) -d classes $(filter %.java,$^) \
- $(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS))) \
- $(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(ANDROID_CLASSPATH_JARS) $(ANDROID_EXTRA_JARS)))
- $(DX) --dex --output=$@ classes $(ANDROID_EXTRA_JARS)
-
-# R.java and $(ANDROID_APK_NAME).ap_ are both produced by aapt. To
-# save an aapt invocation, we produce them both at the same time. The
-# trailing semi-colon defines an empty recipe; defining no recipe at
-# all causes Make to treat the target differently, in a way that
-# defeats our dependencies.
-
-$(generated_r_java): .aapt.deps ;
-$(ANDROID_APK_NAME).ap_: .aapt.deps ;
-
-# This uses the fact that Android resource directories list all
-# resource files one subdirectory below the parent resource directory.
-android_res_files := $(wildcard $(addsuffix /*,$(wildcard $(addsuffix /*,$(android_res_dirs)))))
-
-# An extra package like org.example.app generates dependencies like:
-# generated/org/example/app/R.java: .aapt.deps ;
-# classes.dex: generated/org/example/app/R.java
-# GARBAGE: generated/org/example/app/R.java
-$(foreach extra_package,$(ANDROID_EXTRA_PACKAGES), \
- $(eval generated/$(subst .,/,$(extra_package))/R.java: .aapt.deps ;) \
- $(eval classes.dex: generated/$(subst .,/,$(extra_package))/R.java) \
- $(eval GARBAGE: generated/$(subst .,/,$(extra_package))/R.java) \
-)
-
-# aapt flag -m: 'make package directories under location specified by -J'.
-# The --extra-package list is colon separated.
-.aapt.deps: $(android_manifest) $(android_res_files) $(wildcard $(ANDROID_ASSETS_DIRS))
- @$(TOUCH) $@
- $(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar $(_ANDROID_RES_FLAG) $(_ANDROID_ASSETS_FLAG) \
- --custom-package $(ANDROID_APK_PACKAGE) \
- --non-constant-id \
- --auto-add-overlay \
- $(if $(ANDROID_EXTRA_PACKAGES),--extra-packages $(subst $(NULL) ,:,$(strip $(ANDROID_EXTRA_PACKAGES)))) \
- $(if $(ANDROID_EXTRA_RES_DIRS),$(addprefix -S ,$(ANDROID_EXTRA_RES_DIRS))) \
- -m \
- -J ${@D}/generated \
- -F $(ANDROID_APK_NAME).ap_
-
-$(ANDROID_APK_NAME)-unsigned-unaligned.apk: $(ANDROID_APK_NAME).ap_ classes.dex
- cp $< $@
- $(ZIP) -0 $@ classes.dex
-
-$(ANDROID_APK_NAME)-unaligned.apk: $(ANDROID_APK_NAME)-unsigned-unaligned.apk
- cp $< $@
- $(DEBUG_JARSIGNER) $@
-
-$(ANDROID_APK_NAME).apk: $(ANDROID_APK_NAME)-unaligned.apk
- $(ZIPALIGN) -f 4 $< $@
-
-GARBAGE += \
- $(generated_r_java) \
- classes.dex \
- $(ANDROID_APK_NAME).ap_ \
- $(ANDROID_APK_NAME)-unsigned-unaligned.apk \
- $(ANDROID_APK_NAME)-unaligned.apk \
- $(ANDROID_APK_NAME).apk \
- $(NULL)
-
-# Include Android specific java flags, instead of what's in rules.mk.
-include $(topsrcdir)/config/android-common.mk
-endif #} ANDROID_APK_NAME
-
-
-ifdef JAVA_JAR_TARGETS #{
-# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar.
-# Intermediate class files are generated in jars/jarfile-classes.
-# Arg 2: Java sources list. We use VPATH and $^ so sources can be
-# relative to $(srcdir) or $(CURDIR).
-# Arg 3: List of extra jars to link against. We do not use VPATH so
-# jars must be relative to $(CURDIR).
-# Arg 4: Additional JAVAC_FLAGS.
-
-# Note: Proguard fails when stale .class files corresponding to
-# removed inner classes are present in the object directory. These
-# stale class files get packaged into the .jar file, which then gets
-# processed by Proguard. To work around this, we always delete any
-# existing jarfile-classes directory and start fresh.
-
-define java_jar_template
-$(1): $(2) $(3) $(default_bootclasspath_jars) $(default_classpath_jars)
- $$(REPORT_BUILD)
- @$$(RM) -rf $(1:.jar=)-classes
- @$$(NSINSTALL) -D $(1:.jar=)-classes
- @$$(if $$(filter-out .,$$(@D)),$$(NSINSTALL) -D $$(@D))
- $$(JAVAC) $$(JAVAC_FLAGS)\
- $(4)\
- -d $(1:.jar=)-classes\
- $(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars)))\
- $(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(3)))\
- $$(filter %.java,$$^)
- $$(JAR) cMf $$@ -C $(1:.jar=)-classes .
-
-GARBAGE += $(1)
-
-GARBAGE_DIRS += $(1:.jar=)-classes
-endef
-
-$(foreach jar,$(JAVA_JAR_TARGETS),\
- $(if $($(jar)_DEST),,$(error Missing $(jar)_DEST))\
- $(if $($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),,$(error Must provide at least one of $(jar)_JAVAFILES and $(jar)_PP_JAVAFILES))\
- $(eval $(call java_jar_template,$($(jar)_DEST),$($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),$($(jar)_EXTRA_JARS),$($(jar)_JAVAC_FLAGS)))\
-)
-endif #} JAVA_JAR_TARGETS
-
-
-INCLUDED_JAVA_BUILD_MK := 1
-
-endif #} INCLUDED_JAVA_BUILD_MK
diff --git a/config/rules.mk b/config/rules.mk
index 07b347a94d..840e266ba5 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1041,13 +1041,6 @@ normalizepath = $(1)
endif
###############################################################################
-# Java rules
-###############################################################################
-ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS))
- include $(MOZILLA_DIR)/config/makefiles/java-build.mk
-endif
-
-###############################################################################
# Bunch of things that extend the 'export' rule (in order):
###############################################################################
diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index 8cc25d064a..866a5ac8c5 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3566,7 +3566,6 @@ HTMLInputElement::Focus(ErrorResult& aError)
return;
}
-#if !defined(ANDROID)
bool
HTMLInputElement::IsNodeApzAwareInternal() const
{
@@ -3575,7 +3574,6 @@ HTMLInputElement::IsNodeApzAwareInternal() const
return (mType == NS_FORM_INPUT_NUMBER) || (mType == NS_FORM_INPUT_RANGE) ||
nsINode::IsNodeApzAwareInternal();
}
-#endif
bool
HTMLInputElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
@@ -4728,7 +4726,6 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
}
-#if !defined(ANDROID)
case eWheel: {
// Handle wheel events as increasing / decreasing the input element's
// value when it's focused and it's type is number or range.
@@ -4762,7 +4759,6 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
}
-#endif
default:
break;
}
@@ -6022,17 +6018,7 @@ HTMLInputElement::ChooseDirectory(ErrorResult& aRv)
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
- // Script can call this method directly, so even though we don't show the
- // "Pick Folder..." button on platforms that don't have a directory picker
- // we have to redirect to the file picker here.
- InitFilePicker(
-#if defined(ANDROID)
- // No native directory picker - redirect to plain file picker
- FILE_PICKER_FILE
-#else
- FILE_PICKER_DIRECTORY
-#endif
- );
+ InitFilePicker(FILE_PICKER_DIRECTORY);
}
already_AddRefed<Promise>
@@ -6665,11 +6651,9 @@ FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
void
HTMLInputElement::UpdateApzAwareFlag()
{
-#if !defined(ANDROID)
if ((mType == NS_FORM_INPUT_NUMBER) || (mType == NS_FORM_INPUT_RANGE)) {
SetMayBeApzAware();
}
-#endif
}
nsresult
diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h
index 275d80b3a4..d7eccc0756 100644
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -137,9 +137,7 @@ public:
virtual void Focus(ErrorResult& aError) override;
// nsINode
-#if !defined(ANDROID)
virtual bool IsNodeApzAwareInternal() const override;
-#endif
// Element
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override;
diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp
index 51c42f7a52..61c8192492 100644
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -50,20 +50,7 @@ using namespace mozilla::hal;
// #define ENABLE_LOGGING 1
-#if defined(ANDROID) && defined(ENABLE_LOGGING)
-# include <android/log.h>
-# define LOG(fmt, ...) \
- __android_log_print(ANDROID_LOG_INFO, \
- "Gecko:ProcessPriorityManager", \
- fmt, ## __VA_ARGS__)
-# define LOGP(fmt, ...) \
- __android_log_print(ANDROID_LOG_INFO, \
- "Gecko:ProcessPriorityManager", \
- "[%schild-id=%" PRIu64 ", pid=%d] " fmt, \
- NameWithComma().get(), \
- static_cast<uint64_t>(ChildID()), Pid(), ## __VA_ARGS__)
-
-#elif defined(ENABLE_LOGGING)
+#if defined(ENABLE_LOGGING)
# define LOG(fmt, ...) \
printf("ProcessPriorityManager - " fmt "\n", ##__VA_ARGS__)
# define LOGP(fmt, ...) \
diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp
index 6b16d698d3..54b09e6447 100644
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1564,28 +1564,6 @@ private:
RefPtr<MediaManager> mManager; // get ref to this when creating the runnable
};
-#if defined(ANDROID)
-class GetUserMediaRunnableWrapper : public Runnable
-{
-public:
- // This object must take ownership of task
- GetUserMediaRunnableWrapper(GetUserMediaTask* task) :
- mTask(task) {
- }
-
- ~GetUserMediaRunnableWrapper() {
- }
-
- NS_IMETHOD Run() override {
- mTask->Run();
- return NS_OK;
- }
-
-private:
- nsAutoPtr<GetUserMediaTask> mTask;
-};
-#endif
-
/**
* EnumerateRawDevices - Enumerate a list of audio & video devices that
* satisfy passed-in constraints. List contains raw id's.
@@ -2577,8 +2555,7 @@ MediaEngine*
MediaManager::GetBackend(uint64_t aWindowId)
{
MOZ_ASSERT(MediaManager::IsInMediaThread());
- // Plugin backends as appropriate. The default engine also currently
- // includes picture support for Android.
+ // Plugin backends as appropriate.
// This IS called off main-thread.
if (!mBackend) {
MOZ_RELEASE_ASSERT(!sInShutdown); // we should never create a new backend in shutdown
diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp
index 1b9e4f6749..db5fa8fa39 100644
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -50,15 +50,8 @@ LazyLogModule gMediaStreamGraphLog("MediaStreamGraph");
// #define ENABLE_LIFECYCLE_LOG
-// We don't use NSPR log here because we want this interleaved with adb logcat
-// on Android/B2G
#ifdef ENABLE_LIFECYCLE_LOG
-# ifdef ANDROID
-# include "android/log.h"
-# define LIFECYCLE_LOG(...) __android_log_print(ANDROID_LOG_INFO, "Gecko - MSG", ## __VA_ARGS__); printf(__VA_ARGS__);printf("\n");
-# else
-# define LIFECYCLE_LOG(...) printf(__VA_ARGS__);printf("\n");
-# endif
+# define LIFECYCLE_LOG(...) printf(__VA_ARGS__);printf("\n");
#else
# define LIFECYCLE_LOG(...)
#endif
diff --git a/dom/media/moz.build b/dom/media/moz.build
index 4c22fdb64b..cbe91c255f 100644
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -296,17 +296,11 @@ if CONFIG['OS_TARGET'] == 'WINNT':
else:
DEFINES['WEBRTC_POSIX'] = True
-if CONFIG['ANDROID_VERSION'] > '15':
- DEFINES['MOZ_OMX_WEBM_DECODER'] = True
-
include('/ipc/chromium/chromium-config.mozbuild')
# Suppress some GCC warnings being treated as errors:
-# - about attributes on forward declarations for types that are already
-# defined, which complains about an important MOZ_EXPORT for android::AString
if CONFIG['GNU_CC']:
CXXFLAGS += [
- '-Wno-error=attributes',
'-Wno-error=shadow',
]
diff --git a/dom/media/systemservices/LoadMonitor.cpp b/dom/media/systemservices/LoadMonitor.cpp
index ef8d1a0cc7..9ef01999c0 100644
--- a/dom/media/systemservices/LoadMonitor.cpp
+++ b/dom/media/systemservices/LoadMonitor.cpp
@@ -346,8 +346,6 @@ void RTCLoadInfo::UpdateCpuLoad(uint64_t ticks_per_interval,
> (ticks_per_interval * 10))
|| current_total_times < loadStat->mPrevTotalTimes
|| current_cpu_times < loadStat->mPrevCpuTimes) {
- // Bug at least on the Nexus 4 and Galaxy S4
- // https://code.google.com/p/android/issues/detail?id=41630
// We do need to update our previous times, or we can get stuck
// when there is a blip upwards and then we get a bunch of consecutive
// lower times. Just skip the load calculation.
@@ -374,7 +372,7 @@ void RTCLoadInfo::UpdateCpuLoad(uint64_t ticks_per_interval,
nsresult RTCLoadInfo::UpdateSystemLoad()
{
-#if defined(LINUX) || defined(ANDROID)
+#if defined(LINUX)
nsCOMPtr<nsIFile> procStatFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
procStatFile->InitWithPath(NS_LITERAL_STRING("/proc/stat"));
diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp
index c18d9aa6de..2b8a7e5369 100644
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -15,14 +15,9 @@
#include "dirent.h"
#include "poll.h"
#include "sys/stat.h"
-#if defined(ANDROID)
-#include <sys/vfs.h>
-#define statvfs statfs
-#else
#include "sys/statvfs.h"
#include "sys/wait.h"
#include <spawn.h>
-#endif // defined(ANDROID)
#endif // defined(XP_UNIX)
#if defined(XP_LINUX)
@@ -345,8 +340,7 @@ void CleanupOSFileConstants()
*/
#define PROP_END { nullptr, JS::UndefinedValue() }
-
-// Define missing constants for Android
+// Define missing constants on non-*nix
#if !defined(S_IRGRP)
#define S_IXOTH 0001
#define S_IWOTH 0002
@@ -362,6 +356,7 @@ void CleanupOSFileConstants()
#define S_IRWXU 0700
#endif // !defined(S_IRGRP)
+
/**
* The properties defined in libc.
*
@@ -595,10 +590,8 @@ static const dom::ConstantSpec gLibcProperties[] =
// The size of |fsblkcnt_t|.
{ "OSFILE_SIZEOF_FSBLKCNT_T", JS::Int32Value(sizeof (fsblkcnt_t)) },
-#if !defined(ANDROID)
// The size of |posix_spawn_file_actions_t|.
{ "OSFILE_SIZEOF_POSIX_SPAWN_FILE_ACTIONS_T", JS::Int32Value(sizeof (posix_spawn_file_actions_t)) },
-#endif // !defined(ANDROID)
// Defining |dirent|.
// Size
diff --git a/js/src/ctypes/libffi/src/closures.c b/js/src/ctypes/libffi/src/closures.c
index c7863f3d0a..fba4e2a6aa 100644
--- a/js/src/ctypes/libffi/src/closures.c
+++ b/js/src/ctypes/libffi/src/closures.c
@@ -34,7 +34,7 @@
#include <ffi_common.h>
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
+# if __gnu_linux__
/* This macro indicates it may be forbidden to map anonymous memory
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
diff --git a/js/src/ds/MemoryProtectionExceptionHandler.cpp b/js/src/ds/MemoryProtectionExceptionHandler.cpp
index 77df1f0d92..881a0e63d5 100644
--- a/js/src/ds/MemoryProtectionExceptionHandler.cpp
+++ b/js/src/ds/MemoryProtectionExceptionHandler.cpp
@@ -16,10 +16,6 @@
# include <unistd.h>
#endif
-#ifdef ANDROID
-# include <android/log.h>
-#endif
-
#include "ds/SplayTree.h"
#include "threading/LockGuard.h"
@@ -125,8 +121,6 @@ ReportCrashIfDebug(const char* aStr)
BOOL ret = WriteFile(GetStdHandle(STD_ERROR_HANDLE), aStr,
strlen(aStr) + 1, &bytesWritten, nullptr);
::__debugbreak();
-# elif defined(ANDROID)
- int ret = __android_log_write(ANDROID_LOG_FATAL, "MOZ_CRASH", aStr);
# else
ssize_t ret = write(STDERR_FILENO, aStr, strlen(aStr) + 1);
# endif
diff --git a/js/src/jit/ExecutableAllocator.h b/js/src/jit/ExecutableAllocator.h
index 8042ae7a98..c16809c818 100644
--- a/js/src/jit/ExecutableAllocator.h
+++ b/js/src/jit/ExecutableAllocator.h
@@ -251,7 +251,7 @@ class ExecutableAllocator
{
__clear_cache(code, reinterpret_cast<char*>(code) + size);
}
-#elif defined(JS_CODEGEN_ARM) && (defined(__linux__) || defined(ANDROID)) && defined(__GNUC__)
+#elif defined(JS_CODEGEN_ARM) && defined(__linux__) && defined(__GNUC__)
static void cacheFlush(void* code, size_t size)
{
void* end = (void*)(reinterpret_cast<char*>(code) + size);
diff --git a/js/src/jit/arm/Architecture-arm.cpp b/js/src/jit/arm/Architecture-arm.cpp
index 791fa972a7..38939eabff 100644
--- a/js/src/jit/arm/Architecture-arm.cpp
+++ b/js/src/jit/arm/Architecture-arm.cpp
@@ -15,9 +15,9 @@
#include "jit/arm/Assembler-arm.h"
#include "jit/RegisterSets.h"
-#if !defined(__linux__) || defined(ANDROID) || defined(JS_SIMULATOR_ARM)
-// The Android NDK and B2G do not include the hwcap.h kernel header, and it is not
-// defined when building the simulator, so inline the header defines we need.
+#if !defined(__linux__) || defined(JS_SIMULATOR_ARM)
+// The hwcap.h kernel header is not defined when building the simulator,
+// so inline the header defines we need.
# define HWCAP_VFP (1 << 6)
# define HWCAP_NEON (1 << 12)
# define HWCAP_VFPv3 (1 << 13)
@@ -209,8 +209,7 @@ InitARMFlags()
| HWCAP_FIXUP_FAULT;
#else
-#if defined(__linux__) || defined(ANDROID)
- // This includes Android and B2G.
+#if defined(__linux__)
bool readAuxv = false;
int fd = open("/proc/self/auxv", O_RDONLY);
if (fd > 0) {
diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp
index baab36183a..b81f8ebcab 100644
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -17,11 +17,6 @@
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
-#ifdef ANDROID
-# include <android/log.h>
-# include <fstream>
-# include <string>
-#endif // ANDROID
#include "jsatom.h"
#include "jscompartment.h"
@@ -1085,60 +1080,10 @@ JSContext::currentlyRunning() const
static bool
ComputeIsJITBroken()
{
-#if !defined(ANDROID)
+ // This used to hold code to exclude specific (mobile) hardware where jit would be
+ // terribly broken. Effectively a stub but good to keep just in case it's needed
+ // in the future.
return false;
-#else // ANDROID
- if (getenv("JS_IGNORE_JIT_BROKENNESS")) {
- return false;
- }
-
- std::string line;
-
- // Check for the known-bad kernel version (2.6.29).
- std::ifstream osrelease("/proc/sys/kernel/osrelease");
- std::getline(osrelease, line);
- __android_log_print(ANDROID_LOG_INFO, "Gecko", "Detected osrelease `%s'",
- line.c_str());
-
- if (line.npos == line.find("2.6.29")) {
- // We're using something other than 2.6.29, so the JITs should work.
- __android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are not broken");
- return false;
- }
-
- // We're using 2.6.29, and this causes trouble with the JITs on i9000.
- line = "";
- bool broken = false;
- std::ifstream cpuinfo("/proc/cpuinfo");
- do {
- if (0 == line.find("Hardware")) {
- static const char* const blacklist[] = {
- "SCH-I400", // Samsung Continuum
- "SGH-T959", // Samsung i9000, Vibrant device
- "SGH-I897", // Samsung i9000, Captivate device
- "SCH-I500", // Samsung i9000, Fascinate device
- "SPH-D700", // Samsung i9000, Epic device
- "GT-I9000", // Samsung i9000, UK/Europe device
- nullptr
- };
- for (const char* const* hw = &blacklist[0]; *hw; ++hw) {
- if (line.npos != line.find(*hw)) {
- __android_log_print(ANDROID_LOG_INFO, "Gecko",
- "Blacklisted device `%s'", *hw);
- broken = true;
- break;
- }
- }
- break;
- }
- std::getline(cpuinfo, line);
- } while(!cpuinfo.fail() && !cpuinfo.eof());
-
- __android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are %sbroken",
- broken ? "" : "not ");
-
- return broken;
-#endif // ifndef ANDROID
}
static bool
diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp
index 78760583db..64c2da8122 100644
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -49,7 +49,7 @@
# undef SystemFunction036
#endif
-#if defined(ANDROID) || defined(__DragonFly__) || \
+#if defined(__DragonFly__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# include <stdlib.h>
# define HAVE_ARC4RANDOM
diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp
index 99c2f6654a..34131f9667 100644
--- a/js/src/jsnativestack.cpp
+++ b/js/src/jsnativestack.cpp
@@ -15,12 +15,7 @@
# include <pthread_np.h>
# endif
-# if defined(ANDROID)
-# include <sys/types.h>
-# include <unistd.h>
-# endif
-
-# if defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__)
+# if defined(XP_LINUX) && defined(__GLIBC__)
# include <dlfcn.h>
# include <sys/syscall.h>
# include <sys/types.h>
@@ -80,7 +75,7 @@ js::GetNativeStackBaseImpl()
return static_cast<char*>(st.ss_sp) + st.ss_size;
}
-#elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__)
+#elif defined(XP_LINUX) && defined(__GLIBC__)
void*
js::GetNativeStackBaseImpl()
{
@@ -154,41 +149,6 @@ js::GetNativeStackBaseImpl()
rc = pthread_stackseg_np(pthread_self(), &ss);
stackBase = (void*)((size_t) ss.ss_sp - ss.ss_size);
stackSize = ss.ss_size;
-# elif defined(ANDROID)
- if (gettid() == getpid()) {
- // bionic's pthread_attr_getstack doesn't tell the truth for the main
- // thread (see bug 846670). So we scan /proc/self/maps to find the
- // segment which contains the stack.
- rc = -1;
-
- // Put the string on the stack, otherwise there is the danger that it
- // has not been decompressed by the the on-demand linker. Bug 1165460.
- //
- // The volatile keyword should stop the compiler from trying to omit
- // the stack copy in the future (hopefully).
- volatile char path[] = "/proc/self/maps";
- FILE* fs = fopen((const char*)path, "r");
-
- if (fs) {
- char line[100];
- unsigned long stackAddr = (unsigned long)&sattr;
- while (fgets(line, sizeof(line), fs) != nullptr) {
- unsigned long stackStart;
- unsigned long stackEnd;
- if (sscanf(line, "%lx-%lx ", &stackStart, &stackEnd) == 2 &&
- stackAddr >= stackStart && stackAddr < stackEnd) {
- stackBase = (void*)stackStart;
- stackSize = stackEnd - stackStart;
- rc = 0;
- break;
- }
- }
- fclose(fs);
- }
- } else
- // For non main-threads pthread allocates the stack itself so it tells
- // the truth.
- rc = pthread_attr_getstack(&sattr, &stackBase, &stackSize);
# else
// Use the default pthread_attr_getstack() call. Note that this function
// differs between libc implementations and could imply /proc access etc.
diff --git a/js/src/vtune/jitprofiling.c b/js/src/vtune/jitprofiling.c
index 558af0c306..652a2a057e 100644
--- a/js/src/vtune/jitprofiling.c
+++ b/js/src/vtune/jitprofiling.c
@@ -89,9 +89,6 @@ HINSTANCE m_libHandle = NULL;
void* m_libHandle = NULL;
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
-/* default location of JIT profiling agent on Android */
-#define ANDROID_JIT_AGENT_PATH "/data/intel/libittnotify.so"
-
/* the function pointers */
typedef unsigned int(*TPInitialize)(void);
static TPInitialize FUNC_Initialize=NULL;
@@ -386,10 +383,6 @@ static int loadiJIT_Funcs()
dllName = getenv(NEW_DLL_ENVIRONMENT_VAR);
if (!dllName)
dllName = getenv(DLL_ENVIRONMENT_VAR);
-#ifdef ANDROID
- if (!dllName)
- dllName = ANDROID_JIT_AGENT_PATH;
-#endif
if (dllName)
{
/* Try to load the dll from the PATH... */
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index b45d05ebd2..dae590acba 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -34,13 +34,6 @@ using JS::GenericNaN;
using mozilla::DebugOnly;
using mozilla::PodArrayZero;
-#if defined(ANDROID)
-# include <sys/system_properties.h>
-# if defined(MOZ_LINKER)
-extern "C" MFBT_API bool IsSignalHandlingBroken();
-# endif
-#endif
-
// For platforms where the signal/exception handler runs on the same
// thread/stack as the victim (Unix and Windows), we can use TLS to find any
// currently executing wasm code.
@@ -260,86 +253,6 @@ class AutoSetHandlingSegFault
# endif
#endif
-#if defined(ANDROID)
-// Not all versions of the Android NDK define ucontext_t or mcontext_t.
-// Detect this and provide custom but compatible definitions. Note that these
-// follow the GLibc naming convention to access register values from
-// mcontext_t.
-//
-// See: https://chromiumcodereview.appspot.com/10829122/
-// See: http://code.google.com/p/android/issues/detail?id=34784
-# if !defined(__BIONIC_HAVE_UCONTEXT_T)
-# if defined(__arm__)
-
-// GLibc on ARM defines mcontext_t has a typedef for 'struct sigcontext'.
-// Old versions of the C library <signal.h> didn't define the type.
-# if !defined(__BIONIC_HAVE_STRUCT_SIGCONTEXT)
-# include <asm/sigcontext.h>
-# endif
-
-typedef struct sigcontext mcontext_t;
-
-typedef struct ucontext {
- uint32_t uc_flags;
- struct ucontext* uc_link;
- stack_t uc_stack;
- mcontext_t uc_mcontext;
- // Other fields are not used so don't define them here.
-} ucontext_t;
-
-# elif defined(__mips__)
-
-typedef struct {
- uint32_t regmask;
- uint32_t status;
- uint64_t pc;
- uint64_t gregs[32];
- uint64_t fpregs[32];
- uint32_t acx;
- uint32_t fpc_csr;
- uint32_t fpc_eir;
- uint32_t used_math;
- uint32_t dsp;
- uint64_t mdhi;
- uint64_t mdlo;
- uint32_t hi1;
- uint32_t lo1;
- uint32_t hi2;
- uint32_t lo2;
- uint32_t hi3;
- uint32_t lo3;
-} mcontext_t;
-
-typedef struct ucontext {
- uint32_t uc_flags;
- struct ucontext* uc_link;
- stack_t uc_stack;
- mcontext_t uc_mcontext;
- // Other fields are not used so don't define them here.
-} ucontext_t;
-
-# elif defined(__i386__)
-// x86 version for Android.
-typedef struct {
- uint32_t gregs[19];
- void* fpregs;
- uint32_t oldmask;
- uint32_t cr2;
-} mcontext_t;
-
-typedef uint32_t kernel_sigset_t[2]; // x86 kernel uses 64-bit signal masks
-typedef struct ucontext {
- uint32_t uc_flags;
- struct ucontext* uc_link;
- stack_t uc_stack;
- mcontext_t uc_mcontext;
- // Other fields are not used by V8, don't define them here.
-} ucontext_t;
-enum { REG_EIP = 14 };
-# endif // defined(__i386__)
-# endif // !defined(__BIONIC_HAVE_UCONTEXT_T)
-#endif // defined(ANDROID)
-
#if !defined(XP_WIN)
# define CONTEXT ucontext_t
#endif
@@ -977,25 +890,6 @@ ProcessHasSignalHandlers()
if (getenv("JS_DISABLE_SLOW_SCRIPT_SIGNALS") || getenv("JS_NO_SIGNALS"))
return false;
-#if defined(ANDROID)
- // Before Android 4.4 (SDK version 19), there is a bug
- // https://android-review.googlesource.com/#/c/52333
- // in Bionic's pthread_join which causes pthread_join to return early when
- // pthread_kill is used (on any thread). Nobody expects the pthread_cond_wait
- // EINTRquisition.
- char version_string[PROP_VALUE_MAX];
- PodArrayZero(version_string);
- if (__system_property_get("ro.build.version.sdk", version_string) > 0) {
- if (atol(version_string) < 19)
- return false;
- }
-# if defined(MOZ_LINKER)
- // Signal handling is broken on some android systems.
- if (IsSignalHandlingBroken())
- return false;
-# endif
-#endif
-
// The interrupt handler allows the main thread to be paused from another
// thread (see InterruptRunningJitCode).
#if defined(XP_WIN)
diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp
index 5b9e09a0a1..f4f3297469 100644
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -9,9 +9,6 @@
#include <cstdarg>
#include "mozilla/Logging.h"
-#ifdef ANDROID
-#include <android/log.h>
-#endif
#ifdef XP_WIN
#include <windows.h>
#endif
@@ -101,9 +98,6 @@ Dump(JSContext* cx, unsigned argc, Value* vp)
if (!utf8str.encodeUtf8(cx, str))
return false;
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", utf8str.ptr());
-#endif
#ifdef XP_WIN
if (IsDebuggerPresent()) {
nsAutoJSString wstr;
diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp
index ba40e120ed..569da5d56f 100644
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -127,10 +127,6 @@ SandboxDump(JSContext* cx, unsigned argc, Value* vp)
if (!cstr)
return false;
-#ifdef ANDROID
- __android_log_write(ANDROID_LOG_INFO, "GeckoDump", cstr);
-#endif
-
fputs(cstr, stdout);
fflush(stdout);
args.rval().setBoolean(true);
diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
index a9f779b894..48a3aa26ac 100644
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -3226,12 +3226,6 @@ XPCJSContext::Initialize()
: 120 * 1024; //win32
// The following two configurations are linux-only. Given the numbers above,
// we use 50k and 100k trusted buffers on 32-bit and 64-bit respectively.
-#elif defined(ANDROID)
- // Android appears to have 1MB stacks. Allow the use of 3/4 of that size
- // (768KB on 32-bit), since otherwise we can crash with a stack overflow
- // when nearing the 1MB limit.
- const size_t kStackQuota = kDefaultStackQuota + kDefaultStackQuota / 2;
- const size_t kTrustedScriptBuffer = sizeof(size_t) * 12800;
#elif defined(DEBUG)
// Bug 803182: account for the 4x difference in the size of js::Interpret
// between optimized and debug builds.
diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp
index c0e9532a96..e4e0db96f2 100644
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -36,10 +36,6 @@
#include "base/histogram.h"
-#ifdef ANDROID
-#include <android/log.h>
-#endif
-
#ifdef XP_WIN
#include "mozilla/widget/AudioSession.h"
#include <windows.h>
@@ -309,9 +305,6 @@ Dump(JSContext* cx, unsigned argc, Value* vp)
if (!utf8str.encodeUtf8(cx, str))
return false;
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", utf8str.ptr());
-#endif
#ifdef XP_WIN
if (IsDebuggerPresent()) {
nsAutoJSString wstr;
diff --git a/old-configure.in b/old-configure.in
index a014fd5e4c..df77f66ddb 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -95,8 +95,6 @@ case "$target" in
;;
esac
-AC_SUBST(ANDROID_SOURCE)
-AC_SUBST(ANDROID_PACKAGE_NAME)
AC_SUBST(OBJCOPY)
dnl ========================================================
@@ -497,11 +495,6 @@ dnl Configure platform-specific CPU architecture compiler options.
dnl ==============================================================
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ARCH_OPTS
-else
- if test "$OS_TARGET" = "Android"; then
- dnl Default Android builds to ARMv7.
- MOZ_ARCH=armv7-a
- fi
fi # COMPILE_ENVIRONMENT
dnl ========================================================
@@ -1724,43 +1717,6 @@ dnl gnu style tables anyways.
LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
fi
-dnl The custom linker doesn't support text relocations, but NDK >= r6b
-dnl creates some (http://code.google.com/p/android/issues/detail?id=23203)
-dnl We however want to avoid these text relocations, and this can be done
-dnl by making gcc not link crtbegin and crtend. In the broken NDKs, crtend
-dnl doesn't contain anything at all, beside placeholders for some sections,
-dnl and crtbegin only contains a finalizer function that calls
-dnl __cxa_finalize. The custom linker actually takes care of calling
-dnl __cxa_finalize when the library doesn't call it itself, which makes it
-dnl safe not to link crtbegin. Besides, previous versions of the NDK didn't
-dnl link crtbegin and crtend at all.
-if test -n "$MOZ_LINKER" -a "$OS_TARGET" = "Android"; then
- AC_CACHE_CHECK([whether the CRT objects have text relocations],
- ac_cv_crt_has_text_relocations,
- [echo 'int foo() { return 0; }' > conftest.cpp
- if AC_TRY_COMMAND(${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5) &&
- test -s conftest${DLL_SUFFIX}; then
- if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
- ac_cv_crt_has_text_relocations=yes
- else
- ac_cv_crt_has_text_relocations=no
- fi
- else
- AC_ERROR([couldn't compile a simple C file])
- fi
- rm -rf conftest*])
- if test "$ac_cv_crt_has_text_relocations" = yes; then
- dnl While we want libraries to skip the CRT files, we don't want
- dnl executables to be treated the same way. We thus set the flag
- dnl in DSO_LDOPTS and not LDFLAGS. However, to pass it to nspr,
- dnl we need to use LDFLAGS because nspr doesn't inherit DSO_LDOPTS.
- dnl Using LDFLAGS in nspr is safe, since we only really build
- dnl libraries there.
- DSO_LDOPTS="$DSO_LDOPTS -nostartfiles"
- NSPR_LDFLAGS="$NSPR_LDFLAGS -nostartfiles"
- fi
-fi
-
dnl See if compiler supports some gcc-style attributes
AC_CACHE_CHECK(for __attribute__((always_inline)),
@@ -2656,11 +2612,9 @@ AC_SUBST(MOZ_SCTP)
AC_SUBST(MOZ_SRTP)
AC_SUBST_LIST(MOZ_WEBRTC_X11_LIBS)
-dnl Use integers over floats for audio on Android
-dnl (regarless of the CPU architecture, because audio
-dnl backends for those platforms don't support floats. We also
-dnl use integers on ARM with other OS, because it's more efficient.
-if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then
+dnl Use integers over floats for audio on ARM
+dnl because it's more efficient.
+if test "$CPU_ARCH" = "arm"; then
MOZ_SAMPLE_TYPE_S16=1
AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
AC_SUBST(MOZ_SAMPLE_TYPE_S16)
@@ -3091,9 +3045,6 @@ if test "$MOZ_GAMEPAD"; then
fi
MOZ_GAMEPAD_BACKEND=linux
;;
- Android)
- MOZ_GAMEPAD_BACKEND=android
- ;;
*)
;;
esac
@@ -3414,14 +3365,6 @@ if test -n "$ENABLE_TESTS"; then
if test -n "$_WIN32_MSVC"; then
AC_DEFINE_UNQUOTED(_VARIADIC_MAX, 10)
fi
- if test "${OS_TARGET}" = "Android"; then
- AC_DEFINE(GTEST_OS_LINUX_ANDROID)
- AC_DEFINE(GTEST_USE_OWN_TR1_TUPLE)
- AC_DEFINE_UNQUOTED(GTEST_HAS_CLONE, 0)
- AC_SUBST(GTEST_OS_LINUX_ANDROID)
- AC_SUBST(GTEST_USE_OWN_TR1_TUPLE)
- AC_SUBST(GTEST_HAS_CLONE)
- fi
fi
dnl ========================================================
@@ -4540,13 +4483,6 @@ else
fi
fi
-case "$MOZ_WIDGET_TOOLKIT" in
-android)
- TK_CFLAGS="$MOZ_CAIRO_CFLAGS $MOZ_PIXMAN_CFLAGS"
- TK_LIBS="$MOZ_CAIRO_LIBS $MOZ_PIXMAN_LIBS"
- ;;
-esac
-
AC_SUBST(MOZ_TREE_CAIRO)
AC_SUBST_LIST(MOZ_CAIRO_CFLAGS)
AC_SUBST_LIST(MOZ_CAIRO_LIBS)
@@ -4602,15 +4538,10 @@ if test "$NECKO_COOKIES"; then
fi
dnl
-dnl Always build Marionette if not Android or B2G
+dnl Always build Marionette
dnl
-if test "$OS_TARGET" != "Android"; then
- AC_DEFINE(ENABLE_MARIONETTE)
-fi
+AC_DEFINE(ENABLE_MARIONETTE)
AC_SUBST(ENABLE_MARIONETTE)
-if test "$ENABLE_MARIONETTE"; then
- AC_DEFINE(ENABLE_MARIONETTE)
-fi
dnl ========================================================
dnl =
@@ -4737,17 +4668,7 @@ AC_SUBST(MOZ_MACBUNDLE_ID)
dnl ========================================================
dnl = Child Process Name for IPC
dnl ========================================================
-if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
- MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
-else
- # We want to let Android unpack the file at install time, but it only does
- # so if the file is named libsomething.so. The lib/ path is also required
- # because the unpacked file will be under the lib/ subdirectory and will
- # need to be executed from that path.
- MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
- MOZ_CHILD_PROCESS_NAME_PIE="libplugin-container-pie.so"
- AC_SUBST(MOZ_CHILD_PROCESS_NAME_PIE)
-fi
+MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
AC_SUBST(MOZ_CHILD_PROCESS_NAME)
@@ -4777,10 +4698,6 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
# "Profile" field, which controls profile location.
# - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
# crash reporter server url.
-# - MOZ_APP_ANDROID_VERSION_CODE: On Android, "android:versionCode" for
-# the main application is set to the value of this variable. If not
-# set, it falls back to a Mozilla-specific value derived from the
-# build ID.
# - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
if test -z "$MOZ_APP_NAME"; then
@@ -4795,10 +4712,6 @@ if test -z "$MOZ_APP_VERSION_DISPLAY"; then
MOZ_APP_VERSION_DISPLAY=$MOZ_APP_VERSION
fi
-if test -z "$ANDROID_PACKAGE_NAME" ; then
- ANDROID_PACKAGE_NAME="org.mozilla.$MOZ_APP_NAME"
-fi
-
# For extensions and langpacks, we require a max version that is compatible
# across security releases. MOZ_APP_MAXVERSION is our method for doing that.
# 24.0a1 and 24.0a2 aren't affected
@@ -4824,7 +4737,6 @@ AC_SUBST(MOZ_APP_BASENAME)
AC_SUBST(MOZ_APP_VENDOR)
AC_SUBST(MOZ_APP_PROFILE)
AC_SUBST(MOZ_APP_ID)
-AC_SUBST(MOZ_APP_ANDROID_VERSION_CODE)
AC_SUBST(MAR_CHANNEL_ID)
AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
AC_SUBST(MOZ_PROFILE_MIGRATOR)
diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
index a314124f44..4a37b29663 100644
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -29,11 +29,6 @@ from mozbuild.frontend.context import (
)
from .common import CommonBackend
from ..frontend.data import (
- AndroidAssetsDirs,
- AndroidResDirs,
- AndroidExtraResDirs,
- AndroidExtraPackages,
- AndroidEclipseProjectData,
ChromeManifestEntry,
ConfigFileSubstitution,
ContextDerived,
@@ -75,13 +70,6 @@ from ..makeutil import Makefile
from mozbuild.shellutil import quote as shell_quote
MOZBUILD_VARIABLES = [
- b'ANDROID_APK_NAME',
- b'ANDROID_APK_PACKAGE',
- b'ANDROID_ASSETS_DIRS',
- b'ANDROID_EXTRA_PACKAGES',
- b'ANDROID_EXTRA_RES_DIRS',
- b'ANDROID_GENERATED_RESFILES',
- b'ANDROID_RES_DIRS',
b'ASFLAGS',
b'CMSRCS',
b'CMMSRCS',
@@ -137,7 +125,6 @@ MOZBUILD_VARIABLES = [
]
DEPRECATED_VARIABLES = [
- b'ANDROID_RESFILES',
b'EXPORT_LIBRARY',
b'EXTRA_LIBS',
b'HOST_LIBS',
@@ -568,8 +555,6 @@ class RecursiveMakeBackend(CommonBackend):
# automated.
if isinstance(obj.wrapped, JavaJarData):
self._process_java_jar_data(obj.wrapped, backend_file)
- elif isinstance(obj.wrapped, AndroidEclipseProjectData):
- self._process_android_eclipse_project_data(obj.wrapped, backend_file)
else:
return False
@@ -597,26 +582,6 @@ class RecursiveMakeBackend(CommonBackend):
elif isinstance(obj, ObjdirPreprocessedFiles):
self._process_final_target_pp_files(obj, obj.files, backend_file, 'OBJDIR_PP_FILES')
- elif isinstance(obj, AndroidResDirs):
- # Order matters.
- for p in obj.paths:
- backend_file.write('ANDROID_RES_DIRS += %s\n' % p.full_path)
-
- elif isinstance(obj, AndroidAssetsDirs):
- # Order matters.
- for p in obj.paths:
- backend_file.write('ANDROID_ASSETS_DIRS += %s\n' % p.full_path)
-
- elif isinstance(obj, AndroidExtraResDirs):
- # Order does not matter.
- for p in sorted(set(p.full_path for p in obj.paths)):
- backend_file.write('ANDROID_EXTRA_RES_DIRS += %s\n' % p)
-
- elif isinstance(obj, AndroidExtraPackages):
- # Order does not matter.
- for p in sorted(set(obj.packages)):
- backend_file.write('ANDROID_EXTRA_PACKAGES += %s\n' % p)
-
elif isinstance(obj, ChromeManifestEntry):
self._process_chrome_manifest_entry(obj, backend_file)
@@ -1118,28 +1083,6 @@ class RecursiveMakeBackend(CommonBackend):
backend_file.write('%s_JAVAC_FLAGS := %s\n' %
(target, ' '.join(jar.javac_flags)))
- def _process_android_eclipse_project_data(self, project, backend_file):
- # We add a single target to the backend.mk corresponding to
- # the moz.build defining the Android Eclipse project. This
- # target depends on some targets to be fresh, and installs a
- # manifest generated by the Android Eclipse build backend. The
- # manifests for all projects live in $TOPOBJDIR/android_eclipse
- # and are installed into subdirectories thereof.
-
- project_directory = mozpath.join(self.environment.topobjdir, 'android_eclipse', project.name)
- manifest_path = mozpath.join(self.environment.topobjdir, 'android_eclipse', '%s.manifest' % project.name)
-
- fragment = Makefile()
- rule = fragment.create_rule(targets=['ANDROID_ECLIPSE_PROJECT_%s' % project.name])
- rule.add_dependencies(project.recursive_make_targets)
- args = ['--no-remove',
- '--no-remove-all-directory-symlinks',
- '--no-remove-empty-directories',
- project_directory,
- manifest_path]
- rule.add_commands(['$(call py_action,process_install_manifest,%s)' % ' '.join(args)])
- fragment.dump(backend_file.fh, removal_guard=False)
-
def _process_shared_library(self, libdef, backend_file):
backend_file.write_once('LIBRARY_NAME := %s\n' % libdef.basename)
backend_file.write('FORCE_SHARED_LIB := 1\n')
diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
index eb501dc666..f81665b52b 100644
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -880,59 +880,6 @@ VARIABLES = {
"""),
# Variables controlling reading of other frontend files.
- 'ANDROID_GENERATED_RESFILES': (StrictOrderingOnAppendList, list,
- """Android resource files generated as part of the build.
-
- This variable contains a list of files that are expected to be
- generated (often by preprocessing) into a 'res' directory as
- part of the build process, and subsequently merged into an APK
- file.
- """),
-
- 'ANDROID_APK_NAME': (unicode, unicode,
- """The name of an Android APK file to generate.
- """),
-
- 'ANDROID_APK_PACKAGE': (unicode, unicode,
- """The name of the Android package to generate R.java for, like org.mozilla.gecko.
- """),
-
- 'ANDROID_EXTRA_PACKAGES': (StrictOrderingOnAppendList, list,
- """The name of extra Android packages to generate R.java for, like ['org.mozilla.other'].
- """),
-
- 'ANDROID_EXTRA_RES_DIRS': (ContextDerivedTypedListWithItems(Path, List), list,
- """Android extra package resource directories.
-
- This variable contains a list of directories containing static files
- to package into a 'res' directory and merge into an APK file. These
- directories are packaged into the APK but are assumed to be static
- unchecked dependencies that should not be otherwise re-distributed.
- """),
-
- 'ANDROID_RES_DIRS': (ContextDerivedTypedListWithItems(Path, List), list,
- """Android resource directories.
-
- This variable contains a list of directories containing static
- files to package into a 'res' directory and merge into an APK
- file.
- """),
-
- 'ANDROID_ASSETS_DIRS': (ContextDerivedTypedListWithItems(Path, List), list,
- """Android assets directories.
-
- This variable contains a list of directories containing static
- files to package into an 'assets' directory and merge into an
- APK file.
- """),
-
- 'ANDROID_ECLIPSE_PROJECT_TARGETS': (dict, dict,
- """Defines Android Eclipse project targets.
-
- This variable should not be populated directly. Instead, it should
- populated by calling add_android_eclipse{_library}_project().
- """),
-
'SOURCES': (ContextDerivedTypedListWithItems(Path, StrictOrderingOnAppendListWithFlagsFactory({'no_pgo': bool, 'flags': List})), list,
"""Source code files.
@@ -1511,10 +1458,6 @@ VARIABLES = {
"""List of manifest files defining jetpack addon tests.
"""),
- 'ANDROID_INSTRUMENTATION_MANIFESTS': (ManifestparserManifestList, list,
- """List of manifest files defining Android instrumentation tests.
- """),
-
'FIREFOX_UI_FUNCTIONAL_MANIFESTS': (ManifestparserManifestList, list,
"""List of manifest files defining firefox-ui-functional tests.
"""),
@@ -1878,35 +1821,6 @@ FUNCTIONS = {
:py:class:`mozbuild.frontend.data.JavaJarData`.
"""),
- 'add_android_eclipse_project': (
- lambda self: self._add_android_eclipse_project, (str, str),
- """Declare an Android Eclipse project.
-
- This is one of the supported ways to populate the
- ANDROID_ECLIPSE_PROJECT_TARGETS variable.
-
- The parameters are:
- * name - project name.
- * manifest - path to AndroidManifest.xml.
-
- This returns a rich Android Eclipse project type, described at
- :py:class:`mozbuild.frontend.data.AndroidEclipseProjectData`.
- """),
-
- 'add_android_eclipse_library_project': (
- lambda self: self._add_android_eclipse_library_project, (str,),
- """Declare an Android Eclipse library project.
-
- This is one of the supported ways to populate the
- ANDROID_ECLIPSE_PROJECT_TARGETS variable.
-
- The parameters are:
- * name - project name.
-
- This returns a rich Android Eclipse project type, described at
- :py:class:`mozbuild.frontend.data.AndroidEclipseProjectData`.
- """),
-
'export': (lambda self: self._export, (str,),
"""Make the specified variable available to all child directories.
diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
index 25c5826626..49ec1e8d7a 100644
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -23,10 +23,6 @@ import mozinfo
import pytoml
from .data import (
- AndroidAssetsDirs,
- AndroidExtraPackages,
- AndroidExtraResDirs,
- AndroidResDirs,
BaseSources,
BrandingFiles,
ChromeManifestEntry,
@@ -789,9 +785,6 @@ class TreeMetadataEmitter(LoggingMixin):
passthru = VariablePassthru(context)
varlist = [
'ALLOW_COMPILER_WARNINGS',
- 'ANDROID_APK_NAME',
- 'ANDROID_APK_PACKAGE',
- 'ANDROID_GENERATED_RESFILES',
'DISABLE_STL_WRAPPING',
'EXTRA_DSO_LDOPTS',
'PYTHON_UNIT_TESTS',
@@ -993,9 +986,6 @@ class TreeMetadataEmitter(LoggingMixin):
for name, jar in context.get('JAVA_JAR_TARGETS', {}).items():
yield ContextWrapped(context, jar)
- for name, data in context.get('ANDROID_ECLIPSE_PROJECT_TARGETS', {}).items():
- yield ContextWrapped(context, data)
-
if context.get('USE_YASM') is True:
yasm = context.config.substs.get('YASM')
if not yasm:
@@ -1004,24 +994,6 @@ class TreeMetadataEmitter(LoggingMixin):
passthru.variables['ASFLAGS'] = context.config.substs.get('YASM_ASFLAGS')
passthru.variables['AS_DASH_C_FLAG'] = ''
- for (symbol, cls) in [
- ('ANDROID_RES_DIRS', AndroidResDirs),
- ('ANDROID_EXTRA_RES_DIRS', AndroidExtraResDirs),
- ('ANDROID_ASSETS_DIRS', AndroidAssetsDirs)]:
- paths = context.get(symbol)
- if not paths:
- continue
- for p in paths:
- if isinstance(p, SourcePath) and not os.path.isdir(p.full_path):
- raise SandboxValidationError('Directory listed in '
- '%s is not a directory: \'%s\'' %
- (symbol, p.full_path), context)
- yield cls(context, paths)
-
- android_extra_packages = context.get('ANDROID_EXTRA_PACKAGES')
- if android_extra_packages:
- yield AndroidExtraPackages(context, android_extra_packages)
-
if passthru.variables:
yield passthru
diff --git a/python/mozbuild/mozbuild/frontend/reader.py b/python/mozbuild/mozbuild/frontend/reader.py
index 8192b1ec6e..a7d7e8b71a 100644
--- a/python/mozbuild/mozbuild/frontend/reader.py
+++ b/python/mozbuild/mozbuild/frontend/reader.py
@@ -53,7 +53,6 @@ from mozpack.files import FileFinder
import mozpack.path as mozpath
from .data import (
- AndroidEclipseProjectData,
JavaJarData,
)
@@ -263,34 +262,6 @@ class MozbuildSandbox(Sandbox):
self['JAVA_JAR_TARGETS'][name] = jar
return jar
- # Not exposed to the sandbox.
- def add_android_eclipse_project_helper(self, name):
- """Add an Android Eclipse project target."""
- if not name:
- raise Exception('Android Eclipse project cannot be registered without a name')
-
- if name in self['ANDROID_ECLIPSE_PROJECT_TARGETS']:
- raise Exception('Android Eclipse project has already been registered: %s' % name)
-
- data = AndroidEclipseProjectData(name)
- self['ANDROID_ECLIPSE_PROJECT_TARGETS'][name] = data
- return data
-
- def _add_android_eclipse_project(self, name, manifest):
- if not manifest:
- raise Exception('Android Eclipse project must specify a manifest')
-
- data = self.add_android_eclipse_project_helper(name)
- data.manifest = manifest
- data.is_library = False
- return data
-
- def _add_android_eclipse_library_project(self, name):
- data = self.add_android_eclipse_project_helper(name)
- data.manifest = None
- data.is_library = True
- return data
-
def _export(self, varname):
"""Export the variable to all subdirectories of the current path."""
diff --git a/security/manager/android_stub.h b/security/manager/android_stub.h
deleted file mode 100644
index 6f5ad3f558..0000000000
--- a/security/manager/android_stub.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 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/. */
-
-/* This file allows NSS to build by stubbing out
- * features that aren't provided by Android/Bionic */
-
-#ifndef ANDROID_STUB_H
-#define ANDROID_STUB_H
-
-/* sysinfo is defined but not implemented.
- * we may be able to implement it ourselves. */
-#define _SYS_SYSINFO_H_
-
-#include <sys/cdefs.h>
-#include <sys/resource.h>
-#include <linux/kernel.h>
-#include <unistd.h>
-
-#ifndef ANDROID_VERSION
-#include <android/api-level.h>
-#define ANDROID_VERSION __ANDROID_API__
-#endif
-
-/* Use this stub version of getdtablesize
- * instead of the one in the header */
-__attribute__((unused))
-static int getdtablesize_stub(void)
-{
- struct rlimit r;
- if (getrlimit(RLIMIT_NOFILE, &r) < 0) {
- return sysconf(_SC_OPEN_MAX);
- }
- return r.rlim_cur;
-}
-#define getdtablesize() getdtablesize_stub()
-
-#if ANDROID_VERSION < 21
-#define RTLD_NOLOAD 0
-#endif
-
-#define sysinfo(foo) -1
-
-#endif /* ANDROID_STUB_H */
diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json
index 4bd4c28261..ca0cce45f7 100644
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -4307,63 +4307,6 @@
"n_buckets" : 64,
"description": "The width dimension of the 'sizes' attribute for <link rel=icon>."
},
- "FENNEC_DISTRIBUTION_REFERRER_INVALID": {
- "expires_in_version": "never",
- "kind": "flag",
- "description": "Whether the referrer intent specified an invalid distribution name",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_DISTRIBUTION_CODE_CATEGORY": {
- "expires_in_version": "never",
- "kind": "enumerated",
- "n_values": 20,
- "description": "First digit of HTTP result code, or error category, during distribution download",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_DISTRIBUTION_DOWNLOAD_TIME_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 100,
- "high": 40000,
- "n_buckets": 30,
- "description": "Time taken to download a specified distribution file (msec)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_BOOKMARKS_COUNT": {
- "expires_in_version": "60",
- "kind": "exponential",
- "high": 8000,
- "n_buckets": 20,
- "description": "Number of bookmarks stored in the browser DB",
- "alert_emails": ["mobile-frontend@mozilla.com"],
- "bug_numbers": [1244704]
- },
- "FENNEC_ORBOT_INSTALLED": {
- "expires_in_version": "60",
- "kind": "flag",
- "cpp_guard": "ANDROID",
- "description": "Whether or not users have Orbot installed",
- "alert_emails": ["seceng@mozilla.org"],
- "bug_numbers": [1314784]
- },
- "FENNEC_READING_LIST_COUNT": {
- "expires_in_version": "50",
- "kind": "exponential",
- "high": 1000,
- "n_buckets": 10,
- "cpp_guard": "ANDROID",
- "description": "Number of reading list items stored in the browser DB *** No longer needed (bug 1156565). Delete histogram and accumulation code! ***"
- },
- "FENNEC_READER_VIEW_CACHE_SIZE": {
- "expires_in_version": "60",
- "alert_emails": ["mobile-frontend@mozilla.com"],
- "kind": "exponential",
- "low": 32,
- "high": 51200,
- "n_buckets": 20,
- "description": "Total disk space used by items in the reader view cache (KB)",
- "bug_numbers": [1246159]
- },
"PLACES_SORTED_BOOKMARKS_PERC": {
"expires_in_version": "never",
"kind": "linear",
@@ -6289,107 +6232,6 @@
"n_values": 10,
"description": "Track click count on about:newtab tiles per index (0-8). For non-default row or column configurations all clicks into the '9' bucket. *** No longer needed (bug 1156565). Delete histogram and accumulation code! ***"
},
- "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS": {
- "expires_in_version": "default",
- "kind": "exponential",
- "high": 50000,
- "n_buckets": 20,
- "description": "Number of bookmarks in the original XUL places database",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_GLOBALHISTORY_ADD_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 10,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time for a record to be added to history (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_GLOBALHISTORY_UPDATE_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 10,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time for a record to be updated in history (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_GLOBALHISTORY_VISITED_BUILD_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 10,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time to update the visited link set (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_RESTORING_ACTIVITY": {
- "expires_in_version": "never",
- "kind": "flag",
- "description": "Fennec is starting up but the Gecko thread was still running",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_SEARCH_LOADER_TIME_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 10,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time for a URL bar DB search to return (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_STARTUP_TIME_GECKOREADY": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 500,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time for the Gecko:Ready message to arrive (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_STARTUP_TIME_JAVAUI": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 100,
- "high": 5000,
- "n_buckets": 20,
- "description": "Time for the Java UI to load (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_TOPSITES_LOADER_TIME_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 10,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time for the home screen Top Sites query to return with no filter set (ms)",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_ACTIVITY_STREAM_TOPSITES_LOADER_TIME_MS": {
- "expires_in_version": "never",
- "kind": "exponential",
- "low": 10,
- "high": 20000,
- "n_buckets": 20,
- "description": "Time for the Activity Stream home screen Top Sites query to return (ms)",
- "alert_emails": ["mobile-frontend@mozilla.com"],
- "bug_numbers": [1293790],
- "cpp_guard": "ANDROID"
- },
- "FENNEC_HOMEPANELS_CUSTOM": {
- "expires_in_version": "54",
- "kind": "boolean",
- "bug_numbers": [1245368],
- "description": "Whether the user has customized their homepanels",
- "cpp_guard": "ANDROID"
- },
- "FENNEC_WAS_KILLED": {
- "expires_in_version": "never",
- "kind": "flag",
- "description": "Killed, likely due to an OOM condition",
- "cpp_guard": "ANDROID"
- },
"FIPS_ENABLED": {
"alert_emails": ["seceng@mozilla.org"],
"expires_in_version": "54",
@@ -8839,14 +8681,6 @@
"kind": "boolean",
"description": "Is the tracking protection in private browsing mode disabled?"
},
- "FENNEC_TRACKING_PROTECTION_STATE": {
- "expires_in_version": "60",
- "kind": "enumerated",
- "n_values": 5,
- "description": "The state of the user-visible tracking protection setting (0 = Disabled, 1 = Enabled in PB, 2 = Enabled)",
- "alert_emails": ["mleibovic@mozilla.com"],
- "bug_numbers": [1228090]
- },
"TRACKING_PROTECTION_SHIELD": {
"expires_in_version": "never",
"kind": "enumerated",
@@ -9386,53 +9220,6 @@
"kind": "boolean",
"description": "Whether a saved login has a username"
},
- "FENNEC_SYNC11_MIGRATION_SENTINELS_SEEN": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "The number of Sync 1.1 -> Sync 1.5 migration sentinels seen by Android Sync."
- },
- "FENNEC_SYNC11_MIGRATIONS_FAILED": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "The number of Sync 1.1 -> Sync 1.5 migrations that failed during Android Sync."
- },
- "FENNEC_SYNC11_MIGRATIONS_SUCCEEDED": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "The number of Sync 1.1 -> Sync 1.5 migrations that succeeded during Android Sync."
- },
- "FENNEC_SYNC11_MIGRATION_NOTIFICATIONS_OFFERED": {
- "expires_in_version": "45",
- "kind": "exponential",
- "high": 500,
- "n_buckets": 5,
- "description": "The number of Sync 1.5 'complete upgrade/migration' notifications offered by Android Sync."
- },
- "FENNEC_SYNC11_MIGRATIONS_COMPLETED": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "The number of Sync 1.5 migrations completed by Android Sync."
- },
- "FENNEC_SYNC_NUMBER_OF_SYNCS_STARTED": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "Counts the number of times that a sync has started."
- },
- "FENNEC_SYNC_NUMBER_OF_SYNCS_COMPLETED": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "Counts the number of times that a sync has completed with no errors."
- },
- "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "Counts the number of times that a sync has failed with errors."
- },
- "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED_BACKOFF": {
- "expires_in_version": "45",
- "kind": "count",
- "description": "Counts the number of times that a sync has failed because of trying to sync before server backoff interval has passed."
- },
"SLOW_SCRIPT_NOTICE_COUNT": {
"alert_emails": ["perf-telemetry-alerts@mozilla.com"],
"expires_in_version": "never",
@@ -9536,14 +9323,6 @@
"n_values": 5,
"description": "The result of trying to download a document to show in reader view (0=Success, 1=Error XHR, 2=Error no document)"
},
- "FENNEC_LOAD_SAVED_PAGE": {
- "expires_in_version": "60",
- "alert_emails": ["mobile-frontend@mozilla.com"],
- "kind": "enumerated",
- "n_values": 10,
- "description": "How often users load saved items when online/offline (0=RL online, 1=RL offline, 2=BM online, 3=BM offline)",
- "bug_numbers": [1243387]
- },
"PERMISSIONS_SQL_CORRUPTED": {
"expires_in_version": "never",
"kind": "count",
@@ -9554,20 +9333,6 @@
"kind": "count",
"description": "Record the removal of defective permissions.sqlite"
},
- "FENNEC_TABQUEUE_QUEUESIZE" : {
- "expires_in_version": "never",
- "kind": "exponential",
- "high": 50,
- "n_buckets": 10,
- "description": "The number of tabs queued when opened."
- },
- "FENNEC_CUSTOM_HOMEPAGE": {
- "expires_in_version": "60",
- "alert_emails": ["mobile-frontend@mozilla.com"],
- "bug_numbers": [1239102],
- "kind": "boolean",
- "description": "Whether the user has set a custom homepage."
- },
"GRAPHICS_DRIVER_STARTUP_TEST": {
"alert_emails": ["gfx-telemetry-alerts@mozilla.com","danderson@mozilla.com","msreckovic@mozilla.com"],
"expires_in_version": "never",
@@ -10618,14 +10383,6 @@
"kind": "count",
"description": "Tracking the total number of opened Containers."
},
- "FENNEC_SESSIONSTORE_DAMAGED_SESSION_FILE": {
- "alert_emails": ["jh+bugzilla@buttercookie.de"],
- "expires_in_version": "56",
- "kind": "flag",
- "bug_numbers": [1284017],
- "description": "When restoring tabs on startup, reading from sessionstore.js failed, even though the file exists and is not containing an explicitly empty window.",
- "cpp_guard": "ANDROID"
- },
"SHARED_WORKER_COUNT": {
"alert_emails": ["amarchesini@mozilla.com"],
"expires_in_version": "58",
@@ -10633,14 +10390,6 @@
"bug_numbers": [1295980],
"description": "Number of the use of SharedWorkers."
},
- "FENNEC_SESSIONSTORE_RESTORING_FROM_BACKUP": {
- "alert_emails": ["jh+bugzilla@buttercookie.de"],
- "expires_in_version": "56",
- "kind": "flag",
- "bug_numbers": [1190627],
- "description": "When restoring tabs on startup, reading from sessionstore.js failed, but sessionstore.bak was read successfully.",
- "cpp_guard": "ANDROID"
- },
"NUMBER_OF_PROFILES": {
"alert_emails": ["amarchesini@mozilla.com"],
"expires_in_version": "58",
diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/components/telemetry/histogram-whitelists.json
index dd4bd9e70a..aa1453da99 100644
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -11,7 +11,6 @@
"AUTO_REJECTED_TRANSLATION_OFFERS",
"BACKGROUNDFILESAVER_THREAD_COUNT",
"BAD_FALLBACK_FONT",
- "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS",
"BROWSER_IS_ASSIST_DEFAULT",
"BROWSER_IS_USER_DEFAULT",
"BROWSER_IS_USER_DEFAULT_ERROR",
@@ -222,30 +221,6 @@
"E10S_BLOCKED_FROM_RUNNING",
"E10S_WINDOW",
"ENABLE_PRIVILEGE_EVER_CALLED",
- "FENNEC_DISTRIBUTION_CODE_CATEGORY",
- "FENNEC_DISTRIBUTION_DOWNLOAD_TIME_MS",
- "FENNEC_DISTRIBUTION_REFERRER_INVALID",
- "FENNEC_GLOBALHISTORY_ADD_MS",
- "FENNEC_GLOBALHISTORY_UPDATE_MS",
- "FENNEC_GLOBALHISTORY_VISITED_BUILD_MS",
- "FENNEC_HOMEPANELS_CUSTOM",
- "FENNEC_READING_LIST_COUNT",
- "FENNEC_RESTORING_ACTIVITY",
- "FENNEC_SEARCH_LOADER_TIME_MS",
- "FENNEC_STARTUP_TIME_GECKOREADY",
- "FENNEC_STARTUP_TIME_JAVAUI",
- "FENNEC_SYNC11_MIGRATIONS_COMPLETED",
- "FENNEC_SYNC11_MIGRATIONS_FAILED",
- "FENNEC_SYNC11_MIGRATIONS_SUCCEEDED",
- "FENNEC_SYNC11_MIGRATION_NOTIFICATIONS_OFFERED",
- "FENNEC_SYNC11_MIGRATION_SENTINELS_SEEN",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_COMPLETED",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED_BACKOFF",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_STARTED",
- "FENNEC_TABQUEUE_QUEUESIZE",
- "FENNEC_TOPSITES_LOADER_TIME_MS",
- "FENNEC_WAS_KILLED",
"FETCH_IS_MAINTHREAD",
"FLASH_PLUGIN_AREA",
"FLASH_PLUGIN_HEIGHT",
@@ -728,7 +703,6 @@
"BLOCKED_ON_PLUGIN_MODULE_INIT_MS",
"BLOCKED_ON_PLUGIN_STREAM_INIT_MS",
"BLOCKLIST_SYNC_FILE_LOAD",
- "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS",
"BROWSER_IS_ASSIST_DEFAULT",
"BROWSER_IS_USER_DEFAULT",
"BROWSER_IS_USER_DEFAULT_ERROR",
@@ -985,29 +959,6 @@
"E10S_BLOCKED_FROM_RUNNING",
"E10S_WINDOW",
"ENABLE_PRIVILEGE_EVER_CALLED",
- "FENNEC_DISTRIBUTION_CODE_CATEGORY",
- "FENNEC_DISTRIBUTION_DOWNLOAD_TIME_MS",
- "FENNEC_DISTRIBUTION_REFERRER_INVALID",
- "FENNEC_GLOBALHISTORY_ADD_MS",
- "FENNEC_GLOBALHISTORY_UPDATE_MS",
- "FENNEC_GLOBALHISTORY_VISITED_BUILD_MS",
- "FENNEC_READING_LIST_COUNT",
- "FENNEC_RESTORING_ACTIVITY",
- "FENNEC_SEARCH_LOADER_TIME_MS",
- "FENNEC_STARTUP_TIME_GECKOREADY",
- "FENNEC_STARTUP_TIME_JAVAUI",
- "FENNEC_SYNC11_MIGRATIONS_COMPLETED",
- "FENNEC_SYNC11_MIGRATIONS_FAILED",
- "FENNEC_SYNC11_MIGRATIONS_SUCCEEDED",
- "FENNEC_SYNC11_MIGRATION_NOTIFICATIONS_OFFERED",
- "FENNEC_SYNC11_MIGRATION_SENTINELS_SEEN",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_COMPLETED",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED_BACKOFF",
- "FENNEC_SYNC_NUMBER_OF_SYNCS_STARTED",
- "FENNEC_TABQUEUE_QUEUESIZE",
- "FENNEC_TOPSITES_LOADER_TIME_MS",
- "FENNEC_WAS_KILLED",
"FETCH_IS_MAINTHREAD",
"FIND_PLUGINS",
"FLASH_PLUGIN_AREA",
@@ -1948,7 +1899,6 @@
"DENIED_TRANSLATION_OFFERS",
"XUL_CACHE_DISABLED",
"PAGE_FAULTS_HARD",
- "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS",
"PDF_VIEWER_USED",
"NETWORK_DISK_CACHE_OPEN",
"GEOLOCATION_WIN8_SOURCE_IS_MLS"
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm
index 04bcad0c1e..635e936ede 100644
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -213,7 +213,6 @@ this.AppConstants = Object.freeze({
MOZ_UPDATE_CHANNEL: "@MOZ_UPDATE_CHANNEL@",
INSTALL_LOCALE: "@AB_CD@",
MOZ_WIDGET_TOOLKIT: "@MOZ_WIDGET_TOOLKIT@",
- ANDROID_PACKAGE_NAME: "@ANDROID_PACKAGE_NAME@",
DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@",
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 225f3d9321..e38b1b0b75 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -117,8 +117,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'WindowsRegistry.jsm',
]
-for var in ('ANDROID_PACKAGE_NAME',
- 'MOZ_APP_NAME',
+for var in ('MOZ_APP_NAME',
'MOZ_APP_VERSION',
'MOZ_APP_VERSION_DISPLAY',
'MOZ_MACBUNDLE_NAME',