aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-03-08 08:24:16 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-03-08 08:24:16 +0000
commit50b8bd8e0bcbecd5e1646106e0333556179bd2e7 (patch)
treeb61560bf074f80ddfc201ced730052175b1bfc1a
parent23e7c10c47f8222e169c886e40aa210ed3c6c605 (diff)
parent411501423307c29a160affef03485fd8000b3c1d (diff)
downloadprotobuf-pie-r2-s2-release.tar.gz
Snap for 4641295 from 411501423307c29a160affef03485fd8000b3c1d to pi-releaseandroid-wear-9.0.0_r9android-wear-9.0.0_r8android-wear-9.0.0_r7android-wear-9.0.0_r6android-wear-9.0.0_r5android-wear-9.0.0_r4android-wear-9.0.0_r34android-wear-9.0.0_r33android-wear-9.0.0_r32android-wear-9.0.0_r31android-wear-9.0.0_r30android-wear-9.0.0_r3android-wear-9.0.0_r29android-wear-9.0.0_r28android-wear-9.0.0_r27android-wear-9.0.0_r26android-wear-9.0.0_r25android-wear-9.0.0_r24android-wear-9.0.0_r23android-wear-9.0.0_r22android-wear-9.0.0_r21android-wear-9.0.0_r20android-wear-9.0.0_r2android-wear-9.0.0_r19android-wear-9.0.0_r18android-wear-9.0.0_r17android-wear-9.0.0_r16android-wear-9.0.0_r15android-wear-9.0.0_r14android-wear-9.0.0_r13android-wear-9.0.0_r12android-wear-9.0.0_r11android-wear-9.0.0_r10android-wear-9.0.0_r1android-vts-9.0_r9android-vts-9.0_r8android-vts-9.0_r7android-vts-9.0_r6android-vts-9.0_r5android-vts-9.0_r4android-vts-9.0_r19android-vts-9.0_r18android-vts-9.0_r17android-vts-9.0_r16android-vts-9.0_r15android-vts-9.0_r14android-vts-9.0_r13android-vts-9.0_r12android-vts-9.0_r11android-vts-9.0_r10android-security-9.0.0_r76android-security-9.0.0_r75android-security-9.0.0_r74android-security-9.0.0_r73android-security-9.0.0_r72android-security-9.0.0_r71android-security-9.0.0_r70android-security-9.0.0_r69android-security-9.0.0_r68android-security-9.0.0_r67android-security-9.0.0_r66android-security-9.0.0_r65android-security-9.0.0_r64android-security-9.0.0_r63android-security-9.0.0_r62android-cts-9.0_r9android-cts-9.0_r8android-cts-9.0_r7android-cts-9.0_r6android-cts-9.0_r5android-cts-9.0_r4android-cts-9.0_r3android-cts-9.0_r20android-cts-9.0_r2android-cts-9.0_r19android-cts-9.0_r18android-cts-9.0_r17android-cts-9.0_r16android-cts-9.0_r15android-cts-9.0_r14android-cts-9.0_r13android-cts-9.0_r12android-cts-9.0_r11android-cts-9.0_r10android-cts-9.0_r1android-9.0.0_r9android-9.0.0_r8android-9.0.0_r7android-9.0.0_r61android-9.0.0_r60android-9.0.0_r6android-9.0.0_r59android-9.0.0_r58android-9.0.0_r57android-9.0.0_r56android-9.0.0_r55android-9.0.0_r54android-9.0.0_r53android-9.0.0_r52android-9.0.0_r51android-9.0.0_r50android-9.0.0_r5android-9.0.0_r49android-9.0.0_r48android-9.0.0_r3android-9.0.0_r2android-9.0.0_r18android-9.0.0_r17android-9.0.0_r10android-9.0.0_r1security-pi-releasepie-vts-releasepie-security-releasepie-s2-releasepie-release-2pie-releasepie-r2-s2-releasepie-r2-s1-releasepie-r2-releasepie-platform-releasepie-gsipie-cuttlefish-testingpie-cts-release
Change-Id: I5c3a5f74b7a0965d7f90fbc5938e280654e2c665
-rw-r--r--Android.bp17
-rw-r--r--java/core/src/stubs/sun/misc/Unsafe.java45
2 files changed, 61 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index 6f9f7cb95..84b10229b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -506,7 +506,7 @@ java_library_host {
java_library_static {
name: "libprotobuf-java-lite",
host_supported: true,
- no_framework_libs: true,
+ sdk_version: "core_current",
srcs: [
"java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java",
@@ -550,6 +550,12 @@ java_library_static {
"java/core/src/main/java/com/google/protobuf/WireFormat.java",
],
+ target: {
+ android: {
+ libs: ["libcore_private.stubs"],
+ },
+ },
+
java_version: "1.7",
}
@@ -581,3 +587,12 @@ java_library_host {
name: "host-libprotobuf-java-full",
static_libs: ["libprotobuf-java-full"],
}
+
+// Stubs library for using hidden APIs in core-oj and core-libart
+// =======================================================
+java_library {
+ name: "libcore_private.stubs",
+ srcs: ["java/core/src/stubs/**/*.java"],
+ sdk_version: "core_current",
+ installable: false,
+}
diff --git a/java/core/src/stubs/sun/misc/Unsafe.java b/java/core/src/stubs/sun/misc/Unsafe.java
new file mode 100644
index 000000000..fa66e4873
--- /dev/null
+++ b/java/core/src/stubs/sun/misc/Unsafe.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+/**
+ * A stub class for sun.misc.Unsafe to make it possible to build protobuf only using Android SDK,
+ * which lacks this class.
+ *
+ * Note that this class is only to provide symbol definitions at build-time and this class is not
+ * embedded in the protobuf library. At runtime, Unsafe class is provided by the libcore-oj which is
+ * in the bootclasspath and protobuf is linked to the class loaded there.
+ */
+public class Unsafe {
+ public byte getByte(Object o, long offset) { /* null implementation */ return 0; }
+ public byte getByte(long address) { /* null implementation */ return 0; }
+ public int arrayBaseOffset(Class arrayClass) { /* null implementation */ return 0; }
+ public long getLong(Object o, long offset) { /* null implementation */ return 0; }
+ public long getLong(long address) { /* null implementation */ return 0; }
+ public long objectFieldOffset(java.lang.reflect.Field f) { /* null implementation */ return 0; }
+ public void putByte(Object o, long offset, byte x) { /* null implementation */ }
+ public void putByte(long address, byte x) { /* null implmentation */ }
+}