summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt2/Android.bp6
-rw-r--r--tools/aapt2/LoadedApk.cpp14
-rw-r--r--tools/aapt2/Main.cpp8
-rw-r--r--tools/aapt2/cmd/Compile.cpp35
-rw-r--r--tools/aapt2/cmd/Compile_test.cpp2
-rw-r--r--tools/aapt2/cmd/Convert.cpp8
-rw-r--r--tools/aapt2/cmd/Dump.cpp11
-rw-r--r--tools/aapt2/cmd/Dump.h2
-rw-r--r--tools/aapt2/cmd/Link.cpp28
-rw-r--r--tools/aapt2/cmd/Optimize.cpp6
-rw-r--r--tools/aapt2/compile/Image.h209
-rw-r--r--tools/aapt2/compile/NinePatch.cpp698
-rw-r--r--tools/aapt2/compile/NinePatch_test.cpp377
-rw-r--r--tools/aapt2/compile/Png.cpp1319
-rw-r--r--tools/aapt2/compile/Png.h106
-rw-r--r--tools/aapt2/compile/PngChunkFilter.cpp180
-rw-r--r--tools/aapt2/compile/PngCrunch.cpp750
-rw-r--r--tools/aapt2/dump/DumpManifest.cpp2
-rw-r--r--tools/aapt2/format/Archive.cpp4
-rw-r--r--tools/aapt2/format/Archive.h4
-rw-r--r--tools/aapt2/format/Archive_test.cpp2
-rw-r--r--tools/aapt2/format/Container.cpp4
-rw-r--r--tools/aapt2/format/Container.h8
-rw-r--r--tools/aapt2/io/BigBufferStream.cpp101
-rw-r--r--tools/aapt2/io/BigBufferStream.h79
-rw-r--r--tools/aapt2/io/Data.h5
-rw-r--r--tools/aapt2/io/File.cpp2
-rw-r--r--tools/aapt2/io/File.h4
-rw-r--r--tools/aapt2/io/FileStream.cpp203
-rw-r--r--tools/aapt2/io/FileStream.h107
-rw-r--r--tools/aapt2/io/FileStream_test.cpp127
-rw-r--r--tools/aapt2/io/FileSystem.cpp6
-rw-r--r--tools/aapt2/io/FileSystem.h2
-rw-r--r--tools/aapt2/io/Io.h99
-rw-r--r--tools/aapt2/io/StringStream.cpp17
-rw-r--r--tools/aapt2/io/StringStream.h9
-rw-r--r--tools/aapt2/io/Util.cpp11
-rw-r--r--tools/aapt2/io/Util.h24
-rw-r--r--tools/aapt2/io/ZipArchive.cpp2
-rw-r--r--tools/aapt2/io/ZipArchive.h2
-rw-r--r--tools/aapt2/java/ClassDefinition.cpp2
-rw-r--r--tools/aapt2/java/ClassDefinition.h2
-rw-r--r--tools/aapt2/java/JavaClassGenerator.cpp2
-rw-r--r--tools/aapt2/java/JavaClassGenerator.h13
-rw-r--r--tools/aapt2/java/ProguardRules.cpp2
-rw-r--r--tools/aapt2/java/ProguardRules.h6
-rw-r--r--tools/aapt2/test/Common.h2
-rw-r--r--tools/aapt2/test/Fixture.cpp2
-rw-r--r--tools/aapt2/text/Printer.cpp2
-rw-r--r--tools/aapt2/text/Printer.h7
-rw-r--r--tools/aapt2/xml/XmlDom.cpp2
-rw-r--r--tools/aapt2/xml/XmlDom.h4
-rw-r--r--tools/aapt2/xml/XmlPullParser.cpp2
-rw-r--r--tools/aapt2/xml/XmlPullParser.h9
-rw-r--r--tools/hoststubgen/README.md38
-rw-r--r--tools/hoststubgen/hoststubgen/Android.bp17
-rw-r--r--tools/hoststubgen/hoststubgen/framework-policy-override.txt6
-rw-r--r--tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/EventLog_host.java69
-rw-r--r--tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/MessageQueue_host.java94
-rw-r--r--tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java9
-rw-r--r--tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/android/system/ErrnoException.java84
-rw-r--r--tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/libcore/io/IoUtils.java61
-rw-r--r--tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInImpl.java35
-rw-r--r--tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInStub.java38
-rw-r--r--tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsIgnore.java (renamed from tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedKeepClass.java)12
-rw-r--r--tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsSubstitute.java38
-rw-r--r--tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsThrow.java (renamed from tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedStubClass.java)12
-rw-r--r--tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostTestUtils.java4
-rwxr-xr-xtools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh59
-rw-r--r--tools/hoststubgen/hoststubgen/jarjar-rules.txt2
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt83
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenLogger.kt219
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt234
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/Main.kt18
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt57
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/ClassNodes.kt20
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AndroidHeuristicsFilter.kt (renamed from tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/KeepAllClassesFilter.kt)29
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt35
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt14
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ImplicitOutputFilter.kt2
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt70
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt45
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt43
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/StubGeneratingAdapter.kt1
-rw-r--r--tools/hoststubgen/hoststubgen/test-framework/README.md17
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/README.md8
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt159
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt755
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt974
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/12-hoststubgen-test-tiny-framework-host-ext-stub-dump.txt755
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-impl-dump.txt1038
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt3
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/IPretendingAidl.java36
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java12
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java6
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java17
-rw-r--r--tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/utils/AsmUtilsTest.kt34
-rw-r--r--tools/hoststubgen/scripts/Android.bp6
-rwxr-xr-xtools/hoststubgen/scripts/run-all-tests.sh14
-rwxr-xr-xtools/hoststubgen/scripts/run-ravenwood-test129
100 files changed, 4886 insertions, 5165 deletions
diff --git a/tools/aapt2/Android.bp b/tools/aapt2/Android.bp
index 412aa9bf88ab..275a0e21fedd 100644
--- a/tools/aapt2/Android.bp
+++ b/tools/aapt2/Android.bp
@@ -92,10 +92,6 @@ cc_library_host_static {
srcs: [
"compile/IdAssigner.cpp",
"compile/InlineXmlFormatParser.cpp",
- "compile/NinePatch.cpp",
- "compile/Png.cpp",
- "compile/PngChunkFilter.cpp",
- "compile/PngCrunch.cpp",
"compile/PseudolocaleGenerator.cpp",
"compile/Pseudolocalizer.cpp",
"compile/XmlIdCollector.cpp",
@@ -112,9 +108,7 @@ cc_library_host_static {
"format/binary/XmlFlattener.cpp",
"format/proto/ProtoDeserialize.cpp",
"format/proto/ProtoSerialize.cpp",
- "io/BigBufferStream.cpp",
"io/File.cpp",
- "io/FileStream.cpp",
"io/FileSystem.cpp",
"io/StringStream.cpp",
"io/Util.cpp",
diff --git a/tools/aapt2/LoadedApk.cpp b/tools/aapt2/LoadedApk.cpp
index 6b1fd9ff11eb..d6502d82848f 100644
--- a/tools/aapt2/LoadedApk.cpp
+++ b/tools/aapt2/LoadedApk.cpp
@@ -18,12 +18,12 @@
#include "ResourceValues.h"
#include "ValueVisitor.h"
+#include "androidfw/BigBufferStream.h"
#include "format/Archive.h"
#include "format/binary/TableFlattener.h"
#include "format/binary/XmlFlattener.h"
#include "format/proto/ProtoDeserialize.h"
#include "format/proto/ProtoSerialize.h"
-#include "io/BigBufferStream.h"
#include "io/Util.h"
#include "xml/XmlDom.h"
@@ -48,7 +48,7 @@ static ApkFormat DetermineApkFormat(io::IFileCollection* apk) {
}
// First try in proto format.
- std::unique_ptr<io::InputStream> manifest_in = manifest_file->OpenInputStream();
+ std::unique_ptr<android::InputStream> manifest_in = manifest_file->OpenInputStream();
if (manifest_in != nullptr) {
pb::XmlNode pb_node;
io::ProtoInputStreamReader proto_reader(manifest_in.get());
@@ -102,7 +102,7 @@ std::unique_ptr<LoadedApk> LoadedApk::LoadProtoApkFromFileCollection(
io::IFile* table_file = collection->FindFile(kProtoResourceTablePath);
if (table_file != nullptr) {
pb::ResourceTable pb_table;
- std::unique_ptr<io::InputStream> in = table_file->OpenInputStream();
+ std::unique_ptr<android::InputStream> in = table_file->OpenInputStream();
if (in == nullptr) {
diag->Error(android::DiagMessage(source) << "failed to open " << kProtoResourceTablePath);
return {};
@@ -129,7 +129,7 @@ std::unique_ptr<LoadedApk> LoadedApk::LoadProtoApkFromFileCollection(
return {};
}
- std::unique_ptr<io::InputStream> manifest_in = manifest_file->OpenInputStream();
+ std::unique_ptr<android::InputStream> manifest_in = manifest_file->OpenInputStream();
if (manifest_in == nullptr) {
diag->Error(android::DiagMessage(source) << "failed to open " << kAndroidManifestPath);
return {};
@@ -262,7 +262,7 @@ bool LoadedApk::WriteToArchive(IAaptContext* context, ResourceTable* split_table
return false;
}
- io::BigBufferInputStream input_stream(&buffer);
+ android::BigBufferInputStream input_stream(&buffer);
if (!io::CopyInputStreamToArchive(context,
&input_stream,
path,
@@ -296,7 +296,7 @@ bool LoadedApk::WriteToArchive(IAaptContext* context, ResourceTable* split_table
}
uint32_t compression_flags = file->WasCompressed() ? ArchiveEntry::kCompress : 0u;
- io::BigBufferInputStream manifest_buffer_in(&buffer);
+ android::BigBufferInputStream manifest_buffer_in(&buffer);
if (!io::CopyInputStreamToArchive(context, &manifest_buffer_in, path, compression_flags,
writer)) {
return false;
@@ -321,7 +321,7 @@ std::unique_ptr<xml::XmlResource> LoadedApk::LoadXml(const std::string& file_pat
std::unique_ptr<xml::XmlResource> doc;
if (format_ == ApkFormat::kProto) {
- std::unique_ptr<io::InputStream> in = file->OpenInputStream();
+ std::unique_ptr<android::InputStream> in = file->OpenInputStream();
if (!in) {
diag->Error(android::DiagMessage() << "failed to open file");
return nullptr;
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp
index a0b4dab9b8e5..b351d6ee4f33 100644
--- a/tools/aapt2/Main.cpp
+++ b/tools/aapt2/Main.cpp
@@ -27,6 +27,7 @@
#include "Diagnostics.h"
#include "android-base/stringprintf.h"
#include "android-base/utf8.h"
+#include "androidfw/FileStream.h"
#include "androidfw/IDiagnostics.h"
#include "androidfw/StringPiece.h"
#include "cmd/ApkInfo.h"
@@ -37,7 +38,6 @@
#include "cmd/Dump.h"
#include "cmd/Link.h"
#include "cmd/Optimize.h"
-#include "io/FileStream.h"
#include "trace/TraceBuffer.h"
#include "util/Files.h"
#include "util/Util.h"
@@ -99,7 +99,7 @@ class MainCommand : public Command {
*/
class DaemonCommand : public Command {
public:
- explicit DaemonCommand(io::FileOutputStream* out, android::IDiagnostics* diagnostics)
+ explicit DaemonCommand(android::FileOutputStream* out, android::IDiagnostics* diagnostics)
: Command("daemon", "m"), out_(out), diagnostics_(diagnostics) {
SetDescription("Runs aapt in daemon mode. Each subsequent line is a single parameter to the\n"
"command. The end of an invocation is signaled by providing an empty line.");
@@ -147,7 +147,7 @@ class DaemonCommand : public Command {
}
private:
- io::FileOutputStream* out_;
+ android::FileOutputStream* out_;
android::IDiagnostics* diagnostics_;
std::optional<std::string> trace_folder_;
};
@@ -167,7 +167,7 @@ int MainImpl(int argc, char** argv) {
// Use a smaller buffer so that there is less latency for printing to stdout.
constexpr size_t kStdOutBufferSize = 1024u;
- aapt::io::FileOutputStream fout(STDOUT_FILENO, kStdOutBufferSize);
+ android::FileOutputStream fout(STDOUT_FILENO, kStdOutBufferSize);
aapt::text::Printer printer(&fout);
aapt::StdErrDiagnostics diagnostics;
diff --git a/tools/aapt2/cmd/Compile.cpp b/tools/aapt2/cmd/Compile.cpp
index 728ba8aa4fdd..031dd5bb139c 100644
--- a/tools/aapt2/cmd/Compile.cpp
+++ b/tools/aapt2/cmd/Compile.cpp
@@ -25,13 +25,16 @@
#include "android-base/errors.h"
#include "android-base/file.h"
#include "android-base/utf8.h"
+#include "androidfw/BigBufferStream.h"
#include "androidfw/ConfigDescription.h"
+#include "androidfw/FileStream.h"
#include "androidfw/IDiagnostics.h"
+#include "androidfw/Image.h"
+#include "androidfw/Png.h"
#include "androidfw/StringPiece.h"
#include "cmd/Util.h"
#include "compile/IdAssigner.h"
#include "compile/InlineXmlFormatParser.h"
-#include "compile/Png.h"
#include "compile/PseudolocaleGenerator.h"
#include "compile/XmlIdCollector.h"
#include "format/Archive.h"
@@ -39,8 +42,6 @@
#include "format/proto/ProtoSerialize.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
-#include "io/BigBufferStream.h"
-#include "io/FileStream.h"
#include "io/FileSystem.h"
#include "io/StringStream.h"
#include "io/Util.h"
@@ -52,9 +53,9 @@
#include "xml/XmlDom.h"
#include "xml/XmlPullParser.h"
-using ::aapt::io::FileInputStream;
using ::aapt::text::Printer;
using ::android::ConfigDescription;
+using ::android::FileInputStream;
using ::android::StringPiece;
using ::android::base::SystemErrorCodeToString;
using ::google::protobuf::io::CopyingOutputStreamAdaptor;
@@ -241,7 +242,7 @@ static bool CompileTable(IAaptContext* context, const CompileOptions& options,
}
if (options.generate_text_symbols_path) {
- io::FileOutputStream fout_text(options.generate_text_symbols_path.value());
+ android::FileOutputStream fout_text(options.generate_text_symbols_path.value());
if (fout_text.HadError()) {
context->GetDiagnostics()->Error(android::DiagMessage()
@@ -307,7 +308,7 @@ static bool CompileTable(IAaptContext* context, const CompileOptions& options,
}
static bool WriteHeaderAndDataToWriter(StringPiece output_path, const ResourceFile& file,
- io::KnownSizeInputStream* in, IArchiveWriter* writer,
+ android::KnownSizeInputStream* in, IArchiveWriter* writer,
android::IDiagnostics* diag) {
TRACE_CALL();
// Start the entry so we can write the header.
@@ -448,7 +449,7 @@ static bool CompileXml(IAaptContext* context, const CompileOptions& options,
}
if (options.generate_text_symbols_path) {
- io::FileOutputStream fout_text(options.generate_text_symbols_path.value());
+ android::FileOutputStream fout_text(options.generate_text_symbols_path.value());
if (fout_text.HadError()) {
context->GetDiagnostics()->Error(android::DiagMessage()
@@ -498,21 +499,22 @@ static bool CompilePng(IAaptContext* context, const CompileOptions& options,
}
android::BigBuffer crunched_png_buffer(4096);
- io::BigBufferOutputStream crunched_png_buffer_out(&crunched_png_buffer);
+ android::BigBufferOutputStream crunched_png_buffer_out(&crunched_png_buffer);
// Ensure that we only keep the chunks we care about if we end up
// using the original PNG instead of the crunched one.
const StringPiece content(reinterpret_cast<const char*>(data->data()), data->size());
- PngChunkFilter png_chunk_filter(content);
- std::unique_ptr<Image> image = ReadPng(context, path_data.source, &png_chunk_filter);
+ android::PngChunkFilter png_chunk_filter(content);
+ android::SourcePathDiagnostics source_diag(path_data.source, context->GetDiagnostics());
+ auto image = android::ReadPng(&png_chunk_filter, &source_diag);
if (!image) {
return false;
}
- std::unique_ptr<NinePatch> nine_patch;
+ std::unique_ptr<android::NinePatch> nine_patch;
if (path_data.extension == "9.png") {
std::string err;
- nine_patch = NinePatch::Create(image->rows.get(), image->width, image->height, &err);
+ nine_patch = android::NinePatch::Create(image->rows.get(), image->width, image->height, &err);
if (!nine_patch) {
context->GetDiagnostics()->Error(android::DiagMessage() << err);
return false;
@@ -537,7 +539,8 @@ static bool CompilePng(IAaptContext* context, const CompileOptions& options,
}
// Write the crunched PNG.
- if (!WritePng(context, image.get(), nine_patch.get(), &crunched_png_buffer_out, {})) {
+ if (!android::WritePng(image.get(), nine_patch.get(), &crunched_png_buffer_out, {},
+ &source_diag, context->IsVerbose())) {
return false;
}
@@ -557,7 +560,7 @@ static bool CompilePng(IAaptContext* context, const CompileOptions& options,
png_chunk_filter.Rewind();
android::BigBuffer filtered_png_buffer(4096);
- io::BigBufferOutputStream filtered_png_buffer_out(&filtered_png_buffer);
+ android::BigBufferOutputStream filtered_png_buffer_out(&filtered_png_buffer);
io::Copy(&filtered_png_buffer_out, &png_chunk_filter);
buffer.AppendBuffer(std::move(filtered_png_buffer));
}
@@ -567,7 +570,7 @@ static bool CompilePng(IAaptContext* context, const CompileOptions& options,
// This will help catch exotic cases where the new code may generate larger PNGs.
std::stringstream legacy_stream{std::string(content)};
android::BigBuffer legacy_buffer(4096);
- Png png(context->GetDiagnostics());
+ android::Png png(context->GetDiagnostics());
if (!png.process(path_data.source, &legacy_stream, &legacy_buffer, {})) {
return false;
}
@@ -578,7 +581,7 @@ static bool CompilePng(IAaptContext* context, const CompileOptions& options,
}
}
- io::BigBufferInputStream buffer_in(&buffer);
+ android::BigBufferInputStream buffer_in(&buffer);
return WriteHeaderAndDataToWriter(output_path, res_file, &buffer_in, writer,
context->GetDiagnostics());
}
diff --git a/tools/aapt2/cmd/Compile_test.cpp b/tools/aapt2/cmd/Compile_test.cpp
index 8880089d0e20..9337cb913a0b 100644
--- a/tools/aapt2/cmd/Compile_test.cpp
+++ b/tools/aapt2/cmd/Compile_test.cpp
@@ -341,7 +341,7 @@ TEST_F(CompilerTest, RelativePathTest) {
// Check resources.pb contains relative sources.
io::IFile* proto_file =
apk.get()->GetFileCollection()->FindFile("resources.pb");
- std::unique_ptr<io::InputStream> proto_stream = proto_file->OpenInputStream();
+ std::unique_ptr<android::InputStream> proto_stream = proto_file->OpenInputStream();
io::ProtoInputStreamReader proto_reader(proto_stream.get());
pb::ResourceTable pb_table;
proto_reader.ReadMessage(&pb_table);
diff --git a/tools/aapt2/cmd/Convert.cpp b/tools/aapt2/cmd/Convert.cpp
index 387dcfe2ddf3..c132792d374b 100644
--- a/tools/aapt2/cmd/Convert.cpp
+++ b/tools/aapt2/cmd/Convert.cpp
@@ -24,13 +24,13 @@
#include "android-base/file.h"
#include "android-base/macros.h"
#include "android-base/stringprintf.h"
+#include "androidfw/BigBufferStream.h"
#include "androidfw/StringPiece.h"
#include "cmd/Util.h"
#include "format/binary/TableFlattener.h"
#include "format/binary/XmlFlattener.h"
#include "format/proto/ProtoDeserialize.h"
#include "format/proto/ProtoSerialize.h"
-#include "io/BigBufferStream.h"
#include "io/Util.h"
#include "process/IResourceTableConsumer.h"
#include "process/SymbolTable.h"
@@ -80,7 +80,7 @@ class BinaryApkSerializer : public IApkSerializer {
return false;
}
- io::BigBufferInputStream input_stream(&buffer);
+ android::BigBufferInputStream input_stream(&buffer);
return io::CopyInputStreamToArchive(context_, &input_stream, path, compression_flags, writer);
}
@@ -91,14 +91,14 @@ class BinaryApkSerializer : public IApkSerializer {
return false;
}
- io::BigBufferInputStream input_stream(&buffer);
+ android::BigBufferInputStream input_stream(&buffer);
return io::CopyInputStreamToArchive(context_, &input_stream, kApkResourceTablePath,
ArchiveEntry::kAlign, writer);
}
bool SerializeFile(FileReference* file, IArchiveWriter* writer) override {
if (file->type == ResourceFile::Type::kProtoXml) {
- unique_ptr<io::InputStream> in = file->file->OpenInputStream();
+ unique_ptr<android::InputStream> in = file->file->OpenInputStream();
if (in == nullptr) {
context_->GetDiagnostics()->Error(android::DiagMessage(source_)
<< "failed to open file " << *file->path);
diff --git a/tools/aapt2/cmd/Dump.cpp b/tools/aapt2/cmd/Dump.cpp
index 864af06f187e..6fa9ecbfa544 100644
--- a/tools/aapt2/cmd/Dump.cpp
+++ b/tools/aapt2/cmd/Dump.cpp
@@ -19,19 +19,18 @@
#include <cinttypes>
#include <vector>
-#include "android-base/stringprintf.h"
-#include "androidfw/ConfigDescription.h"
-#include "androidfw/StringPiece.h"
-
#include "Debug.h"
#include "Diagnostics.h"
#include "LoadedApk.h"
#include "Util.h"
+#include "android-base/stringprintf.h"
+#include "androidfw/ConfigDescription.h"
+#include "androidfw/FileStream.h"
+#include "androidfw/StringPiece.h"
#include "format/Container.h"
#include "format/binary/BinaryResourceParser.h"
#include "format/binary/XmlFlattener.h"
#include "format/proto/ProtoDeserialize.h"
-#include "io/FileStream.h"
#include "io/ZipArchive.h"
#include "process/IResourceTableConsumer.h"
#include "text/Printer.h"
@@ -145,7 +144,7 @@ int DumpAPCCommand::Action(const std::vector<std::string>& args) {
bool error = false;
for (auto container : args) {
- io::FileInputStream input(container);
+ android::FileInputStream input(container);
if (input.HadError()) {
context.GetDiagnostics()->Error(android::DiagMessage(container)
<< "failed to open file: " << input.GetError());
diff --git a/tools/aapt2/cmd/Dump.h b/tools/aapt2/cmd/Dump.h
index 76d33d7aa3b2..119a59b28317 100644
--- a/tools/aapt2/cmd/Dump.h
+++ b/tools/aapt2/cmd/Dump.h
@@ -17,7 +17,7 @@
#ifndef AAPT2_DUMP_H
#define AAPT2_DUMP_H
-#include <io/FileStream.h>
+#include <androidfw/FileStream.h>
#include <io/ZipArchive.h>
#include "Command.h"
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index c638873873dc..9ca546fc8d89 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -35,6 +35,8 @@
#include "android-base/expected.h"
#include "android-base/file.h"
#include "android-base/stringprintf.h"
+#include "androidfw/BigBufferStream.h"
+#include "androidfw/FileStream.h"
#include "androidfw/IDiagnostics.h"
#include "androidfw/Locale.h"
#include "androidfw/StringPiece.h"
@@ -48,8 +50,6 @@
#include "format/binary/XmlFlattener.h"
#include "format/proto/ProtoDeserialize.h"
#include "format/proto/ProtoSerialize.h"
-#include "io/BigBufferStream.h"
-#include "io/FileStream.h"
#include "io/FileSystem.h"
#include "io/Util.h"
#include "io/ZipArchive.h"
@@ -73,8 +73,8 @@
#include "util/Files.h"
#include "xml/XmlDom.h"
-using ::aapt::io::FileInputStream;
using ::android::ConfigDescription;
+using ::android::FileInputStream;
using ::android::StringPiece;
using ::android::base::expected;
using ::android::base::StringPrintf;
@@ -263,7 +263,7 @@ static bool FlattenXml(IAaptContext* context, const xml::XmlResource& xml_res, S
return false;
}
- io::BigBufferInputStream input_stream(&buffer);
+ android::BigBufferInputStream input_stream(&buffer);
return io::CopyInputStreamToArchive(context, &input_stream, path, ArchiveEntry::kCompress,
writer);
} break;
@@ -284,7 +284,7 @@ static bool FlattenXml(IAaptContext* context, const xml::XmlResource& xml_res, S
static std::unique_ptr<xml::XmlResource> LoadXml(const std::string& path,
android::IDiagnostics* diag) {
TRACE_CALL();
- FileInputStream fin(path);
+ android::FileInputStream fin(path);
if (fin.HadError()) {
diag->Error(android::DiagMessage(path) << "failed to load XML file: " << fin.GetError());
return {};
@@ -687,7 +687,7 @@ bool ResourceFileFlattener::Flatten(ResourceTable* table, IArchiveWriter* archiv
static bool WriteStableIdMapToPath(android::IDiagnostics* diag,
const std::unordered_map<ResourceName, ResourceId>& id_map,
const std::string& id_map_path) {
- io::FileOutputStream fout(id_map_path);
+ android::FileOutputStream fout(id_map_path);
if (fout.HadError()) {
diag->Error(android::DiagMessage(id_map_path) << "failed to open: " << fout.GetError());
return false;
@@ -1197,7 +1197,7 @@ class Linker {
return false;
}
- io::BigBufferInputStream input_stream(&buffer);
+ android::BigBufferInputStream input_stream(&buffer);
return io::CopyInputStreamToArchive(context_, &input_stream, kApkResourceTablePath,
ArchiveEntry::kAlign, writer);
} break;
@@ -1221,7 +1221,7 @@ class Linker {
}
std::string out_path;
- std::unique_ptr<io::FileOutputStream> fout;
+ std::unique_ptr<android::FileOutputStream> fout;
if (options_.generate_java_class_path) {
out_path = options_.generate_java_class_path.value();
file::AppendPath(&out_path, file::PackageToPath(out_package));
@@ -1233,7 +1233,7 @@ class Linker {
file::AppendPath(&out_path, "R.java");
- fout = util::make_unique<io::FileOutputStream>(out_path);
+ fout = util::make_unique<android::FileOutputStream>(out_path);
if (fout->HadError()) {
context_->GetDiagnostics()->Error(android::DiagMessage()
<< "failed writing to '" << out_path
@@ -1242,9 +1242,9 @@ class Linker {
}
}
- std::unique_ptr<io::FileOutputStream> fout_text;
+ std::unique_ptr<android::FileOutputStream> fout_text;
if (out_text_symbols_path) {
- fout_text = util::make_unique<io::FileOutputStream>(out_text_symbols_path.value());
+ fout_text = util::make_unique<android::FileOutputStream>(out_text_symbols_path.value());
if (fout_text->HadError()) {
context_->GetDiagnostics()->Error(android::DiagMessage()
<< "failed writing to '" << out_text_symbols_path.value()
@@ -1386,7 +1386,7 @@ class Linker {
file::AppendPath(&out_path, "Manifest.java");
- io::FileOutputStream fout(out_path);
+ android::FileOutputStream fout(out_path);
if (fout.HadError()) {
context_->GetDiagnostics()->Error(android::DiagMessage() << "failed to open '" << out_path
<< "': " << fout.GetError());
@@ -1412,7 +1412,7 @@ class Linker {
}
const std::string& out_path = out.value();
- io::FileOutputStream fout(out_path);
+ android::FileOutputStream fout(out_path);
if (fout.HadError()) {
context_->GetDiagnostics()->Error(android::DiagMessage() << "failed to open '" << out_path
<< "': " << fout.GetError());
@@ -1601,7 +1601,7 @@ class Linker {
}
}
- std::unique_ptr<io::InputStream> input_stream = file->OpenInputStream();
+ std::unique_ptr<android::InputStream> input_stream = file->OpenInputStream();
if (input_stream == nullptr) {
context_->GetDiagnostics()->Error(android::DiagMessage(src) << "failed to open file");
return false;
diff --git a/tools/aapt2/cmd/Optimize.cpp b/tools/aapt2/cmd/Optimize.cpp
index f045dad6d11a..762441ee1872 100644
--- a/tools/aapt2/cmd/Optimize.cpp
+++ b/tools/aapt2/cmd/Optimize.cpp
@@ -30,6 +30,7 @@
#include "ValueVisitor.h"
#include "android-base/file.h"
#include "android-base/stringprintf.h"
+#include "androidfw/BigBufferStream.h"
#include "androidfw/ConfigDescription.h"
#include "androidfw/IDiagnostics.h"
#include "androidfw/ResourceTypes.h"
@@ -39,7 +40,6 @@
#include "filter/AbiFilter.h"
#include "format/binary/TableFlattener.h"
#include "format/binary/XmlFlattener.h"
-#include "io/BigBufferStream.h"
#include "io/Util.h"
#include "optimize/MultiApkGenerator.h"
#include "optimize/Obfuscator.h"
@@ -249,7 +249,7 @@ class Optimizer {
return false;
}
- io::BigBufferInputStream manifest_buffer_in(&manifest_buffer);
+ android::BigBufferInputStream manifest_buffer_in(&manifest_buffer);
if (!io::CopyInputStreamToArchive(context_, &manifest_buffer_in, "AndroidManifest.xml",
ArchiveEntry::kCompress, writer)) {
return false;
@@ -297,7 +297,7 @@ class Optimizer {
return false;
}
- io::BigBufferInputStream table_buffer_in(&table_buffer);
+ android::BigBufferInputStream table_buffer_in(&table_buffer);
return io::CopyInputStreamToArchive(context_, &table_buffer_in, "resources.arsc",
ArchiveEntry::kAlign, writer);
}
diff --git a/tools/aapt2/compile/Image.h b/tools/aapt2/compile/Image.h
deleted file mode 100644
index db0b945e1f18..000000000000
--- a/tools/aapt2/compile/Image.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef AAPT_COMPILE_IMAGE_H
-#define AAPT_COMPILE_IMAGE_H
-
-#include <cstdint>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "android-base/macros.h"
-
-namespace aapt {
-
-/**
- * An in-memory image, loaded from disk, with pixels in RGBA_8888 format.
- */
-class Image {
- public:
- explicit Image() = default;
-
- /**
- * A `height` sized array of pointers, where each element points to a
- * `width` sized row of RGBA_8888 pixels.
- */
- std::unique_ptr<uint8_t* []> rows;
-
- /**
- * The width of the image in RGBA_8888 pixels. This is int32_t because of
- * 9-patch data
- * format limitations.
- */
- int32_t width = 0;
-
- /**
- * The height of the image in RGBA_8888 pixels. This is int32_t because of
- * 9-patch data
- * format limitations.
- */
- int32_t height = 0;
-
- /**
- * Buffer to the raw image data stored sequentially.
- * Use `rows` to access the data on a row-by-row basis.
- */
- std::unique_ptr<uint8_t[]> data;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Image);
-};
-
-/**
- * A range of pixel values, starting at 'start' and ending before 'end'
- * exclusive. Or rather [a, b).
- */
-struct Range {
- int32_t start = 0;
- int32_t end = 0;
-
- explicit Range() = default;
- inline explicit Range(int32_t s, int32_t e) : start(s), end(e) {}
-};
-
-inline bool operator==(const Range& left, const Range& right) {
- return left.start == right.start && left.end == right.end;
-}
-
-/**
- * Inset lengths from all edges of a rectangle. `left` and `top` are measured
- * from the left and top
- * edges, while `right` and `bottom` are measured from the right and bottom
- * edges, respectively.
- */
-struct Bounds {
- int32_t left = 0;
- int32_t top = 0;
- int32_t right = 0;
- int32_t bottom = 0;
-
- explicit Bounds() = default;
- inline explicit Bounds(int32_t l, int32_t t, int32_t r, int32_t b)
- : left(l), top(t), right(r), bottom(b) {}
-
- bool nonZero() const;
-};
-
-inline bool Bounds::nonZero() const {
- return left != 0 || top != 0 || right != 0 || bottom != 0;
-}
-
-inline bool operator==(const Bounds& left, const Bounds& right) {
- return left.left == right.left && left.top == right.top &&
- left.right == right.right && left.bottom == right.bottom;
-}
-
-/**
- * Contains 9-patch data from a source image. All measurements exclude the 1px
- * border of the
- * source 9-patch image.
- */
-class NinePatch {
- public:
- static std::unique_ptr<NinePatch> Create(uint8_t** rows, const int32_t width,
- const int32_t height,
- std::string* err_out);
-
- /**
- * Packs the RGBA_8888 data pointed to by pixel into a uint32_t
- * with format 0xAARRGGBB (the way 9-patch expects it).
- */
- static uint32_t PackRGBA(const uint8_t* pixel);
-
- /**
- * 9-patch content padding/insets. All positions are relative to the 9-patch
- * NOT including the 1px thick source border.
- */
- Bounds padding;
-
- /**
- * Optical layout bounds/insets. This overrides the padding for
- * layout purposes. All positions are relative to the 9-patch
- * NOT including the 1px thick source border.
- * See
- * https://developer.android.com/about/versions/android-4.3.html#OpticalBounds
- */
- Bounds layout_bounds;
-
- /**
- * Outline of the image, calculated based on opacity.
- */
- Bounds outline;
-
- /**
- * The computed radius of the outline. If non-zero, the outline is a
- * rounded-rect.
- */
- float outline_radius = 0.0f;
-
- /**
- * The largest alpha value within the outline.
- */
- uint32_t outline_alpha = 0x000000ffu;
-
- /**
- * Horizontal regions of the image that are stretchable.
- * All positions are relative to the 9-patch
- * NOT including the 1px thick source border.
- */
- std::vector<Range> horizontal_stretch_regions;
-
- /**
- * Vertical regions of the image that are stretchable.
- * All positions are relative to the 9-patch
- * NOT including the 1px thick source border.
- */
- std::vector<Range> vertical_stretch_regions;
-
- /**
- * The colors within each region, fixed or stretchable.
- * For w*h regions, the color of region (x,y) is addressable
- * via index y*w + x.
- */
- std::vector<uint32_t> region_colors;
-
- /**
- * Returns serialized data containing the original basic 9-patch meta data.
- * Optical layout bounds and round rect outline data must be serialized
- * separately using SerializeOpticalLayoutBounds() and
- * SerializeRoundedRectOutline().
- */
- std::unique_ptr<uint8_t[]> SerializeBase(size_t* out_len) const;
-
- /**
- * Serializes the layout bounds.
- */
- std::unique_ptr<uint8_t[]> SerializeLayoutBounds(size_t* out_len) const;
-
- /**
- * Serializes the rounded-rect outline.
- */
- std::unique_ptr<uint8_t[]> SerializeRoundedRectOutline(size_t* out_len) const;
-
- private:
- explicit NinePatch() = default;
-
- DISALLOW_COPY_AND_ASSIGN(NinePatch);
-};
-
-::std::ostream& operator<<(::std::ostream& out, const Range& range);
-::std::ostream& operator<<(::std::ostream& out, const Bounds& bounds);
-::std::ostream& operator<<(::std::ostream& out, const NinePatch& nine_patch);
-
-} // namespace aapt
-
-#endif /* AAPT_COMPILE_IMAGE_H */
diff --git a/tools/aapt2/compile/NinePatch.cpp b/tools/aapt2/compile/NinePatch.cpp
deleted file mode 100644
index 4538ecc56e4c..000000000000
--- a/tools/aapt2/compile/NinePatch.cpp
+++ /dev/null
@@ -1,698 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "compile/Image.h"
-
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "androidfw/ResourceTypes.h"
-#include "androidfw/StringPiece.h"
-
-#include "util/Util.h"
-
-using android::StringPiece;
-
-namespace aapt {
-
-// Colors in the format 0xAARRGGBB (the way 9-patch expects it).
-constexpr static const uint32_t kColorOpaqueWhite = 0xffffffffu;
-constexpr static const uint32_t kColorOpaqueBlack = 0xff000000u;
-constexpr static const uint32_t kColorOpaqueRed = 0xffff0000u;
-
-constexpr static const uint32_t kPrimaryColor = kColorOpaqueBlack;
-constexpr static const uint32_t kSecondaryColor = kColorOpaqueRed;
-
-/**
- * Returns the alpha value encoded in the 0xAARRGBB encoded pixel.
- */
-static uint32_t get_alpha(uint32_t color);
-
-/**
- * Determines whether a color on an ImageLine is valid.
- * A 9patch image may use a transparent color as neutral,
- * or a fully opaque white color as neutral, based on the
- * pixel color at (0,0) of the image. One or the other is fine,
- * but we need to ensure consistency throughout the image.
- */
-class ColorValidator {
- public:
- virtual ~ColorValidator() = default;
-
- /**
- * Returns true if the color specified is a neutral color
- * (no padding, stretching, or optical bounds).
- */
- virtual bool IsNeutralColor(uint32_t color) const = 0;
-
- /**
- * Returns true if the color is either a neutral color
- * or one denoting padding, stretching, or optical bounds.
- */
- bool IsValidColor(uint32_t color) const {
- switch (color) {
- case kPrimaryColor:
- case kSecondaryColor:
- return true;
- }
- return IsNeutralColor(color);
- }
-};
-
-// Walks an ImageLine and records Ranges of primary and secondary colors.
-// The primary color is black and is used to denote a padding or stretching
-// range,
-// depending on which border we're iterating over.
-// The secondary color is red and is used to denote optical bounds.
-//
-// An ImageLine is a templated-interface that would look something like this if
-// it
-// were polymorphic:
-//
-// class ImageLine {
-// public:
-// virtual int32_t GetLength() const = 0;
-// virtual uint32_t GetColor(int32_t idx) const = 0;
-// };
-//
-template <typename ImageLine>
-static bool FillRanges(const ImageLine* image_line,
- const ColorValidator* color_validator,
- std::vector<Range>* primary_ranges,
- std::vector<Range>* secondary_ranges,
- std::string* out_err) {
- const int32_t length = image_line->GetLength();
-
- uint32_t last_color = 0xffffffffu;
- for (int32_t idx = 1; idx < length - 1; idx++) {
- const uint32_t color = image_line->GetColor(idx);
- if (!color_validator->IsValidColor(color)) {
- *out_err = "found an invalid color";
- return false;
- }
-
- if (color != last_color) {
- // We are ending a range. Which range?
- // note: encode the x offset without the final 1 pixel border.
- if (last_color == kPrimaryColor) {
- primary_ranges->back().end = idx - 1;
- } else if (last_color == kSecondaryColor) {
- secondary_ranges->back().end = idx - 1;
- }
-
- // We are starting a range. Which range?
- // note: encode the x offset without the final 1 pixel border.
- if (color == kPrimaryColor) {
- primary_ranges->push_back(Range(idx - 1, length - 2));
- } else if (color == kSecondaryColor) {
- secondary_ranges->push_back(Range(idx - 1, length - 2));
- }
- last_color = color;
- }
- }
- return true;
-}
-
-/**
- * Iterates over a row in an image. Implements the templated ImageLine
- * interface.
- */
-class HorizontalImageLine {
- public:
- explicit HorizontalImageLine(uint8_t** rows, int32_t xoffset, int32_t yoffset,
- int32_t length)
- : rows_(rows), xoffset_(xoffset), yoffset_(yoffset), length_(length) {}
-
- inline int32_t GetLength() const { return length_; }
-
- inline uint32_t GetColor(int32_t idx) const {
- return NinePatch::PackRGBA(rows_[yoffset_] + (idx + xoffset_) * 4);
- }
-
- private:
- uint8_t** rows_;
- int32_t xoffset_, yoffset_, length_;
-
- DISALLOW_COPY_AND_ASSIGN(HorizontalImageLine);
-};
-
-/**
- * Iterates over a column in an image. Implements the templated ImageLine
- * interface.
- */
-class VerticalImageLine {
- public:
- explicit VerticalImageLine(uint8_t** rows, int32_t xoffset, int32_t yoffset,
- int32_t length)
- : rows_(rows), xoffset_(xoffset), yoffset_(yoffset), length_(length) {}
-
- inline int32_t GetLength() const { return length_; }
-
- inline uint32_t GetColor(int32_t idx) const {
- return NinePatch::PackRGBA(rows_[yoffset_ + idx] + (xoffset_ * 4));
- }
-
- private:
- uint8_t** rows_;
- int32_t xoffset_, yoffset_, length_;
-
- DISALLOW_COPY_AND_ASSIGN(VerticalImageLine);
-};
-
-class DiagonalImageLine {
- public:
- explicit DiagonalImageLine(uint8_t** rows, int32_t xoffset, int32_t yoffset,
- int32_t xstep, int32_t ystep, int32_t length)
- : rows_(rows),
- xoffset_(xoffset),
- yoffset_(yoffset),
- xstep_(xstep),
- ystep_(ystep),
- length_(length) {}
-
- inline int32_t GetLength() const { return length_; }
-
- inline uint32_t GetColor(int32_t idx) const {
- return NinePatch::PackRGBA(rows_[yoffset_ + (idx * ystep_)] +
- ((idx + xoffset_) * xstep_) * 4);
- }
-
- private:
- uint8_t** rows_;
- int32_t xoffset_, yoffset_, xstep_, ystep_, length_;
-
- DISALLOW_COPY_AND_ASSIGN(DiagonalImageLine);
-};
-
-class TransparentNeutralColorValidator : public ColorValidator {
- public:
- bool IsNeutralColor(uint32_t color) const override {
- return get_alpha(color) == 0;
- }
-};
-
-class WhiteNeutralColorValidator : public ColorValidator {
- public:
- bool IsNeutralColor(uint32_t color) const override {
- return color == kColorOpaqueWhite;
- }
-};
-
-inline static uint32_t get_alpha(uint32_t color) {
- return (color & 0xff000000u) >> 24;
-}
-
-static bool PopulateBounds(const std::vector<Range>& padding,
- const std::vector<Range>& layout_bounds,
- const std::vector<Range>& stretch_regions, const int32_t length,
- int32_t* padding_start, int32_t* padding_end, int32_t* layout_start,
- int32_t* layout_end, StringPiece edge_name, std::string* out_err) {
- if (padding.size() > 1) {
- std::stringstream err_stream;
- err_stream << "too many padding sections on " << edge_name << " border";
- *out_err = err_stream.str();
- return false;
- }
-
- *padding_start = 0;
- *padding_end = 0;
- if (!padding.empty()) {
- const Range& range = padding.front();
- *padding_start = range.start;
- *padding_end = length - range.end;
- } else if (!stretch_regions.empty()) {
- // No padding was defined. Compute the padding from the first and last
- // stretch regions.
- *padding_start = stretch_regions.front().start;
- *padding_end = length - stretch_regions.back().end;
- }
-
- if (layout_bounds.size() > 2) {
- std::stringstream err_stream;
- err_stream << "too many layout bounds sections on " << edge_name
- << " border";
- *out_err = err_stream.str();
- return false;
- }
-
- *layout_start = 0;
- *layout_end = 0;
- if (layout_bounds.size() >= 1) {
- const Range& range = layout_bounds.front();
- // If there is only one layout bound segment, it might not start at 0, but
- // then it should
- // end at length.
- if (range.start != 0 && range.end != length) {
- std::stringstream err_stream;
- err_stream << "layout bounds on " << edge_name
- << " border must start at edge";
- *out_err = err_stream.str();
- return false;
- }
- *layout_start = range.end;
-
- if (layout_bounds.size() >= 2) {
- const Range& range = layout_bounds.back();
- if (range.end != length) {
- std::stringstream err_stream;
- err_stream << "layout bounds on " << edge_name
- << " border must start at edge";
- *out_err = err_stream.str();
- return false;
- }
- *layout_end = length - range.start;
- }
- }
- return true;
-}
-
-static int32_t CalculateSegmentCount(const std::vector<Range>& stretch_regions,
- int32_t length) {
- if (stretch_regions.size() == 0) {
- return 0;
- }
-
- const bool start_is_fixed = stretch_regions.front().start != 0;
- const bool end_is_fixed = stretch_regions.back().end != length;
- int32_t modifier = 0;
- if (start_is_fixed && end_is_fixed) {
- modifier = 1;
- } else if (!start_is_fixed && !end_is_fixed) {
- modifier = -1;
- }
- return static_cast<int32_t>(stretch_regions.size()) * 2 + modifier;
-}
-
-static uint32_t GetRegionColor(uint8_t** rows, const Bounds& region) {
- // Sample the first pixel to compare against.
- const uint32_t expected_color =
- NinePatch::PackRGBA(rows[region.top] + region.left * 4);
- for (int32_t y = region.top; y < region.bottom; y++) {
- const uint8_t* row = rows[y];
- for (int32_t x = region.left; x < region.right; x++) {
- const uint32_t color = NinePatch::PackRGBA(row + x * 4);
- if (get_alpha(color) == 0) {
- // The color is transparent.
- // If the expectedColor is not transparent, NO_COLOR.
- if (get_alpha(expected_color) != 0) {
- return android::Res_png_9patch::NO_COLOR;
- }
- } else if (color != expected_color) {
- return android::Res_png_9patch::NO_COLOR;
- }
- }
- }
-
- if (get_alpha(expected_color) == 0) {
- return android::Res_png_9patch::TRANSPARENT_COLOR;
- }
- return expected_color;
-}
-
-// Fills out_colors with each 9-patch section's color. If the whole section is
-// transparent,
-// it gets the special TRANSPARENT color. If the whole section is the same
-// color, it is assigned
-// that color. Otherwise it gets the special NO_COLOR color.
-//
-// Note that the rows contain the 9-patch 1px border, and the indices in the
-// stretch regions are
-// already offset to exclude the border. This means that each time the rows are
-// accessed,
-// the indices must be offset by 1.
-//
-// width and height also include the 9-patch 1px border.
-static void CalculateRegionColors(
- uint8_t** rows, const std::vector<Range>& horizontal_stretch_regions,
- const std::vector<Range>& vertical_stretch_regions, const int32_t width,
- const int32_t height, std::vector<uint32_t>* out_colors) {
- int32_t next_top = 0;
- Bounds bounds;
- auto row_iter = vertical_stretch_regions.begin();
- while (next_top != height) {
- if (row_iter != vertical_stretch_regions.end()) {
- if (next_top != row_iter->start) {
- // This is a fixed segment.
- // Offset the bounds by 1 to accommodate the border.
- bounds.top = next_top + 1;
- bounds.bottom = row_iter->start + 1;
- next_top = row_iter->start;
- } else {
- // This is a stretchy segment.
- // Offset the bounds by 1 to accommodate the border.
- bounds.top = row_iter->start + 1;
- bounds.bottom = row_iter->end + 1;
- next_top = row_iter->end;
- ++row_iter;
- }
- } else {
- // This is the end, fixed section.
- // Offset the bounds by 1 to accommodate the border.
- bounds.top = next_top + 1;
- bounds.bottom = height + 1;
- next_top = height;
- }
-
- int32_t next_left = 0;
- auto col_iter = horizontal_stretch_regions.begin();
- while (next_left != width) {
- if (col_iter != horizontal_stretch_regions.end()) {
- if (next_left != col_iter->start) {
- // This is a fixed segment.
- // Offset the bounds by 1 to accommodate the border.
- bounds.left = next_left + 1;
- bounds.right = col_iter->start + 1;
- next_left = col_iter->start;
- } else {
- // This is a stretchy segment.
- // Offset the bounds by 1 to accommodate the border.
- bounds.left = col_iter->start + 1;
- bounds.right = col_iter->end + 1;
- next_left = col_iter->end;
- ++col_iter;
- }
- } else {
- // This is the end, fixed section.
- // Offset the bounds by 1 to accommodate the border.
- bounds.left = next_left + 1;
- bounds.right = width + 1;
- next_left = width;
- }
- out_colors->push_back(GetRegionColor(rows, bounds));
- }
- }
-}
-
-// Calculates the insets of a row/column of pixels based on where the largest
-// alpha value begins
-// (on both sides).
-template <typename ImageLine>
-static void FindOutlineInsets(const ImageLine* image_line, int32_t* out_start,
- int32_t* out_end) {
- *out_start = 0;
- *out_end = 0;
-
- const int32_t length = image_line->GetLength();
- if (length < 3) {
- return;
- }
-
- // If the length is odd, we want both sides to process the center pixel,
- // so we use two different midpoints (to account for < and <= in the different
- // loops).
- const int32_t mid2 = length / 2;
- const int32_t mid1 = mid2 + (length % 2);
-
- uint32_t max_alpha = 0;
- for (int32_t i = 0; i < mid1 && max_alpha != 0xff; i++) {
- uint32_t alpha = get_alpha(image_line->GetColor(i));
- if (alpha > max_alpha) {
- max_alpha = alpha;
- *out_start = i;
- }
- }
-
- max_alpha = 0;
- for (int32_t i = length - 1; i >= mid2 && max_alpha != 0xff; i--) {
- uint32_t alpha = get_alpha(image_line->GetColor(i));
- if (alpha > max_alpha) {
- max_alpha = alpha;
- *out_end = length - (i + 1);
- }
- }
- return;
-}
-
-template <typename ImageLine>
-static uint32_t FindMaxAlpha(const ImageLine* image_line) {
- const int32_t length = image_line->GetLength();
- uint32_t max_alpha = 0;
- for (int32_t idx = 0; idx < length && max_alpha != 0xff; idx++) {
- uint32_t alpha = get_alpha(image_line->GetColor(idx));
- if (alpha > max_alpha) {
- max_alpha = alpha;
- }
- }
- return max_alpha;
-}
-
-// Pack the pixels in as 0xAARRGGBB (as 9-patch expects it).
-uint32_t NinePatch::PackRGBA(const uint8_t* pixel) {
- return (pixel[3] << 24) | (pixel[0] << 16) | (pixel[1] << 8) | pixel[2];
-}
-
-std::unique_ptr<NinePatch> NinePatch::Create(uint8_t** rows,
- const int32_t width,
- const int32_t height,
- std::string* out_err) {
- if (width < 3 || height < 3) {
- *out_err = "image must be at least 3x3 (1x1 image with 1 pixel border)";
- return {};
- }
-
- std::vector<Range> horizontal_padding;
- std::vector<Range> horizontal_layout_bounds;
- std::vector<Range> vertical_padding;
- std::vector<Range> vertical_layout_bounds;
- std::vector<Range> unexpected_ranges;
- std::unique_ptr<ColorValidator> color_validator;
-
- if (rows[0][3] == 0) {
- color_validator = util::make_unique<TransparentNeutralColorValidator>();
- } else if (PackRGBA(rows[0]) == kColorOpaqueWhite) {
- color_validator = util::make_unique<WhiteNeutralColorValidator>();
- } else {
- *out_err =
- "top-left corner pixel must be either opaque white or transparent";
- return {};
- }
-
- // Private constructor, can't use make_unique.
- auto nine_patch = std::unique_ptr<NinePatch>(new NinePatch());
-
- HorizontalImageLine top_row(rows, 0, 0, width);
- if (!FillRanges(&top_row, color_validator.get(),
- &nine_patch->horizontal_stretch_regions, &unexpected_ranges,
- out_err)) {
- return {};
- }
-
- if (!unexpected_ranges.empty()) {
- const Range& range = unexpected_ranges[0];
- std::stringstream err_stream;
- err_stream << "found unexpected optical bounds (red pixel) on top border "
- << "at x=" << range.start + 1;
- *out_err = err_stream.str();
- return {};
- }
-
- VerticalImageLine left_col(rows, 0, 0, height);
- if (!FillRanges(&left_col, color_validator.get(),
- &nine_patch->vertical_stretch_regions, &unexpected_ranges,
- out_err)) {
- return {};
- }
-
- if (!unexpected_ranges.empty()) {
- const Range& range = unexpected_ranges[0];
- std::stringstream err_stream;
- err_stream << "found unexpected optical bounds (red pixel) on left border "
- << "at y=" << range.start + 1;
- return {};
- }
-
- HorizontalImageLine bottom_row(rows, 0, height - 1, width);
- if (!FillRanges(&bottom_row, color_validator.get(), &horizontal_padding,
- &horizontal_layout_bounds, out_err)) {
- return {};
- }
-
- if (!PopulateBounds(horizontal_padding, horizontal_layout_bounds,
- nine_patch->horizontal_stretch_regions, width - 2,
- &nine_patch->padding.left, &nine_patch->padding.right,
- &nine_patch->layout_bounds.left,
- &nine_patch->layout_bounds.right, "bottom", out_err)) {
- return {};
- }
-
- VerticalImageLine right_col(rows, width - 1, 0, height);
- if (!FillRanges(&right_col, color_validator.get(), &vertical_padding,
- &vertical_layout_bounds, out_err)) {
- return {};
- }
-
- if (!PopulateBounds(vertical_padding, vertical_layout_bounds,
- nine_patch->vertical_stretch_regions, height - 2,
- &nine_patch->padding.top, &nine_patch->padding.bottom,
- &nine_patch->layout_bounds.top,
- &nine_patch->layout_bounds.bottom, "right", out_err)) {
- return {};
- }
-
- // Fill the region colors of the 9-patch.
- const int32_t num_rows =
- CalculateSegmentCount(nine_patch->horizontal_stretch_regions, width - 2);
- const int32_t num_cols =
- CalculateSegmentCount(nine_patch->vertical_stretch_regions, height - 2);
- if ((int64_t)num_rows * (int64_t)num_cols > 0x7f) {
- *out_err = "too many regions in 9-patch";
- return {};
- }
-
- nine_patch->region_colors.reserve(num_rows * num_cols);
- CalculateRegionColors(rows, nine_patch->horizontal_stretch_regions,
- nine_patch->vertical_stretch_regions, width - 2,
- height - 2, &nine_patch->region_colors);
-
- // Compute the outline based on opacity.
-
- // Find left and right extent of 9-patch content on center row.
- HorizontalImageLine mid_row(rows, 1, height / 2, width - 2);
- FindOutlineInsets(&mid_row, &nine_patch->outline.left,
- &nine_patch->outline.right);
-
- // Find top and bottom extent of 9-patch content on center column.
- VerticalImageLine mid_col(rows, width / 2, 1, height - 2);
- FindOutlineInsets(&mid_col, &nine_patch->outline.top,
- &nine_patch->outline.bottom);
-
- const int32_t outline_width =
- (width - 2) - nine_patch->outline.left - nine_patch->outline.right;
- const int32_t outline_height =
- (height - 2) - nine_patch->outline.top - nine_patch->outline.bottom;
-
- // Find the largest alpha value within the outline area.
- HorizontalImageLine outline_mid_row(
- rows, 1 + nine_patch->outline.left,
- 1 + nine_patch->outline.top + (outline_height / 2), outline_width);
- VerticalImageLine outline_mid_col(
- rows, 1 + nine_patch->outline.left + (outline_width / 2),
- 1 + nine_patch->outline.top, outline_height);
- nine_patch->outline_alpha =
- std::max(FindMaxAlpha(&outline_mid_row), FindMaxAlpha(&outline_mid_col));
-
- // Assuming the image is a round rect, compute the radius by marching
- // diagonally from the top left corner towards the center.
- DiagonalImageLine diagonal(rows, 1 + nine_patch->outline.left,
- 1 + nine_patch->outline.top, 1, 1,
- std::min(outline_width, outline_height));
- int32_t top_left, bottom_right;
- FindOutlineInsets(&diagonal, &top_left, &bottom_right);
-
- /* Determine source radius based upon inset:
- * sqrt(r^2 + r^2) = sqrt(i^2 + i^2) + r
- * sqrt(2) * r = sqrt(2) * i + r
- * (sqrt(2) - 1) * r = sqrt(2) * i
- * r = sqrt(2) / (sqrt(2) - 1) * i
- */
- nine_patch->outline_radius = 3.4142f * top_left;
- return nine_patch;
-}
-
-std::unique_ptr<uint8_t[]> NinePatch::SerializeBase(size_t* outLen) const {
- android::Res_png_9patch data;
- data.numXDivs = static_cast<uint8_t>(horizontal_stretch_regions.size()) * 2;
- data.numYDivs = static_cast<uint8_t>(vertical_stretch_regions.size()) * 2;
- data.numColors = static_cast<uint8_t>(region_colors.size());
- data.paddingLeft = padding.left;
- data.paddingRight = padding.right;
- data.paddingTop = padding.top;
- data.paddingBottom = padding.bottom;
-
- auto buffer = std::unique_ptr<uint8_t[]>(new uint8_t[data.serializedSize()]);
- android::Res_png_9patch::serialize(
- data, (const int32_t*)horizontal_stretch_regions.data(),
- (const int32_t*)vertical_stretch_regions.data(), region_colors.data(),
- buffer.get());
- // Convert to file endianness.
- reinterpret_cast<android::Res_png_9patch*>(buffer.get())->deviceToFile();
-
- *outLen = data.serializedSize();
- return buffer;
-}
-
-std::unique_ptr<uint8_t[]> NinePatch::SerializeLayoutBounds(
- size_t* out_len) const {
- size_t chunk_len = sizeof(uint32_t) * 4;
- auto buffer = std::unique_ptr<uint8_t[]>(new uint8_t[chunk_len]);
- uint8_t* cursor = buffer.get();
-
- memcpy(cursor, &layout_bounds.left, sizeof(layout_bounds.left));
- cursor += sizeof(layout_bounds.left);
-
- memcpy(cursor, &layout_bounds.top, sizeof(layout_bounds.top));
- cursor += sizeof(layout_bounds.top);
-
- memcpy(cursor, &layout_bounds.right, sizeof(layout_bounds.right));
- cursor += sizeof(layout_bounds.right);
-
- memcpy(cursor, &layout_bounds.bottom, sizeof(layout_bounds.bottom));
- cursor += sizeof(layout_bounds.bottom);
-
- *out_len = chunk_len;
- return buffer;
-}
-
-std::unique_ptr<uint8_t[]> NinePatch::SerializeRoundedRectOutline(
- size_t* out_len) const {
- size_t chunk_len = sizeof(uint32_t) * 6;
- auto buffer = std::unique_ptr<uint8_t[]>(new uint8_t[chunk_len]);
- uint8_t* cursor = buffer.get();
-
- memcpy(cursor, &outline.left, sizeof(outline.left));
- cursor += sizeof(outline.left);
-
- memcpy(cursor, &outline.top, sizeof(outline.top));
- cursor += sizeof(outline.top);
-
- memcpy(cursor, &outline.right, sizeof(outline.right));
- cursor += sizeof(outline.right);
-
- memcpy(cursor, &outline.bottom, sizeof(outline.bottom));
- cursor += sizeof(outline.bottom);
-
- *((float*)cursor) = outline_radius;
- cursor += sizeof(outline_radius);
-
- *((uint32_t*)cursor) = outline_alpha;
-
- *out_len = chunk_len;
- return buffer;
-}
-
-::std::ostream& operator<<(::std::ostream& out, const Range& range) {
- return out << "[" << range.start << ", " << range.end << ")";
-}
-
-::std::ostream& operator<<(::std::ostream& out, const Bounds& bounds) {
- return out << "l=" << bounds.left << " t=" << bounds.top
- << " r=" << bounds.right << " b=" << bounds.bottom;
-}
-
-::std::ostream& operator<<(::std::ostream& out, const NinePatch& nine_patch) {
- return out << "horizontalStretch:"
- << util::Joiner(nine_patch.horizontal_stretch_regions, " ")
- << " verticalStretch:"
- << util::Joiner(nine_patch.vertical_stretch_regions, " ")
- << " padding: " << nine_patch.padding
- << ", bounds: " << nine_patch.layout_bounds
- << ", outline: " << nine_patch.outline
- << " rad=" << nine_patch.outline_radius
- << " alpha=" << nine_patch.outline_alpha;
-}
-
-} // namespace aapt
diff --git a/tools/aapt2/compile/NinePatch_test.cpp b/tools/aapt2/compile/NinePatch_test.cpp
deleted file mode 100644
index f54bb2e62842..000000000000
--- a/tools/aapt2/compile/NinePatch_test.cpp
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "compile/Image.h"
-
-#include "test/Test.h"
-
-namespace aapt {
-
-// Pixels are in RGBA_8888 packing.
-
-#define RED "\xff\x00\x00\xff"
-#define BLUE "\x00\x00\xff\xff"
-#define GREEN "\xff\x00\x00\xff"
-#define GR_70 "\xff\x00\x00\xb3"
-#define GR_50 "\xff\x00\x00\x80"
-#define GR_20 "\xff\x00\x00\x33"
-#define BLACK "\x00\x00\x00\xff"
-#define WHITE "\xff\xff\xff\xff"
-#define TRANS "\x00\x00\x00\x00"
-
-static uint8_t* k2x2[] = {
- (uint8_t*)WHITE WHITE, (uint8_t*)WHITE WHITE,
-};
-
-static uint8_t* kMixedNeutralColor3x3[] = {
- (uint8_t*)WHITE BLACK TRANS, (uint8_t*)TRANS RED TRANS,
- (uint8_t*)WHITE WHITE WHITE,
-};
-
-static uint8_t* kTransparentNeutralColor3x3[] = {
- (uint8_t*)TRANS BLACK TRANS, (uint8_t*)BLACK RED BLACK,
- (uint8_t*)TRANS BLACK TRANS,
-};
-
-static uint8_t* kSingleStretch7x6[] = {
- (uint8_t*)WHITE WHITE BLACK BLACK BLACK WHITE WHITE,
- (uint8_t*)WHITE RED RED RED RED RED WHITE,
- (uint8_t*)BLACK RED RED RED RED RED WHITE,
- (uint8_t*)BLACK RED RED RED RED RED WHITE,
- (uint8_t*)WHITE RED RED RED RED RED WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kMultipleStretch10x7[] = {
- (uint8_t*)WHITE WHITE BLACK WHITE BLACK BLACK WHITE BLACK WHITE WHITE,
- (uint8_t*)BLACK RED BLUE RED BLUE BLUE RED BLUE RED WHITE,
- (uint8_t*)BLACK RED BLUE RED BLUE BLUE RED BLUE RED WHITE,
- (uint8_t*)WHITE RED BLUE RED BLUE BLUE RED BLUE RED WHITE,
- (uint8_t*)BLACK RED BLUE RED BLUE BLUE RED BLUE RED WHITE,
- (uint8_t*)BLACK RED BLUE RED BLUE BLUE RED BLUE RED WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kPadding6x5[] = {
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE BLACK,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE BLACK BLACK WHITE WHITE,
-};
-
-static uint8_t* kLayoutBoundsWrongEdge3x3[] = {
- (uint8_t*)WHITE RED WHITE, (uint8_t*)RED WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE,
-};
-
-static uint8_t* kLayoutBoundsNotEdgeAligned5x5[] = {
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE RED,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE RED WHITE WHITE,
-};
-
-static uint8_t* kLayoutBounds5x5[] = {
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE RED,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE RED,
- (uint8_t*)WHITE RED WHITE RED WHITE,
-};
-
-static uint8_t* kAsymmetricLayoutBounds5x5[] = {
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE RED,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE RED WHITE WHITE WHITE,
-};
-
-static uint8_t* kPaddingAndLayoutBounds5x5[] = {
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE RED,
- (uint8_t*)WHITE WHITE WHITE WHITE BLACK,
- (uint8_t*)WHITE WHITE WHITE WHITE RED,
- (uint8_t*)WHITE RED BLACK RED WHITE,
-};
-
-static uint8_t* kColorfulImage5x5[] = {
- (uint8_t*)WHITE BLACK WHITE BLACK WHITE,
- (uint8_t*)BLACK RED BLUE GREEN WHITE,
- (uint8_t*)BLACK RED GREEN GREEN WHITE,
- (uint8_t*)WHITE TRANS BLUE GREEN WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kOutlineOpaque10x10[] = {
- (uint8_t*)WHITE BLACK BLACK BLACK BLACK BLACK BLACK BLACK BLACK WHITE,
- (uint8_t*)WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GREEN GREEN GREEN GREEN TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GREEN GREEN GREEN GREEN TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GREEN GREEN GREEN GREEN TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GREEN GREEN GREEN GREEN TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kOutlineTranslucent10x10[] = {
- (uint8_t*)WHITE BLACK BLACK BLACK BLACK BLACK BLACK BLACK BLACK WHITE,
- (uint8_t*)WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GR_20 GR_20 GR_20 GR_20 TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GR_50 GR_50 GR_50 GR_50 TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS GR_20 GR_50 GR_70 GR_70 GR_50 GR_20 TRANS WHITE,
- (uint8_t*)WHITE TRANS GR_20 GR_50 GR_70 GR_70 GR_50 GR_20 TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GR_50 GR_50 GR_50 GR_50 TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS GR_20 GR_20 GR_20 GR_20 TRANS TRANS WHITE,
- (uint8_t*)WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kOutlineOffsetTranslucent12x10[] = {
- (uint8_t*)
- WHITE WHITE WHITE BLACK BLACK BLACK BLACK BLACK BLACK BLACK BLACK WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS TRANS GR_20 GR_20 GR_20 GR_20 TRANS TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS TRANS GR_50 GR_50 GR_50 GR_50 TRANS TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS GR_20 GR_50 GR_70 GR_70 GR_50 GR_20 TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS GR_20 GR_50 GR_70 GR_70 GR_50 GR_20 TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS TRANS GR_50 GR_50 GR_50 GR_50 TRANS TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS TRANS GR_20 GR_20 GR_20 GR_20 TRANS TRANS WHITE,
- (uint8_t*)
- WHITE TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS TRANS WHITE,
- (uint8_t*)
- WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kOutlineRadius5x5[] = {
- (uint8_t*)WHITE BLACK BLACK BLACK WHITE,
- (uint8_t*)BLACK TRANS GREEN TRANS WHITE,
- (uint8_t*)BLACK GREEN GREEN GREEN WHITE,
- (uint8_t*)BLACK TRANS GREEN TRANS WHITE,
- (uint8_t*)WHITE WHITE WHITE WHITE WHITE,
-};
-
-static uint8_t* kStretchAndPadding5x5[] = {
- (uint8_t*)WHITE WHITE BLACK WHITE WHITE, (uint8_t*)WHITE RED RED RED WHITE,
- (uint8_t*)BLACK RED RED RED BLACK, (uint8_t*)WHITE RED RED RED WHITE,
- (uint8_t*)WHITE WHITE BLACK WHITE WHITE,
-};
-
-TEST(NinePatchTest, Minimum3x3) {
- std::string err;
- EXPECT_EQ(nullptr, NinePatch::Create(k2x2, 2, 2, &err));
- EXPECT_FALSE(err.empty());
-}
-
-TEST(NinePatchTest, MixedNeutralColors) {
- std::string err;
- EXPECT_EQ(nullptr, NinePatch::Create(kMixedNeutralColor3x3, 3, 3, &err));
- EXPECT_FALSE(err.empty());
-}
-
-TEST(NinePatchTest, TransparentNeutralColor) {
- std::string err;
- EXPECT_NE(nullptr,
- NinePatch::Create(kTransparentNeutralColor3x3, 3, 3, &err));
-}
-
-TEST(NinePatchTest, SingleStretchRegion) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kSingleStretch7x6, 7, 6, &err);
- ASSERT_NE(nullptr, nine_patch);
-
- ASSERT_EQ(1u, nine_patch->horizontal_stretch_regions.size());
- ASSERT_EQ(1u, nine_patch->vertical_stretch_regions.size());
-
- EXPECT_EQ(Range(1, 4), nine_patch->horizontal_stretch_regions.front());
- EXPECT_EQ(Range(1, 3), nine_patch->vertical_stretch_regions.front());
-}
-
-TEST(NinePatchTest, MultipleStretchRegions) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kMultipleStretch10x7, 10, 7, &err);
- ASSERT_NE(nullptr, nine_patch);
-
- ASSERT_EQ(3u, nine_patch->horizontal_stretch_regions.size());
- ASSERT_EQ(2u, nine_patch->vertical_stretch_regions.size());
-
- EXPECT_EQ(Range(1, 2), nine_patch->horizontal_stretch_regions[0]);
- EXPECT_EQ(Range(3, 5), nine_patch->horizontal_stretch_regions[1]);
- EXPECT_EQ(Range(6, 7), nine_patch->horizontal_stretch_regions[2]);
-
- EXPECT_EQ(Range(0, 2), nine_patch->vertical_stretch_regions[0]);
- EXPECT_EQ(Range(3, 5), nine_patch->vertical_stretch_regions[1]);
-}
-
-TEST(NinePatchTest, InferPaddingFromStretchRegions) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kMultipleStretch10x7, 10, 7, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(1, 0, 1, 0), nine_patch->padding);
-}
-
-TEST(NinePatchTest, Padding) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kPadding6x5, 6, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(1, 1, 1, 1), nine_patch->padding);
-}
-
-TEST(NinePatchTest, LayoutBoundsAreOnWrongEdge) {
- std::string err;
- EXPECT_EQ(nullptr, NinePatch::Create(kLayoutBoundsWrongEdge3x3, 3, 3, &err));
- EXPECT_FALSE(err.empty());
-}
-
-TEST(NinePatchTest, LayoutBoundsMustTouchEdges) {
- std::string err;
- EXPECT_EQ(nullptr,
- NinePatch::Create(kLayoutBoundsNotEdgeAligned5x5, 5, 5, &err));
- EXPECT_FALSE(err.empty());
-}
-
-TEST(NinePatchTest, LayoutBounds) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kLayoutBounds5x5, 5, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(1, 1, 1, 1), nine_patch->layout_bounds);
-
- nine_patch = NinePatch::Create(kAsymmetricLayoutBounds5x5, 5, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(1, 1, 0, 0), nine_patch->layout_bounds);
-}
-
-TEST(NinePatchTest, PaddingAndLayoutBounds) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kPaddingAndLayoutBounds5x5, 5, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(1, 1, 1, 1), nine_patch->padding);
- EXPECT_EQ(Bounds(1, 1, 1, 1), nine_patch->layout_bounds);
-}
-
-TEST(NinePatchTest, RegionColorsAreCorrect) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kColorfulImage5x5, 5, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
-
- std::vector<uint32_t> expected_colors = {
- NinePatch::PackRGBA((uint8_t*)RED),
- (uint32_t)android::Res_png_9patch::NO_COLOR,
- NinePatch::PackRGBA((uint8_t*)GREEN),
- (uint32_t)android::Res_png_9patch::TRANSPARENT_COLOR,
- NinePatch::PackRGBA((uint8_t*)BLUE),
- NinePatch::PackRGBA((uint8_t*)GREEN),
- };
- EXPECT_EQ(expected_colors, nine_patch->region_colors);
-}
-
-TEST(NinePatchTest, OutlineFromOpaqueImage) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kOutlineOpaque10x10, 10, 10, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(2, 2, 2, 2), nine_patch->outline);
- EXPECT_EQ(0x000000ffu, nine_patch->outline_alpha);
- EXPECT_EQ(0.0f, nine_patch->outline_radius);
-}
-
-TEST(NinePatchTest, OutlineFromTranslucentImage) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kOutlineTranslucent10x10, 10, 10, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(3, 3, 3, 3), nine_patch->outline);
- EXPECT_EQ(0x000000b3u, nine_patch->outline_alpha);
- EXPECT_EQ(0.0f, nine_patch->outline_radius);
-}
-
-TEST(NinePatchTest, OutlineFromOffCenterImage) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kOutlineOffsetTranslucent12x10, 12, 10, &err);
- ASSERT_NE(nullptr, nine_patch);
-
- // TODO(adamlesinski): The old AAPT algorithm searches from the outside to the
- // middle for each inset. If the outline is shifted, the search may not find a
- // closer bounds.
- // This check should be:
- // EXPECT_EQ(Bounds(5, 3, 3, 3), ninePatch->outline);
- // but until I know what behavior I'm breaking, I will leave it at the
- // incorrect:
- EXPECT_EQ(Bounds(4, 3, 3, 3), nine_patch->outline);
-
- EXPECT_EQ(0x000000b3u, nine_patch->outline_alpha);
- EXPECT_EQ(0.0f, nine_patch->outline_radius);
-}
-
-TEST(NinePatchTest, OutlineRadius) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kOutlineRadius5x5, 5, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
- EXPECT_EQ(Bounds(0, 0, 0, 0), nine_patch->outline);
- EXPECT_EQ(3.4142f, nine_patch->outline_radius);
-}
-
-::testing::AssertionResult BigEndianOne(uint8_t* cursor) {
- if (cursor[0] == 0 && cursor[1] == 0 && cursor[2] == 0 && cursor[3] == 1) {
- return ::testing::AssertionSuccess();
- }
- return ::testing::AssertionFailure() << "Not BigEndian 1";
-}
-
-TEST(NinePatchTest, SerializePngEndianness) {
- std::string err;
- std::unique_ptr<NinePatch> nine_patch =
- NinePatch::Create(kStretchAndPadding5x5, 5, 5, &err);
- ASSERT_NE(nullptr, nine_patch);
-
- size_t len;
- std::unique_ptr<uint8_t[]> data = nine_patch->SerializeBase(&len);
- ASSERT_NE(nullptr, data);
- ASSERT_NE(0u, len);
-
- // Skip past wasDeserialized + numXDivs + numYDivs + numColors + xDivsOffset +
- // yDivsOffset
- // (12 bytes)
- uint8_t* cursor = data.get() + 12;
-
- // Check that padding is big-endian. Expecting value 1.
- EXPECT_TRUE(BigEndianOne(cursor));
- EXPECT_TRUE(BigEndianOne(cursor + 4));
- EXPECT_TRUE(BigEndianOne(cursor + 8));
- EXPECT_TRUE(BigEndianOne(cursor + 12));
-}
-
-} // namespace aapt
diff --git a/tools/aapt2/compile/Png.cpp b/tools/aapt2/compile/Png.cpp
deleted file mode 100644
index 76db815129dd..000000000000
--- a/tools/aapt2/compile/Png.cpp
+++ /dev/null
@@ -1,1319 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Png.h"
-
-#include <png.h>
-#include <zlib.h>
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "androidfw/BigBuffer.h"
-#include "androidfw/ResourceTypes.h"
-#include "androidfw/Source.h"
-#include "trace/TraceBuffer.h"
-#include "util/Util.h"
-
-namespace aapt {
-
-constexpr bool kDebug = false;
-
-struct PngInfo {
- ~PngInfo() {
- for (png_bytep row : rows) {
- if (row != nullptr) {
- delete[] row;
- }
- }
-
- delete[] xDivs;
- delete[] yDivs;
- }
-
- void* serialize9Patch() {
- void* serialized = android::Res_png_9patch::serialize(info9Patch, xDivs,
- yDivs, colors.data());
- reinterpret_cast<android::Res_png_9patch*>(serialized)->deviceToFile();
- return serialized;
- }
-
- uint32_t width = 0;
- uint32_t height = 0;
- std::vector<png_bytep> rows;
-
- bool is9Patch = false;
- android::Res_png_9patch info9Patch;
- int32_t* xDivs = nullptr;
- int32_t* yDivs = nullptr;
- std::vector<uint32_t> colors;
-
- // Layout padding.
- bool haveLayoutBounds = false;
- int32_t layoutBoundsLeft;
- int32_t layoutBoundsTop;
- int32_t layoutBoundsRight;
- int32_t layoutBoundsBottom;
-
- // Round rect outline description.
- int32_t outlineInsetsLeft;
- int32_t outlineInsetsTop;
- int32_t outlineInsetsRight;
- int32_t outlineInsetsBottom;
- float outlineRadius;
- uint8_t outlineAlpha;
-};
-
-static void readDataFromStream(png_structp readPtr, png_bytep data,
- png_size_t length) {
- std::istream* input =
- reinterpret_cast<std::istream*>(png_get_io_ptr(readPtr));
- if (!input->read(reinterpret_cast<char*>(data), length)) {
- png_error(readPtr, strerror(errno));
- }
-}
-
-static void writeDataToStream(png_structp writePtr, png_bytep data,
- png_size_t length) {
- android::BigBuffer* outBuffer = reinterpret_cast<android::BigBuffer*>(png_get_io_ptr(writePtr));
- png_bytep buf = outBuffer->NextBlock<png_byte>(length);
- memcpy(buf, data, length);
-}
-
-static void flushDataToStream(png_structp /*writePtr*/) {}
-
-static void logWarning(png_structp readPtr, png_const_charp warningMessage) {
- android::IDiagnostics* diag =
- reinterpret_cast<android::IDiagnostics*>(png_get_error_ptr(readPtr));
- diag->Warn(android::DiagMessage() << warningMessage);
-}
-
-static bool readPng(android::IDiagnostics* diag, png_structp readPtr, png_infop infoPtr,
- PngInfo* outInfo) {
- if (setjmp(png_jmpbuf(readPtr))) {
- diag->Error(android::DiagMessage() << "failed reading png");
- return false;
- }
-
- png_set_sig_bytes(readPtr, kPngSignatureSize);
- png_read_info(readPtr, infoPtr);
-
- int colorType, bitDepth, interlaceType, compressionType;
- png_get_IHDR(readPtr, infoPtr, &outInfo->width, &outInfo->height, &bitDepth,
- &colorType, &interlaceType, &compressionType, nullptr);
-
- if (colorType == PNG_COLOR_TYPE_PALETTE) {
- png_set_palette_to_rgb(readPtr);
- }
-
- if (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8) {
- png_set_expand_gray_1_2_4_to_8(readPtr);
- }
-
- if (png_get_valid(readPtr, infoPtr, PNG_INFO_tRNS)) {
- png_set_tRNS_to_alpha(readPtr);
- }
-
- if (bitDepth == 16) {
- png_set_strip_16(readPtr);
- }
-
- if (!(colorType & PNG_COLOR_MASK_ALPHA)) {
- png_set_add_alpha(readPtr, 0xFF, PNG_FILLER_AFTER);
- }
-
- if (colorType == PNG_COLOR_TYPE_GRAY ||
- colorType == PNG_COLOR_TYPE_GRAY_ALPHA) {
- png_set_gray_to_rgb(readPtr);
- }
-
- png_set_interlace_handling(readPtr);
- png_read_update_info(readPtr, infoPtr);
-
- const uint32_t rowBytes = png_get_rowbytes(readPtr, infoPtr);
- outInfo->rows.resize(outInfo->height);
- for (size_t i = 0; i < outInfo->height; i++) {
- outInfo->rows[i] = new png_byte[rowBytes];
- }
-
- png_read_image(readPtr, outInfo->rows.data());
- png_read_end(readPtr, infoPtr);
- return true;
-}
-
-static void checkNinePatchSerialization(android::Res_png_9patch* inPatch,
- void* data) {
- size_t patchSize = inPatch->serializedSize();
- void* newData = malloc(patchSize);
- memcpy(newData, data, patchSize);
- android::Res_png_9patch* outPatch = inPatch->deserialize(newData);
- outPatch->fileToDevice();
- // deserialization is done in place, so outPatch == newData
- assert(outPatch == newData);
- assert(outPatch->numXDivs == inPatch->numXDivs);
- assert(outPatch->numYDivs == inPatch->numYDivs);
- assert(outPatch->paddingLeft == inPatch->paddingLeft);
- assert(outPatch->paddingRight == inPatch->paddingRight);
- assert(outPatch->paddingTop == inPatch->paddingTop);
- assert(outPatch->paddingBottom == inPatch->paddingBottom);
- /* for (int i = 0; i < outPatch->numXDivs; i++) {
- assert(outPatch->getXDivs()[i] == inPatch->getXDivs()[i]);
- }
- for (int i = 0; i < outPatch->numYDivs; i++) {
- assert(outPatch->getYDivs()[i] == inPatch->getYDivs()[i]);
- }
- for (int i = 0; i < outPatch->numColors; i++) {
- assert(outPatch->getColors()[i] == inPatch->getColors()[i]);
- }*/
- free(newData);
-}
-
-/*static void dump_image(int w, int h, const png_byte* const* rows, int
-color_type) {
- int i, j, rr, gg, bb, aa;
-
- int bpp;
- if (color_type == PNG_COLOR_TYPE_PALETTE || color_type ==
-PNG_COLOR_TYPE_GRAY) {
- bpp = 1;
- } else if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
- bpp = 2;
- } else if (color_type == PNG_COLOR_TYPE_RGB || color_type ==
-PNG_COLOR_TYPE_RGB_ALPHA) {
- // We use a padding byte even when there is no alpha
- bpp = 4;
- } else {
- printf("Unknown color type %d.\n", color_type);
- }
-
- for (j = 0; j < h; j++) {
- const png_byte* row = rows[j];
- for (i = 0; i < w; i++) {
- rr = row[0];
- gg = row[1];
- bb = row[2];
- aa = row[3];
- row += bpp;
-
- if (i == 0) {
- printf("Row %d:", j);
- }
- switch (bpp) {
- case 1:
- printf(" (%d)", rr);
- break;
- case 2:
- printf(" (%d %d", rr, gg);
- break;
- case 3:
- printf(" (%d %d %d)", rr, gg, bb);
- break;
- case 4:
- printf(" (%d %d %d %d)", rr, gg, bb, aa);
- break;
- }
- if (i == (w - 1)) {
- printf("\n");
- }
- }
- }
-}*/
-
-#ifdef MAX
-#undef MAX
-#endif
-#ifdef ABS
-#undef ABS
-#endif
-
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define ABS(a) ((a) < 0 ? -(a) : (a))
-
-static void analyze_image(android::IDiagnostics* diag, const PngInfo& imageInfo,
- int grayscaleTolerance, png_colorp rgbPalette, png_bytep alphaPalette,
- int* paletteEntries, bool* hasTransparency, int* colorType,
- png_bytepp outRows) {
- int w = imageInfo.width;
- int h = imageInfo.height;
- int i, j, rr, gg, bb, aa, idx;
- uint32_t colors[256], col;
- int num_colors = 0;
- int maxGrayDeviation = 0;
-
- bool isOpaque = true;
- bool isPalette = true;
- bool isGrayscale = true;
-
- // Scan the entire image and determine if:
- // 1. Every pixel has R == G == B (grayscale)
- // 2. Every pixel has A == 255 (opaque)
- // 3. There are no more than 256 distinct RGBA colors
-
- if (kDebug) {
- printf("Initial image data:\n");
- // dump_image(w, h, imageInfo.rows.data(), PNG_COLOR_TYPE_RGB_ALPHA);
- }
-
- for (j = 0; j < h; j++) {
- const png_byte* row = imageInfo.rows[j];
- png_bytep out = outRows[j];
- for (i = 0; i < w; i++) {
- rr = *row++;
- gg = *row++;
- bb = *row++;
- aa = *row++;
-
- int odev = maxGrayDeviation;
- maxGrayDeviation = MAX(ABS(rr - gg), maxGrayDeviation);
- maxGrayDeviation = MAX(ABS(gg - bb), maxGrayDeviation);
- maxGrayDeviation = MAX(ABS(bb - rr), maxGrayDeviation);
- if (maxGrayDeviation > odev) {
- if (kDebug) {
- printf("New max dev. = %d at pixel (%d, %d) = (%d %d %d %d)\n",
- maxGrayDeviation, i, j, rr, gg, bb, aa);
- }
- }
-
- // Check if image is really grayscale
- if (isGrayscale) {
- if (rr != gg || rr != bb) {
- if (kDebug) {
- printf("Found a non-gray pixel at %d, %d = (%d %d %d %d)\n", i, j,
- rr, gg, bb, aa);
- }
- isGrayscale = false;
- }
- }
-
- // Check if image is really opaque
- if (isOpaque) {
- if (aa != 0xff) {
- if (kDebug) {
- printf("Found a non-opaque pixel at %d, %d = (%d %d %d %d)\n", i, j,
- rr, gg, bb, aa);
- }
- isOpaque = false;
- }
- }
-
- // Check if image is really <= 256 colors
- if (isPalette) {
- col = (uint32_t)((rr << 24) | (gg << 16) | (bb << 8) | aa);
- bool match = false;
- for (idx = 0; idx < num_colors; idx++) {
- if (colors[idx] == col) {
- match = true;
- break;
- }
- }
-
- // Write the palette index for the pixel to outRows optimistically
- // We might overwrite it later if we decide to encode as gray or
- // gray + alpha
- *out++ = idx;
- if (!match) {
- if (num_colors == 256) {
- if (kDebug) {
- printf("Found 257th color at %d, %d\n", i, j);
- }
- isPalette = false;
- } else {
- colors[num_colors++] = col;
- }
- }
- }
- }
- }
-
- *paletteEntries = 0;
- *hasTransparency = !isOpaque;
- int bpp = isOpaque ? 3 : 4;
- int paletteSize = w * h + bpp * num_colors;
-
- if (kDebug) {
- printf("isGrayscale = %s\n", isGrayscale ? "true" : "false");
- printf("isOpaque = %s\n", isOpaque ? "true" : "false");
- printf("isPalette = %s\n", isPalette ? "true" : "false");
- printf("Size w/ palette = %d, gray+alpha = %d, rgb(a) = %d\n", paletteSize,
- 2 * w * h, bpp * w * h);
- printf("Max gray deviation = %d, tolerance = %d\n", maxGrayDeviation,
- grayscaleTolerance);
- }
-
- // Choose the best color type for the image.
- // 1. Opaque gray - use COLOR_TYPE_GRAY at 1 byte/pixel
- // 2. Gray + alpha - use COLOR_TYPE_PALETTE if the number of distinct
- // combinations
- // is sufficiently small, otherwise use COLOR_TYPE_GRAY_ALPHA
- // 3. RGB(A) - use COLOR_TYPE_PALETTE if the number of distinct colors is
- // sufficiently
- // small, otherwise use COLOR_TYPE_RGB{_ALPHA}
- if (isGrayscale) {
- if (isOpaque) {
- *colorType = PNG_COLOR_TYPE_GRAY; // 1 byte/pixel
- } else {
- // Use a simple heuristic to determine whether using a palette will
- // save space versus using gray + alpha for each pixel.
- // This doesn't take into account chunk overhead, filtering, LZ
- // compression, etc.
- if (isPalette && (paletteSize < 2 * w * h)) {
- *colorType = PNG_COLOR_TYPE_PALETTE; // 1 byte/pixel + 4 bytes/color
- } else {
- *colorType = PNG_COLOR_TYPE_GRAY_ALPHA; // 2 bytes per pixel
- }
- }
- } else if (isPalette && (paletteSize < bpp * w * h)) {
- *colorType = PNG_COLOR_TYPE_PALETTE;
- } else {
- if (maxGrayDeviation <= grayscaleTolerance) {
- diag->Note(android::DiagMessage()
- << "forcing image to gray (max deviation = " << maxGrayDeviation << ")");
- *colorType = isOpaque ? PNG_COLOR_TYPE_GRAY : PNG_COLOR_TYPE_GRAY_ALPHA;
- } else {
- *colorType = isOpaque ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA;
- }
- }
-
- // Perform postprocessing of the image or palette data based on the final
- // color type chosen
-
- if (*colorType == PNG_COLOR_TYPE_PALETTE) {
- // Create separate RGB and Alpha palettes and set the number of colors
- *paletteEntries = num_colors;
-
- // Create the RGB and alpha palettes
- for (int idx = 0; idx < num_colors; idx++) {
- col = colors[idx];
- rgbPalette[idx].red = (png_byte)((col >> 24) & 0xff);
- rgbPalette[idx].green = (png_byte)((col >> 16) & 0xff);
- rgbPalette[idx].blue = (png_byte)((col >> 8) & 0xff);
- alphaPalette[idx] = (png_byte)(col & 0xff);
- }
- } else if (*colorType == PNG_COLOR_TYPE_GRAY ||
- *colorType == PNG_COLOR_TYPE_GRAY_ALPHA) {
- // If the image is gray or gray + alpha, compact the pixels into outRows
- for (j = 0; j < h; j++) {
- const png_byte* row = imageInfo.rows[j];
- png_bytep out = outRows[j];
- for (i = 0; i < w; i++) {
- rr = *row++;
- gg = *row++;
- bb = *row++;
- aa = *row++;
-
- if (isGrayscale) {
- *out++ = rr;
- } else {
- *out++ = (png_byte)(rr * 0.2126f + gg * 0.7152f + bb * 0.0722f);
- }
- if (!isOpaque) {
- *out++ = aa;
- }
- }
- }
- }
-}
-
-static bool writePng(android::IDiagnostics* diag, png_structp writePtr, png_infop infoPtr,
- PngInfo* info, int grayScaleTolerance) {
- if (setjmp(png_jmpbuf(writePtr))) {
- diag->Error(android::DiagMessage() << "failed to write png");
- return false;
- }
-
- uint32_t width, height;
- int colorType, bitDepth, interlaceType, compressionType;
-
- png_unknown_chunk unknowns[3];
- unknowns[0].data = nullptr;
- unknowns[1].data = nullptr;
- unknowns[2].data = nullptr;
-
- png_bytepp outRows =
- (png_bytepp)malloc((int)info->height * sizeof(png_bytep));
- if (outRows == (png_bytepp)0) {
- printf("Can't allocate output buffer!\n");
- exit(1);
- }
- for (uint32_t i = 0; i < info->height; i++) {
- outRows[i] = (png_bytep)malloc(2 * (int)info->width);
- if (outRows[i] == (png_bytep)0) {
- printf("Can't allocate output buffer!\n");
- exit(1);
- }
- }
-
- png_set_compression_level(writePtr, Z_BEST_COMPRESSION);
-
- if (kDebug) {
- diag->Note(android::DiagMessage()
- << "writing image: w = " << info->width << ", h = " << info->height);
- }
-
- png_color rgbPalette[256];
- png_byte alphaPalette[256];
- bool hasTransparency;
- int paletteEntries;
-
- analyze_image(diag, *info, grayScaleTolerance, rgbPalette, alphaPalette,
- &paletteEntries, &hasTransparency, &colorType, outRows);
-
- // If the image is a 9-patch, we need to preserve it as a ARGB file to make
- // sure the pixels will not be pre-dithered/clamped until we decide they are
- if (info->is9Patch &&
- (colorType == PNG_COLOR_TYPE_RGB || colorType == PNG_COLOR_TYPE_GRAY ||
- colorType == PNG_COLOR_TYPE_PALETTE)) {
- colorType = PNG_COLOR_TYPE_RGB_ALPHA;
- }
-
- if (kDebug) {
- switch (colorType) {
- case PNG_COLOR_TYPE_PALETTE:
- diag->Note(android::DiagMessage() << "has " << paletteEntries << " colors"
- << (hasTransparency ? " (with alpha)" : "")
- << ", using PNG_COLOR_TYPE_PALLETTE");
- break;
- case PNG_COLOR_TYPE_GRAY:
- diag->Note(android::DiagMessage() << "is opaque gray, using PNG_COLOR_TYPE_GRAY");
- break;
- case PNG_COLOR_TYPE_GRAY_ALPHA:
- diag->Note(android::DiagMessage() << "is gray + alpha, using PNG_COLOR_TYPE_GRAY_ALPHA");
- break;
- case PNG_COLOR_TYPE_RGB:
- diag->Note(android::DiagMessage() << "is opaque RGB, using PNG_COLOR_TYPE_RGB");
- break;
- case PNG_COLOR_TYPE_RGB_ALPHA:
- diag->Note(android::DiagMessage() << "is RGB + alpha, using PNG_COLOR_TYPE_RGB_ALPHA");
- break;
- }
- }
-
- png_set_IHDR(writePtr, infoPtr, info->width, info->height, 8, colorType,
- PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
- PNG_FILTER_TYPE_DEFAULT);
-
- if (colorType == PNG_COLOR_TYPE_PALETTE) {
- png_set_PLTE(writePtr, infoPtr, rgbPalette, paletteEntries);
- if (hasTransparency) {
- png_set_tRNS(writePtr, infoPtr, alphaPalette, paletteEntries,
- (png_color_16p)0);
- }
- png_set_filter(writePtr, 0, PNG_NO_FILTERS);
- } else {
- png_set_filter(writePtr, 0, PNG_ALL_FILTERS);
- }
-
- if (info->is9Patch) {
- int chunkCount = 2 + (info->haveLayoutBounds ? 1 : 0);
- int pIndex = info->haveLayoutBounds ? 2 : 1;
- int bIndex = 1;
- int oIndex = 0;
-
- // Chunks ordered thusly because older platforms depend on the base 9 patch
- // data being last
- png_bytep chunkNames = info->haveLayoutBounds
- ? (png_bytep) "npOl\0npLb\0npTc\0"
- : (png_bytep) "npOl\0npTc";
-
- // base 9 patch data
- if (kDebug) {
- diag->Note(android::DiagMessage() << "adding 9-patch info..");
- }
- memcpy((char*)unknowns[pIndex].name, "npTc", 5);
- unknowns[pIndex].data = (png_byte*)info->serialize9Patch();
- unknowns[pIndex].size = info->info9Patch.serializedSize();
- // TODO: remove the check below when everything works
- checkNinePatchSerialization(&info->info9Patch, unknowns[pIndex].data);
-
- // automatically generated 9 patch outline data
- int chunkSize = sizeof(png_uint_32) * 6;
- memcpy((char*)unknowns[oIndex].name, "npOl", 5);
- unknowns[oIndex].data = (png_byte*)calloc(chunkSize, 1);
- png_byte outputData[chunkSize];
- memcpy(&outputData, &info->outlineInsetsLeft, 4 * sizeof(png_uint_32));
- ((float*)outputData)[4] = info->outlineRadius;
- ((png_uint_32*)outputData)[5] = info->outlineAlpha;
- memcpy(unknowns[oIndex].data, &outputData, chunkSize);
- unknowns[oIndex].size = chunkSize;
-
- // optional optical inset / layout bounds data
- if (info->haveLayoutBounds) {
- int chunkSize = sizeof(png_uint_32) * 4;
- memcpy((char*)unknowns[bIndex].name, "npLb", 5);
- unknowns[bIndex].data = (png_byte*)calloc(chunkSize, 1);
- memcpy(unknowns[bIndex].data, &info->layoutBoundsLeft, chunkSize);
- unknowns[bIndex].size = chunkSize;
- }
-
- for (int i = 0; i < chunkCount; i++) {
- unknowns[i].location = PNG_HAVE_PLTE;
- }
- png_set_keep_unknown_chunks(writePtr, PNG_HANDLE_CHUNK_ALWAYS, chunkNames,
- chunkCount);
- png_set_unknown_chunks(writePtr, infoPtr, unknowns, chunkCount);
-
-#if PNG_LIBPNG_VER < 10600
- // Deal with unknown chunk location bug in 1.5.x and earlier.
- png_set_unknown_chunk_location(writePtr, infoPtr, 0, PNG_HAVE_PLTE);
- if (info->haveLayoutBounds) {
- png_set_unknown_chunk_location(writePtr, infoPtr, 1, PNG_HAVE_PLTE);
- }
-#endif
- }
-
- png_write_info(writePtr, infoPtr);
-
- png_bytepp rows;
- if (colorType == PNG_COLOR_TYPE_RGB ||
- colorType == PNG_COLOR_TYPE_RGB_ALPHA) {
- if (colorType == PNG_COLOR_TYPE_RGB) {
- png_set_filler(writePtr, 0, PNG_FILLER_AFTER);
- }
- rows = info->rows.data();
- } else {
- rows = outRows;
- }
- png_write_image(writePtr, rows);
-
- if (kDebug) {
- printf("Final image data:\n");
- // dump_image(info->width, info->height, rows, colorType);
- }
-
- png_write_end(writePtr, infoPtr);
-
- for (uint32_t i = 0; i < info->height; i++) {
- free(outRows[i]);
- }
- free(outRows);
- free(unknowns[0].data);
- free(unknowns[1].data);
- free(unknowns[2].data);
-
- png_get_IHDR(writePtr, infoPtr, &width, &height, &bitDepth, &colorType,
- &interlaceType, &compressionType, nullptr);
-
- if (kDebug) {
- diag->Note(android::DiagMessage()
- << "image written: w = " << width << ", h = " << height << ", d = " << bitDepth
- << ", colors = " << colorType << ", inter = " << interlaceType
- << ", comp = " << compressionType);
- }
- return true;
-}
-
-constexpr uint32_t kColorWhite = 0xffffffffu;
-constexpr uint32_t kColorTick = 0xff000000u;
-constexpr uint32_t kColorLayoutBoundsTick = 0xff0000ffu;
-
-enum class TickType { kNone, kTick, kLayoutBounds, kBoth };
-
-static TickType tickType(png_bytep p, bool transparent, const char** outError) {
- png_uint_32 color = p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
-
- if (transparent) {
- if (p[3] == 0) {
- return TickType::kNone;
- }
- if (color == kColorLayoutBoundsTick) {
- return TickType::kLayoutBounds;
- }
- if (color == kColorTick) {
- return TickType::kTick;
- }
-
- // Error cases
- if (p[3] != 0xff) {
- *outError =
- "Frame pixels must be either solid or transparent "
- "(not intermediate alphas)";
- return TickType::kNone;
- }
-
- if (p[0] != 0 || p[1] != 0 || p[2] != 0) {
- *outError = "Ticks in transparent frame must be black or red";
- }
- return TickType::kTick;
- }
-
- if (p[3] != 0xFF) {
- *outError = "White frame must be a solid color (no alpha)";
- }
- if (color == kColorWhite) {
- return TickType::kNone;
- }
- if (color == kColorTick) {
- return TickType::kTick;
- }
- if (color == kColorLayoutBoundsTick) {
- return TickType::kLayoutBounds;
- }
-
- if (p[0] != 0 || p[1] != 0 || p[2] != 0) {
- *outError = "Ticks in white frame must be black or red";
- return TickType::kNone;
- }
- return TickType::kTick;
-}
-
-enum class TickState { kStart, kInside1, kOutside1 };
-
-static bool getHorizontalTicks(png_bytep row, int width, bool transparent,
- bool required, int32_t* outLeft,
- int32_t* outRight, const char** outError,
- uint8_t* outDivs, bool multipleAllowed) {
- *outLeft = *outRight = -1;
- TickState state = TickState::kStart;
- bool found = false;
-
- for (int i = 1; i < width - 1; i++) {
- if (tickType(row + i * 4, transparent, outError) == TickType::kTick) {
- if (state == TickState::kStart ||
- (state == TickState::kOutside1 && multipleAllowed)) {
- *outLeft = i - 1;
- *outRight = width - 2;
- found = true;
- if (outDivs != NULL) {
- *outDivs += 2;
- }
- state = TickState::kInside1;
- } else if (state == TickState::kOutside1) {
- *outError = "Can't have more than one marked region along edge";
- *outLeft = i;
- return false;
- }
- } else if (!*outError) {
- if (state == TickState::kInside1) {
- // We're done with this div. Move on to the next.
- *outRight = i - 1;
- outRight += 2;
- outLeft += 2;
- state = TickState::kOutside1;
- }
- } else {
- *outLeft = i;
- return false;
- }
- }
-
- if (required && !found) {
- *outError = "No marked region found along edge";
- *outLeft = -1;
- return false;
- }
- return true;
-}
-
-static bool getVerticalTicks(png_bytepp rows, int offset, int height,
- bool transparent, bool required, int32_t* outTop,
- int32_t* outBottom, const char** outError,
- uint8_t* outDivs, bool multipleAllowed) {
- *outTop = *outBottom = -1;
- TickState state = TickState::kStart;
- bool found = false;
-
- for (int i = 1; i < height - 1; i++) {
- if (tickType(rows[i] + offset, transparent, outError) == TickType::kTick) {
- if (state == TickState::kStart ||
- (state == TickState::kOutside1 && multipleAllowed)) {
- *outTop = i - 1;
- *outBottom = height - 2;
- found = true;
- if (outDivs != NULL) {
- *outDivs += 2;
- }
- state = TickState::kInside1;
- } else if (state == TickState::kOutside1) {
- *outError = "Can't have more than one marked region along edge";
- *outTop = i;
- return false;
- }
- } else if (!*outError) {
- if (state == TickState::kInside1) {
- // We're done with this div. Move on to the next.
- *outBottom = i - 1;
- outTop += 2;
- outBottom += 2;
- state = TickState::kOutside1;
- }
- } else {
- *outTop = i;
- return false;
- }
- }
-
- if (required && !found) {
- *outError = "No marked region found along edge";
- *outTop = -1;
- return false;
- }
- return true;
-}
-
-static bool getHorizontalLayoutBoundsTicks(png_bytep row, int width,
- bool transparent,
- bool /* required */,
- int32_t* outLeft, int32_t* outRight,
- const char** outError) {
- *outLeft = *outRight = 0;
-
- // Look for left tick
- if (tickType(row + 4, transparent, outError) == TickType::kLayoutBounds) {
- // Starting with a layout padding tick
- int i = 1;
- while (i < width - 1) {
- (*outLeft)++;
- i++;
- if (tickType(row + i * 4, transparent, outError) !=
- TickType::kLayoutBounds) {
- break;
- }
- }
- }
-
- // Look for right tick
- if (tickType(row + (width - 2) * 4, transparent, outError) ==
- TickType::kLayoutBounds) {
- // Ending with a layout padding tick
- int i = width - 2;
- while (i > 1) {
- (*outRight)++;
- i--;
- if (tickType(row + i * 4, transparent, outError) !=
- TickType::kLayoutBounds) {
- break;
- }
- }
- }
- return true;
-}
-
-static bool getVerticalLayoutBoundsTicks(png_bytepp rows, int offset,
- int height, bool transparent,
- bool /* required */, int32_t* outTop,
- int32_t* outBottom,
- const char** outError) {
- *outTop = *outBottom = 0;
-
- // Look for top tick
- if (tickType(rows[1] + offset, transparent, outError) ==
- TickType::kLayoutBounds) {
- // Starting with a layout padding tick
- int i = 1;
- while (i < height - 1) {
- (*outTop)++;
- i++;
- if (tickType(rows[i] + offset, transparent, outError) !=
- TickType::kLayoutBounds) {
- break;
- }
- }
- }
-
- // Look for bottom tick
- if (tickType(rows[height - 2] + offset, transparent, outError) ==
- TickType::kLayoutBounds) {
- // Ending with a layout padding tick
- int i = height - 2;
- while (i > 1) {
- (*outBottom)++;
- i--;
- if (tickType(rows[i] + offset, transparent, outError) !=
- TickType::kLayoutBounds) {
- break;
- }
- }
- }
- return true;
-}
-
-static void findMaxOpacity(png_bytepp rows, int startX, int startY, int endX,
- int endY, int dX, int dY, int* outInset) {
- uint8_t maxOpacity = 0;
- int inset = 0;
- *outInset = 0;
- for (int x = startX, y = startY; x != endX && y != endY;
- x += dX, y += dY, inset++) {
- png_byte* color = rows[y] + x * 4;
- uint8_t opacity = color[3];
- if (opacity > maxOpacity) {
- maxOpacity = opacity;
- *outInset = inset;
- }
- if (opacity == 0xff) return;
- }
-}
-
-static uint8_t maxAlphaOverRow(png_bytep row, int startX, int endX) {
- uint8_t maxAlpha = 0;
- for (int x = startX; x < endX; x++) {
- uint8_t alpha = (row + x * 4)[3];
- if (alpha > maxAlpha) maxAlpha = alpha;
- }
- return maxAlpha;
-}
-
-static uint8_t maxAlphaOverCol(png_bytepp rows, int offsetX, int startY,
- int endY) {
- uint8_t maxAlpha = 0;
- for (int y = startY; y < endY; y++) {
- uint8_t alpha = (rows[y] + offsetX * 4)[3];
- if (alpha > maxAlpha) maxAlpha = alpha;
- }
- return maxAlpha;
-}
-
-static void getOutline(PngInfo* image) {
- int midX = image->width / 2;
- int midY = image->height / 2;
- int endX = image->width - 2;
- int endY = image->height - 2;
-
- // find left and right extent of nine patch content on center row
- if (image->width > 4) {
- findMaxOpacity(image->rows.data(), 1, midY, midX, -1, 1, 0,
- &image->outlineInsetsLeft);
- findMaxOpacity(image->rows.data(), endX, midY, midX, -1, -1, 0,
- &image->outlineInsetsRight);
- } else {
- image->outlineInsetsLeft = 0;
- image->outlineInsetsRight = 0;
- }
-
- // find top and bottom extent of nine patch content on center column
- if (image->height > 4) {
- findMaxOpacity(image->rows.data(), midX, 1, -1, midY, 0, 1,
- &image->outlineInsetsTop);
- findMaxOpacity(image->rows.data(), midX, endY, -1, midY, 0, -1,
- &image->outlineInsetsBottom);
- } else {
- image->outlineInsetsTop = 0;
- image->outlineInsetsBottom = 0;
- }
-
- int innerStartX = 1 + image->outlineInsetsLeft;
- int innerStartY = 1 + image->outlineInsetsTop;
- int innerEndX = endX - image->outlineInsetsRight;
- int innerEndY = endY - image->outlineInsetsBottom;
- int innerMidX = (innerEndX + innerStartX) / 2;
- int innerMidY = (innerEndY + innerStartY) / 2;
-
- // assuming the image is a round rect, compute the radius by marching
- // diagonally from the top left corner towards the center
- image->outlineAlpha = std::max(
- maxAlphaOverRow(image->rows[innerMidY], innerStartX, innerEndX),
- maxAlphaOverCol(image->rows.data(), innerMidX, innerStartY, innerStartY));
-
- int diagonalInset = 0;
- findMaxOpacity(image->rows.data(), innerStartX, innerStartY, innerMidX,
- innerMidY, 1, 1, &diagonalInset);
-
- /* Determine source radius based upon inset:
- * sqrt(r^2 + r^2) = sqrt(i^2 + i^2) + r
- * sqrt(2) * r = sqrt(2) * i + r
- * (sqrt(2) - 1) * r = sqrt(2) * i
- * r = sqrt(2) / (sqrt(2) - 1) * i
- */
- image->outlineRadius = 3.4142f * diagonalInset;
-
- if (kDebug) {
- printf("outline insets %d %d %d %d, rad %f, alpha %x\n",
- image->outlineInsetsLeft, image->outlineInsetsTop,
- image->outlineInsetsRight, image->outlineInsetsBottom,
- image->outlineRadius, image->outlineAlpha);
- }
-}
-
-static uint32_t getColor(png_bytepp rows, int left, int top, int right,
- int bottom) {
- png_bytep color = rows[top] + left * 4;
-
- if (left > right || top > bottom) {
- return android::Res_png_9patch::TRANSPARENT_COLOR;
- }
-
- while (top <= bottom) {
- for (int i = left; i <= right; i++) {
- png_bytep p = rows[top] + i * 4;
- if (color[3] == 0) {
- if (p[3] != 0) {
- return android::Res_png_9patch::NO_COLOR;
- }
- } else if (p[0] != color[0] || p[1] != color[1] || p[2] != color[2] ||
- p[3] != color[3]) {
- return android::Res_png_9patch::NO_COLOR;
- }
- }
- top++;
- }
-
- if (color[3] == 0) {
- return android::Res_png_9patch::TRANSPARENT_COLOR;
- }
- return (color[3] << 24) | (color[0] << 16) | (color[1] << 8) | color[2];
-}
-
-static bool do9Patch(PngInfo* image, std::string* outError) {
- image->is9Patch = true;
-
- int W = image->width;
- int H = image->height;
- int i, j;
-
- const int maxSizeXDivs = W * sizeof(int32_t);
- const int maxSizeYDivs = H * sizeof(int32_t);
- int32_t* xDivs = image->xDivs = new int32_t[W];
- int32_t* yDivs = image->yDivs = new int32_t[H];
- uint8_t numXDivs = 0;
- uint8_t numYDivs = 0;
-
- int8_t numColors;
- int numRows;
- int numCols;
- int top;
- int left;
- int right;
- int bottom;
- memset(xDivs, -1, maxSizeXDivs);
- memset(yDivs, -1, maxSizeYDivs);
- image->info9Patch.paddingLeft = image->info9Patch.paddingRight = -1;
- image->info9Patch.paddingTop = image->info9Patch.paddingBottom = -1;
- image->layoutBoundsLeft = image->layoutBoundsRight = 0;
- image->layoutBoundsTop = image->layoutBoundsBottom = 0;
-
- png_bytep p = image->rows[0];
- bool transparent = p[3] == 0;
- bool hasColor = false;
-
- const char* errorMsg = nullptr;
- int errorPixel = -1;
- const char* errorEdge = nullptr;
-
- int colorIndex = 0;
- std::vector<png_bytep> newRows;
-
- // Validate size...
- if (W < 3 || H < 3) {
- errorMsg = "Image must be at least 3x3 (1x1 without frame) pixels";
- goto getout;
- }
-
- // Validate frame...
- if (!transparent &&
- (p[0] != 0xFF || p[1] != 0xFF || p[2] != 0xFF || p[3] != 0xFF)) {
- errorMsg = "Must have one-pixel frame that is either transparent or white";
- goto getout;
- }
-
- // Find left and right of sizing areas...
- if (!getHorizontalTicks(p, W, transparent, true, &xDivs[0], &xDivs[1],
- &errorMsg, &numXDivs, true)) {
- errorPixel = xDivs[0];
- errorEdge = "top";
- goto getout;
- }
-
- // Find top and bottom of sizing areas...
- if (!getVerticalTicks(image->rows.data(), 0, H, transparent, true, &yDivs[0],
- &yDivs[1], &errorMsg, &numYDivs, true)) {
- errorPixel = yDivs[0];
- errorEdge = "left";
- goto getout;
- }
-
- // Copy patch size data into image...
- image->info9Patch.numXDivs = numXDivs;
- image->info9Patch.numYDivs = numYDivs;
-
- // Find left and right of padding area...
- if (!getHorizontalTicks(image->rows[H - 1], W, transparent, false,
- &image->info9Patch.paddingLeft,
- &image->info9Patch.paddingRight, &errorMsg, nullptr,
- false)) {
- errorPixel = image->info9Patch.paddingLeft;
- errorEdge = "bottom";
- goto getout;
- }
-
- // Find top and bottom of padding area...
- if (!getVerticalTicks(image->rows.data(), (W - 1) * 4, H, transparent, false,
- &image->info9Patch.paddingTop,
- &image->info9Patch.paddingBottom, &errorMsg, nullptr,
- false)) {
- errorPixel = image->info9Patch.paddingTop;
- errorEdge = "right";
- goto getout;
- }
-
- // Find left and right of layout padding...
- getHorizontalLayoutBoundsTicks(image->rows[H - 1], W, transparent, false,
- &image->layoutBoundsLeft,
- &image->layoutBoundsRight, &errorMsg);
-
- getVerticalLayoutBoundsTicks(image->rows.data(), (W - 1) * 4, H, transparent,
- false, &image->layoutBoundsTop,
- &image->layoutBoundsBottom, &errorMsg);
-
- image->haveLayoutBounds =
- image->layoutBoundsLeft != 0 || image->layoutBoundsRight != 0 ||
- image->layoutBoundsTop != 0 || image->layoutBoundsBottom != 0;
-
- if (image->haveLayoutBounds) {
- if (kDebug) {
- printf("layoutBounds=%d %d %d %d\n", image->layoutBoundsLeft,
- image->layoutBoundsTop, image->layoutBoundsRight,
- image->layoutBoundsBottom);
- }
- }
-
- // use opacity of pixels to estimate the round rect outline
- getOutline(image);
-
- // If padding is not yet specified, take values from size.
- if (image->info9Patch.paddingLeft < 0) {
- image->info9Patch.paddingLeft = xDivs[0];
- image->info9Patch.paddingRight = W - 2 - xDivs[1];
- } else {
- // Adjust value to be correct!
- image->info9Patch.paddingRight = W - 2 - image->info9Patch.paddingRight;
- }
- if (image->info9Patch.paddingTop < 0) {
- image->info9Patch.paddingTop = yDivs[0];
- image->info9Patch.paddingBottom = H - 2 - yDivs[1];
- } else {
- // Adjust value to be correct!
- image->info9Patch.paddingBottom = H - 2 - image->info9Patch.paddingBottom;
- }
-
- /* if (kDebug) {
- printf("Size ticks for %s: x0=%d, x1=%d, y0=%d, y1=%d\n", imageName,
- xDivs[0], xDivs[1],
- yDivs[0], yDivs[1]);
- printf("padding ticks for %s: l=%d, r=%d, t=%d, b=%d\n", imageName,
- image->info9Patch.paddingLeft, image->info9Patch.paddingRight,
- image->info9Patch.paddingTop,
- image->info9Patch.paddingBottom);
- }*/
-
- // Remove frame from image.
- newRows.resize(H - 2);
- for (i = 0; i < H - 2; i++) {
- newRows[i] = image->rows[i + 1];
- memmove(newRows[i], newRows[i] + 4, (W - 2) * 4);
- }
- image->rows.swap(newRows);
-
- image->width -= 2;
- W = image->width;
- image->height -= 2;
- H = image->height;
-
- // Figure out the number of rows and columns in the N-patch
- numCols = numXDivs + 1;
- if (xDivs[0] == 0) { // Column 1 is strechable
- numCols--;
- }
- if (xDivs[numXDivs - 1] == W) {
- numCols--;
- }
- numRows = numYDivs + 1;
- if (yDivs[0] == 0) { // Row 1 is strechable
- numRows--;
- }
- if (yDivs[numYDivs - 1] == H) {
- numRows--;
- }
-
- // Make sure the amount of rows and columns will fit in the number of
- // colors we can use in the 9-patch format.
- if (numRows * numCols > 0x7F) {
- errorMsg = "Too many rows and columns in 9-patch perimeter";
- goto getout;
- }
-
- numColors = numRows * numCols;
- image->info9Patch.numColors = numColors;
- image->colors.resize(numColors);
-
- // Fill in color information for each patch.
-
- uint32_t c;
- top = 0;
-
- // The first row always starts with the top being at y=0 and the bottom
- // being either yDivs[1] (if yDivs[0]=0) of yDivs[0]. In the former case
- // the first row is stretchable along the Y axis, otherwise it is fixed.
- // The last row always ends with the bottom being bitmap.height and the top
- // being either yDivs[numYDivs-2] (if yDivs[numYDivs-1]=bitmap.height) or
- // yDivs[numYDivs-1]. In the former case the last row is stretchable along
- // the Y axis, otherwise it is fixed.
- //
- // The first and last columns are similarly treated with respect to the X
- // axis.
- //
- // The above is to help explain some of the special casing that goes on the
- // code below.
-
- // The initial yDiv and whether the first row is considered stretchable or
- // not depends on whether yDiv[0] was zero or not.
- for (j = (yDivs[0] == 0 ? 1 : 0); j <= numYDivs && top < H; j++) {
- if (j == numYDivs) {
- bottom = H;
- } else {
- bottom = yDivs[j];
- }
- left = 0;
- // The initial xDiv and whether the first column is considered
- // stretchable or not depends on whether xDiv[0] was zero or not.
- for (i = xDivs[0] == 0 ? 1 : 0; i <= numXDivs && left < W; i++) {
- if (i == numXDivs) {
- right = W;
- } else {
- right = xDivs[i];
- }
- c = getColor(image->rows.data(), left, top, right - 1, bottom - 1);
- image->colors[colorIndex++] = c;
- if (kDebug) {
- if (c != android::Res_png_9patch::NO_COLOR) {
- hasColor = true;
- }
- }
- left = right;
- }
- top = bottom;
- }
-
- assert(colorIndex == numColors);
-
- if (kDebug && hasColor) {
- for (i = 0; i < numColors; i++) {
- if (i == 0) printf("Colors:\n");
- printf(" #%08x", image->colors[i]);
- if (i == numColors - 1) printf("\n");
- }
- }
-getout:
- if (errorMsg) {
- std::stringstream err;
- err << "9-patch malformed: " << errorMsg;
- if (errorEdge) {
- err << "." << std::endl;
- if (errorPixel >= 0) {
- err << "Found at pixel #" << errorPixel << " along " << errorEdge
- << " edge";
- } else {
- err << "Found along " << errorEdge << " edge";
- }
- }
- *outError = err.str();
- return false;
- }
- return true;
-}
-
-bool Png::process(const android::Source& source, std::istream* input, android::BigBuffer* outBuffer,
- const PngOptions& options) {
- TRACE_CALL();
- png_byte signature[kPngSignatureSize];
-
- // Read the PNG signature first.
- if (!input->read(reinterpret_cast<char*>(signature), kPngSignatureSize)) {
- mDiag->Error(android::DiagMessage() << strerror(errno));
- return false;
- }
-
- // If the PNG signature doesn't match, bail early.
- if (png_sig_cmp(signature, 0, kPngSignatureSize) != 0) {
- mDiag->Error(android::DiagMessage() << "not a valid png file");
- return false;
- }
-
- bool result = false;
- png_structp readPtr = nullptr;
- png_infop infoPtr = nullptr;
- png_structp writePtr = nullptr;
- png_infop writeInfoPtr = nullptr;
- PngInfo pngInfo = {};
-
- readPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, nullptr, nullptr);
- if (!readPtr) {
- mDiag->Error(android::DiagMessage() << "failed to allocate read ptr");
- goto bail;
- }
-
- infoPtr = png_create_info_struct(readPtr);
- if (!infoPtr) {
- mDiag->Error(android::DiagMessage() << "failed to allocate info ptr");
- goto bail;
- }
-
- png_set_error_fn(readPtr, reinterpret_cast<png_voidp>(mDiag), nullptr,
- logWarning);
-
- // Set the read function to read from std::istream.
- png_set_read_fn(readPtr, (png_voidp)input, readDataFromStream);
-
- if (!readPng(mDiag, readPtr, infoPtr, &pngInfo)) {
- goto bail;
- }
-
- if (util::EndsWith(source.path, ".9.png")) {
- std::string errorMsg;
- if (!do9Patch(&pngInfo, &errorMsg)) {
- mDiag->Error(android::DiagMessage() << errorMsg);
- goto bail;
- }
- }
-
- writePtr =
- png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, nullptr, nullptr);
- if (!writePtr) {
- mDiag->Error(android::DiagMessage() << "failed to allocate write ptr");
- goto bail;
- }
-
- writeInfoPtr = png_create_info_struct(writePtr);
- if (!writeInfoPtr) {
- mDiag->Error(android::DiagMessage() << "failed to allocate write info ptr");
- goto bail;
- }
-
- png_set_error_fn(writePtr, nullptr, nullptr, logWarning);
-
- // Set the write function to write to std::ostream.
- png_set_write_fn(writePtr, (png_voidp)outBuffer, writeDataToStream,
- flushDataToStream);
-
- if (!writePng(mDiag, writePtr, writeInfoPtr, &pngInfo,
- options.grayscale_tolerance)) {
- goto bail;
- }
-
- result = true;
-bail:
- if (readPtr) {
- png_destroy_read_struct(&readPtr, &infoPtr, nullptr);
- }
-
- if (writePtr) {
- png_destroy_write_struct(&writePtr, &writeInfoPtr);
- }
- return result;
-}
-
-} // namespace aapt
diff --git a/tools/aapt2/compile/Png.h b/tools/aapt2/compile/Png.h
deleted file mode 100644
index a8b7dd18f12f..000000000000
--- a/tools/aapt2/compile/Png.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef AAPT_PNG_H
-#define AAPT_PNG_H
-
-#include <iostream>
-#include <string>
-
-#include "android-base/macros.h"
-#include "androidfw/BigBuffer.h"
-#include "androidfw/IDiagnostics.h"
-#include "androidfw/Source.h"
-#include "compile/Image.h"
-#include "io/Io.h"
-#include "process/IResourceTableConsumer.h"
-
-namespace aapt {
-
-// Size in bytes of the PNG signature.
-constexpr size_t kPngSignatureSize = 8u;
-
-struct PngOptions {
- int grayscale_tolerance = 0;
-};
-
-/**
- * Deprecated. Removing once new PNG crunching code is proved to be correct.
- */
-class Png {
- public:
- explicit Png(android::IDiagnostics* diag) : mDiag(diag) {
- }
-
- bool process(const android::Source& source, std::istream* input, android::BigBuffer* outBuffer,
- const PngOptions& options);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Png);
-
- android::IDiagnostics* mDiag;
-};
-
-/**
- * An InputStream that filters out unimportant PNG chunks.
- */
-class PngChunkFilter : public io::InputStream {
- public:
- explicit PngChunkFilter(android::StringPiece data);
- virtual ~PngChunkFilter() = default;
-
- bool Next(const void** buffer, size_t* len) override;
- void BackUp(size_t count) override;
-
- bool CanRewind() const override { return true; }
- bool Rewind() override;
- size_t ByteCount() const override { return window_start_; }
-
- bool HadError() const override {
- return !error_msg_.empty();
- }
- std::string GetError() const override {
- return error_msg_;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PngChunkFilter);
-
- bool ConsumeWindow(const void** buffer, size_t* len);
-
- android::StringPiece data_;
- size_t window_start_ = 0;
- size_t window_end_ = 0;
- std::string error_msg_;
-};
-
-/**
- * Reads a PNG from the InputStream into memory as an RGBA Image.
- */
-std::unique_ptr<Image> ReadPng(IAaptContext* context, const android::Source& source,
- io::InputStream* in);
-
-/**
- * Writes the RGBA Image, with optional 9-patch meta-data, into the OutputStream
- * as a PNG.
- */
-bool WritePng(IAaptContext* context, const Image* image,
- const NinePatch* nine_patch, io::OutputStream* out,
- const PngOptions& options);
-
-} // namespace aapt
-
-#endif // AAPT_PNG_H
diff --git a/tools/aapt2/compile/PngChunkFilter.cpp b/tools/aapt2/compile/PngChunkFilter.cpp
deleted file mode 100644
index 2e55d0c82b7b..000000000000
--- a/tools/aapt2/compile/PngChunkFilter.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "compile/Png.h"
-
-#include "android-base/stringprintf.h"
-#include "androidfw/StringPiece.h"
-
-#include "io/Io.h"
-
-using ::android::StringPiece;
-using ::android::base::StringPrintf;
-
-namespace aapt {
-
-static constexpr const char* kPngSignature = "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a";
-
-// Useful helper function that encodes individual bytes into a uint32
-// at compile time.
-constexpr uint32_t u32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
- return (((uint32_t)a) << 24) | (((uint32_t)b) << 16) | (((uint32_t)c) << 8) |
- ((uint32_t)d);
-}
-
-// Allow list of PNG chunk types that we want to keep in the resulting PNG.
-enum PngChunkTypes {
- kPngChunkIHDR = u32(73, 72, 68, 82),
- kPngChunkIDAT = u32(73, 68, 65, 84),
- kPngChunkIEND = u32(73, 69, 78, 68),
- kPngChunkPLTE = u32(80, 76, 84, 69),
- kPngChunktRNS = u32(116, 82, 78, 83),
- kPngChunksRGB = u32(115, 82, 71, 66),
-};
-
-static uint32_t Peek32LE(const char* data) {
- uint32_t word = ((uint32_t)data[0]) & 0x000000ff;
- word <<= 8;
- word |= ((uint32_t)data[1]) & 0x000000ff;
- word <<= 8;
- word |= ((uint32_t)data[2]) & 0x000000ff;
- word <<= 8;
- word |= ((uint32_t)data[3]) & 0x000000ff;
- return word;
-}
-
-static bool IsPngChunkAllowed(uint32_t type) {
- switch (type) {
- case kPngChunkIHDR:
- case kPngChunkIDAT:
- case kPngChunkIEND:
- case kPngChunkPLTE:
- case kPngChunktRNS:
- case kPngChunksRGB:
- return true;
- default:
- return false;
- }
-}
-
-PngChunkFilter::PngChunkFilter(StringPiece data) : data_(data) {
- if (util::StartsWith(data_, kPngSignature)) {
- window_start_ = 0;
- window_end_ = kPngSignatureSize;
- } else {
- error_msg_ = "file does not start with PNG signature";
- }
-}
-
-bool PngChunkFilter::ConsumeWindow(const void** buffer, size_t* len) {
- if (window_start_ != window_end_) {
- // We have bytes to give from our window.
- const size_t bytes_read = window_end_ - window_start_;
- *buffer = data_.data() + window_start_;
- *len = bytes_read;
- window_start_ = window_end_;
- return true;
- }
- return false;
-}
-
-bool PngChunkFilter::Next(const void** buffer, size_t* len) {
- if (HadError()) {
- return false;
- }
-
- // In case BackUp was called, we must consume the window.
- if (ConsumeWindow(buffer, len)) {
- return true;
- }
-
- // Advance the window as far as possible (until we meet a chunk that
- // we want to strip).
- while (window_end_ < data_.size()) {
- // Chunk length (4 bytes) + type (4 bytes) + crc32 (4 bytes) = 12 bytes.
- const size_t kMinChunkHeaderSize = 3 * sizeof(uint32_t);
-
- // Is there enough room for a chunk header?
- if (data_.size() - window_end_ < kMinChunkHeaderSize) {
- error_msg_ = StringPrintf("Not enough space for a PNG chunk @ byte %zu/%zu", window_end_,
- data_.size());
- return false;
- }
-
- // Verify the chunk length.
- const uint32_t chunk_len = Peek32LE(data_.data() + window_end_);
- if ((size_t)chunk_len > data_.size() - window_end_ - kMinChunkHeaderSize) {
- // Overflow.
- const uint32_t chunk_type = Peek32LE(data_.data() + window_end_ + sizeof(uint32_t));
- error_msg_ = StringPrintf(
- "PNG chunk type %08x is too large: chunk length is %zu but chunk "
- "starts at byte %zu/%zu",
- chunk_type, (size_t)chunk_len, window_end_ + kMinChunkHeaderSize, data_.size());
- return false;
- }
-
- // Do we strip this chunk?
- const uint32_t chunk_type = Peek32LE(data_.data() + window_end_ + sizeof(uint32_t));
- if (IsPngChunkAllowed(chunk_type)) {
- // Advance the window to include this chunk.
- window_end_ += kMinChunkHeaderSize + chunk_len;
-
- // Special case the IEND chunk, which MUST appear last and libpng stops parsing once it hits
- // such a chunk (let's do the same).
- if (chunk_type == kPngChunkIEND) {
- // Truncate the data to the end of this chunk. There may be garbage trailing after
- // (b/38169876)
- data_ = data_.substr(0, window_end_);
- break;
- }
-
- } else {
- // We want to strip this chunk. If we accumulated a window,
- // we must return the window now.
- if (window_start_ != window_end_) {
- break;
- }
-
- // The window is empty, so we can advance past this chunk
- // and keep looking for the next good chunk,
- window_end_ += kMinChunkHeaderSize + chunk_len;
- window_start_ = window_end_;
- }
- }
-
- if (ConsumeWindow(buffer, len)) {
- return true;
- }
- return false;
-}
-
-void PngChunkFilter::BackUp(size_t count) {
- if (HadError()) {
- return;
- }
- window_start_ -= count;
-}
-
-bool PngChunkFilter::Rewind() {
- if (HadError()) {
- return false;
- }
- window_start_ = 0;
- window_end_ = kPngSignatureSize;
- return true;
-}
-
-} // namespace aapt
diff --git a/tools/aapt2/compile/PngCrunch.cpp b/tools/aapt2/compile/PngCrunch.cpp
deleted file mode 100644
index 4ef87ba3671b..000000000000
--- a/tools/aapt2/compile/PngCrunch.cpp
+++ /dev/null
@@ -1,750 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "compile/Png.h"
-
-#include <png.h>
-#include <zlib.h>
-
-#include <algorithm>
-#include <unordered_map>
-#include <unordered_set>
-
-#include "android-base/errors.h"
-#include "android-base/logging.h"
-#include "android-base/macros.h"
-
-#include "trace/TraceBuffer.h"
-
-namespace aapt {
-
-// Custom deleter that destroys libpng read and info structs.
-class PngReadStructDeleter {
- public:
- PngReadStructDeleter(png_structp read_ptr, png_infop info_ptr)
- : read_ptr_(read_ptr), info_ptr_(info_ptr) {}
-
- ~PngReadStructDeleter() {
- png_destroy_read_struct(&read_ptr_, &info_ptr_, nullptr);
- }
-
- private:
- png_structp read_ptr_;
- png_infop info_ptr_;
-
- DISALLOW_COPY_AND_ASSIGN(PngReadStructDeleter);
-};
-
-// Custom deleter that destroys libpng write and info structs.
-class PngWriteStructDeleter {
- public:
- PngWriteStructDeleter(png_structp write_ptr, png_infop info_ptr)
- : write_ptr_(write_ptr), info_ptr_(info_ptr) {}
-
- ~PngWriteStructDeleter() {
- png_destroy_write_struct(&write_ptr_, &info_ptr_);
- }
-
- private:
- png_structp write_ptr_;
- png_infop info_ptr_;
-
- DISALLOW_COPY_AND_ASSIGN(PngWriteStructDeleter);
-};
-
-// Custom warning logging method that uses IDiagnostics.
-static void LogWarning(png_structp png_ptr, png_const_charp warning_msg) {
- android::IDiagnostics* diag = (android::IDiagnostics*)png_get_error_ptr(png_ptr);
- diag->Warn(android::DiagMessage() << warning_msg);
-}
-
-// Custom error logging method that uses IDiagnostics.
-static void LogError(png_structp png_ptr, png_const_charp error_msg) {
- android::IDiagnostics* diag = (android::IDiagnostics*)png_get_error_ptr(png_ptr);
- diag->Error(android::DiagMessage() << error_msg);
-
- // Causes libpng to longjmp to the spot where setjmp was set. This is how libpng does
- // error handling. If this custom error handler method were to return, libpng would, by
- // default, print the error message to stdout and call the same png_longjmp method.
- png_longjmp(png_ptr, 1);
-}
-
-static void ReadDataFromStream(png_structp png_ptr, png_bytep buffer, png_size_t len) {
- io::InputStream* in = (io::InputStream*)png_get_io_ptr(png_ptr);
-
- const void* in_buffer;
- size_t in_len;
- if (!in->Next(&in_buffer, &in_len)) {
- if (in->HadError()) {
- std::stringstream error_msg_builder;
- error_msg_builder << "failed reading from input";
- if (!in->GetError().empty()) {
- error_msg_builder << ": " << in->GetError();
- }
- std::string err = error_msg_builder.str();
- png_error(png_ptr, err.c_str());
- }
- return;
- }
-
- const size_t bytes_read = std::min(in_len, len);
- memcpy(buffer, in_buffer, bytes_read);
- if (bytes_read != in_len) {
- in->BackUp(in_len - bytes_read);
- }
-}
-
-static void WriteDataToStream(png_structp png_ptr, png_bytep buffer, png_size_t len) {
- io::OutputStream* out = (io::OutputStream*)png_get_io_ptr(png_ptr);
-
- void* out_buffer;
- size_t out_len;
- while (len > 0) {
- if (!out->Next(&out_buffer, &out_len)) {
- if (out->HadError()) {
- std::stringstream err_msg_builder;
- err_msg_builder << "failed writing to output";
- if (!out->GetError().empty()) {
- err_msg_builder << ": " << out->GetError();
- }
- std::string err = out->GetError();
- png_error(png_ptr, err.c_str());
- }
- return;
- }
-
- const size_t bytes_written = std::min(out_len, len);
- memcpy(out_buffer, buffer, bytes_written);
-
- // Advance the input buffer.
- buffer += bytes_written;
- len -= bytes_written;
-
- // Advance the output buffer.
- out_len -= bytes_written;
- }
-
- // If the entire output buffer wasn't used, backup.
- if (out_len > 0) {
- out->BackUp(out_len);
- }
-}
-
-std::unique_ptr<Image> ReadPng(IAaptContext* context, const android::Source& source,
- io::InputStream* in) {
- TRACE_CALL();
- // Create a diagnostics that has the source information encoded.
- android::SourcePathDiagnostics source_diag(source, context->GetDiagnostics());
-
- // Read the first 8 bytes of the file looking for the PNG signature.
- // Bail early if it does not match.
- const png_byte* signature;
- size_t buffer_size;
- if (!in->Next((const void**)&signature, &buffer_size)) {
- if (in->HadError()) {
- source_diag.Error(android::DiagMessage()
- << "failed to read PNG signature: " << in->GetError());
- } else {
- source_diag.Error(android::DiagMessage() << "not enough data for PNG signature");
- }
- return {};
- }
-
- if (buffer_size < kPngSignatureSize || png_sig_cmp(signature, 0, kPngSignatureSize) != 0) {
- source_diag.Error(android::DiagMessage() << "file signature does not match PNG signature");
- return {};
- }
-
- // Start at the beginning of the first chunk.
- in->BackUp(buffer_size - kPngSignatureSize);
-
- // Create and initialize the png_struct with the default error and warning handlers.
- // The header version is also passed in to ensure that this was built against the same
- // version of libpng.
- png_structp read_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
- if (read_ptr == nullptr) {
- source_diag.Error(android::DiagMessage() << "failed to create libpng read png_struct");
- return {};
- }
-
- // Create and initialize the memory for image header and data.
- png_infop info_ptr = png_create_info_struct(read_ptr);
- if (info_ptr == nullptr) {
- source_diag.Error(android::DiagMessage() << "failed to create libpng read png_info");
- png_destroy_read_struct(&read_ptr, nullptr, nullptr);
- return {};
- }
-
- // Automatically release PNG resources at end of scope.
- PngReadStructDeleter png_read_deleter(read_ptr, info_ptr);
-
- // libpng uses longjmp to jump to an error handling routine.
- // setjmp will only return true if it was jumped to, aka there was
- // an error.
- if (setjmp(png_jmpbuf(read_ptr))) {
- return {};
- }
-
- // Handle warnings ourselves via IDiagnostics.
- png_set_error_fn(read_ptr, (png_voidp)&source_diag, LogError, LogWarning);
-
- // Set up the read functions which read from our custom data sources.
- png_set_read_fn(read_ptr, (png_voidp)in, ReadDataFromStream);
-
- // Skip the signature that we already read.
- png_set_sig_bytes(read_ptr, kPngSignatureSize);
-
- // Read the chunk headers.
- png_read_info(read_ptr, info_ptr);
-
- // Extract image meta-data from the various chunk headers.
- uint32_t width, height;
- int bit_depth, color_type, interlace_method, compression_method, filter_method;
- png_get_IHDR(read_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
- &interlace_method, &compression_method, &filter_method);
-
- // When the image is read, expand it so that it is in RGBA 8888 format
- // so that image handling is uniform.
-
- if (color_type == PNG_COLOR_TYPE_PALETTE) {
- png_set_palette_to_rgb(read_ptr);
- }
-
- if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
- png_set_expand_gray_1_2_4_to_8(read_ptr);
- }
-
- if (png_get_valid(read_ptr, info_ptr, PNG_INFO_tRNS)) {
- png_set_tRNS_to_alpha(read_ptr);
- }
-
- if (bit_depth == 16) {
- png_set_strip_16(read_ptr);
- }
-
- if (!(color_type & PNG_COLOR_MASK_ALPHA)) {
- png_set_add_alpha(read_ptr, 0xFF, PNG_FILLER_AFTER);
- }
-
- if (color_type == PNG_COLOR_TYPE_GRAY ||
- color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
- png_set_gray_to_rgb(read_ptr);
- }
-
- if (interlace_method != PNG_INTERLACE_NONE) {
- png_set_interlace_handling(read_ptr);
- }
-
- // Once all the options for reading have been set, we need to flush
- // them to libpng.
- png_read_update_info(read_ptr, info_ptr);
-
- // 9-patch uses int32_t to index images, so we cap the image dimensions to
- // something
- // that can always be represented by 9-patch.
- if (width > std::numeric_limits<int32_t>::max() || height > std::numeric_limits<int32_t>::max()) {
- source_diag.Error(android::DiagMessage()
- << "PNG image dimensions are too large: " << width << "x" << height);
- return {};
- }
-
- std::unique_ptr<Image> output_image = util::make_unique<Image>();
- output_image->width = static_cast<int32_t>(width);
- output_image->height = static_cast<int32_t>(height);
-
- const size_t row_bytes = png_get_rowbytes(read_ptr, info_ptr);
- CHECK(row_bytes == 4 * width); // RGBA
-
- // Allocate one large block to hold the image.
- output_image->data = std::unique_ptr<uint8_t[]>(new uint8_t[height * row_bytes]);
-
- // Create an array of rows that index into the data block.
- output_image->rows = std::unique_ptr<uint8_t* []>(new uint8_t*[height]);
- for (uint32_t h = 0; h < height; h++) {
- output_image->rows[h] = output_image->data.get() + (h * row_bytes);
- }
-
- // Actually read the image pixels.
- png_read_image(read_ptr, output_image->rows.get());
-
- // Finish reading. This will read any other chunks after the image data.
- png_read_end(read_ptr, info_ptr);
-
- return output_image;
-}
-
-// Experimentally chosen constant to be added to the overhead of using color type
-// PNG_COLOR_TYPE_PALETTE to account for the uncompressability of the palette chunk.
-// Without this, many small PNGs encoded with palettes are larger after compression than
-// the same PNGs encoded as RGBA.
-constexpr static const size_t kPaletteOverheadConstant = 1024u * 10u;
-
-// Pick a color type by which to encode the image, based on which color type will take
-// the least amount of disk space.
-//
-// 9-patch images traditionally have not been encoded with palettes.
-// The original rationale was to avoid dithering until after scaling,
-// but I don't think this would be an issue with palettes. Either way,
-// our naive size estimation tends to be wrong for small images like 9-patches
-// and using palettes balloons the size of the resulting 9-patch.
-// In order to not regress in size, restrict 9-patch to not use palettes.
-
-// The options are:
-//
-// - RGB
-// - RGBA
-// - RGB + cheap alpha
-// - Color palette
-// - Color palette + cheap alpha
-// - Color palette + alpha palette
-// - Grayscale
-// - Grayscale + cheap alpha
-// - Grayscale + alpha
-//
-static int PickColorType(int32_t width, int32_t height, bool grayscale,
- bool convertible_to_grayscale, bool has_nine_patch,
- size_t color_palette_size, size_t alpha_palette_size) {
- const size_t palette_chunk_size = 16 + color_palette_size * 3;
- const size_t alpha_chunk_size = 16 + alpha_palette_size;
- const size_t color_alpha_data_chunk_size = 16 + 4 * width * height;
- const size_t color_data_chunk_size = 16 + 3 * width * height;
- const size_t grayscale_alpha_data_chunk_size = 16 + 2 * width * height;
- const size_t palette_data_chunk_size = 16 + width * height;
-
- if (grayscale) {
- if (alpha_palette_size == 0) {
- // This is the smallest the data can be.
- return PNG_COLOR_TYPE_GRAY;
- } else if (color_palette_size <= 256 && !has_nine_patch) {
- // This grayscale has alpha and can fit within a palette.
- // See if it is worth fitting into a palette.
- const size_t palette_threshold = palette_chunk_size + alpha_chunk_size +
- palette_data_chunk_size +
- kPaletteOverheadConstant;
- if (grayscale_alpha_data_chunk_size > palette_threshold) {
- return PNG_COLOR_TYPE_PALETTE;
- }
- }
- return PNG_COLOR_TYPE_GRAY_ALPHA;
- }
-
- if (color_palette_size <= 256 && !has_nine_patch) {
- // This image can fit inside a palette. Let's see if it is worth it.
- size_t total_size_with_palette =
- palette_data_chunk_size + palette_chunk_size;
- size_t total_size_without_palette = color_data_chunk_size;
- if (alpha_palette_size > 0) {
- total_size_with_palette += alpha_palette_size;
- total_size_without_palette = color_alpha_data_chunk_size;
- }
-
- if (total_size_without_palette >
- total_size_with_palette + kPaletteOverheadConstant) {
- return PNG_COLOR_TYPE_PALETTE;
- }
- }
-
- if (convertible_to_grayscale) {
- if (alpha_palette_size == 0) {
- return PNG_COLOR_TYPE_GRAY;
- } else {
- return PNG_COLOR_TYPE_GRAY_ALPHA;
- }
- }
-
- if (alpha_palette_size == 0) {
- return PNG_COLOR_TYPE_RGB;
- }
- return PNG_COLOR_TYPE_RGBA;
-}
-
-// Assigns indices to the color and alpha palettes, encodes them, and then invokes
-// png_set_PLTE/png_set_tRNS.
-// This must be done before writing image data.
-// Image data must be transformed to use the indices assigned within the palette.
-static void WritePalette(png_structp write_ptr, png_infop write_info_ptr,
- std::unordered_map<uint32_t, int>* color_palette,
- std::unordered_set<uint32_t>* alpha_palette) {
- CHECK(color_palette->size() <= 256);
- CHECK(alpha_palette->size() <= 256);
-
- // Populate the PNG palette struct and assign indices to the color palette.
-
- // Colors in the alpha palette should have smaller indices.
- // This will ensure that we can truncate the alpha palette if it is
- // smaller than the color palette.
- int index = 0;
- for (uint32_t color : *alpha_palette) {
- (*color_palette)[color] = index++;
- }
-
- // Assign the rest of the entries.
- for (auto& entry : *color_palette) {
- if (entry.second == -1) {
- entry.second = index++;
- }
- }
-
- // Create the PNG color palette struct.
- auto color_palette_bytes = std::unique_ptr<png_color[]>(new png_color[color_palette->size()]);
-
- std::unique_ptr<png_byte[]> alpha_palette_bytes;
- if (!alpha_palette->empty()) {
- alpha_palette_bytes = std::unique_ptr<png_byte[]>(new png_byte[alpha_palette->size()]);
- }
-
- for (const auto& entry : *color_palette) {
- const uint32_t color = entry.first;
- const int index = entry.second;
- CHECK(index >= 0);
- CHECK(static_cast<size_t>(index) < color_palette->size());
-
- png_colorp slot = color_palette_bytes.get() + index;
- slot->red = color >> 24;
- slot->green = color >> 16;
- slot->blue = color >> 8;
-
- const png_byte alpha = color & 0x000000ff;
- if (alpha != 0xff && alpha_palette_bytes) {
- CHECK(static_cast<size_t>(index) < alpha_palette->size());
- alpha_palette_bytes[index] = alpha;
- }
- }
-
- // The bytes get copied here, so it is safe to release color_palette_bytes at
- // the end of function
- // scope.
- png_set_PLTE(write_ptr, write_info_ptr, color_palette_bytes.get(), color_palette->size());
-
- if (alpha_palette_bytes) {
- png_set_tRNS(write_ptr, write_info_ptr, alpha_palette_bytes.get(), alpha_palette->size(),
- nullptr);
- }
-}
-
-// Write the 9-patch custom PNG chunks to write_info_ptr. This must be done
-// before writing image data.
-static void WriteNinePatch(png_structp write_ptr, png_infop write_info_ptr,
- const NinePatch* nine_patch) {
- // The order of the chunks is important.
- // 9-patch code in older platforms expects the 9-patch chunk to be last.
-
- png_unknown_chunk unknown_chunks[3];
- memset(unknown_chunks, 0, sizeof(unknown_chunks));
-
- size_t index = 0;
- size_t chunk_len = 0;
-
- std::unique_ptr<uint8_t[]> serialized_outline =
- nine_patch->SerializeRoundedRectOutline(&chunk_len);
- strcpy((char*)unknown_chunks[index].name, "npOl");
- unknown_chunks[index].size = chunk_len;
- unknown_chunks[index].data = (png_bytep)serialized_outline.get();
- unknown_chunks[index].location = PNG_HAVE_PLTE;
- index++;
-
- std::unique_ptr<uint8_t[]> serialized_layout_bounds;
- if (nine_patch->layout_bounds.nonZero()) {
- serialized_layout_bounds = nine_patch->SerializeLayoutBounds(&chunk_len);
- strcpy((char*)unknown_chunks[index].name, "npLb");
- unknown_chunks[index].size = chunk_len;
- unknown_chunks[index].data = (png_bytep)serialized_layout_bounds.get();
- unknown_chunks[index].location = PNG_HAVE_PLTE;
- index++;
- }
-
- std::unique_ptr<uint8_t[]> serialized_nine_patch = nine_patch->SerializeBase(&chunk_len);
- strcpy((char*)unknown_chunks[index].name, "npTc");
- unknown_chunks[index].size = chunk_len;
- unknown_chunks[index].data = (png_bytep)serialized_nine_patch.get();
- unknown_chunks[index].location = PNG_HAVE_PLTE;
- index++;
-
- // Handle all unknown chunks. We are manually setting the chunks here,
- // so we will only ever handle our custom chunks.
- png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_ALWAYS, nullptr, 0);
-
- // Set the actual chunks here. The data gets copied, so our buffers can
- // safely go out of scope.
- png_set_unknown_chunks(write_ptr, write_info_ptr, unknown_chunks, index);
-}
-
-bool WritePng(IAaptContext* context, const Image* image,
- const NinePatch* nine_patch, io::OutputStream* out,
- const PngOptions& options) {
- TRACE_CALL();
- // Create and initialize the write png_struct with the default error and
- // warning handlers.
- // The header version is also passed in to ensure that this was built against the same
- // version of libpng.
- png_structp write_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
- if (write_ptr == nullptr) {
- context->GetDiagnostics()->Error(android::DiagMessage()
- << "failed to create libpng write png_struct");
- return false;
- }
-
- // Allocate memory to store image header data.
- png_infop write_info_ptr = png_create_info_struct(write_ptr);
- if (write_info_ptr == nullptr) {
- context->GetDiagnostics()->Error(android::DiagMessage()
- << "failed to create libpng write png_info");
- png_destroy_write_struct(&write_ptr, nullptr);
- return false;
- }
-
- // Automatically release PNG resources at end of scope.
- PngWriteStructDeleter png_write_deleter(write_ptr, write_info_ptr);
-
- // libpng uses longjmp to jump to error handling routines.
- // setjmp will return true only if it was jumped to, aka, there was an error.
- if (setjmp(png_jmpbuf(write_ptr))) {
- return false;
- }
-
- // Handle warnings with our IDiagnostics.
- png_set_error_fn(write_ptr, (png_voidp)context->GetDiagnostics(), LogError, LogWarning);
-
- // Set up the write functions which write to our custom data sources.
- png_set_write_fn(write_ptr, (png_voidp)out, WriteDataToStream, nullptr);
-
- // We want small files and can take the performance hit to achieve this goal.
- png_set_compression_level(write_ptr, Z_BEST_COMPRESSION);
-
- // Begin analysis of the image data.
- // Scan the entire image and determine if:
- // 1. Every pixel has R == G == B (grayscale)
- // 2. Every pixel has A == 255 (opaque)
- // 3. There are no more than 256 distinct RGBA colors (palette).
- std::unordered_map<uint32_t, int> color_palette;
- std::unordered_set<uint32_t> alpha_palette;
- bool needs_to_zero_rgb_channels_of_transparent_pixels = false;
- bool grayscale = true;
- int max_gray_deviation = 0;
-
- for (int32_t y = 0; y < image->height; y++) {
- const uint8_t* row = image->rows[y];
- for (int32_t x = 0; x < image->width; x++) {
- int red = *row++;
- int green = *row++;
- int blue = *row++;
- int alpha = *row++;
-
- if (alpha == 0) {
- // The color is completely transparent.
- // For purposes of palettes and grayscale optimization,
- // treat all channels as 0x00.
- needs_to_zero_rgb_channels_of_transparent_pixels =
- needs_to_zero_rgb_channels_of_transparent_pixels ||
- (red != 0 || green != 0 || blue != 0);
- red = green = blue = 0;
- }
-
- // Insert the color into the color palette.
- const uint32_t color = red << 24 | green << 16 | blue << 8 | alpha;
- color_palette[color] = -1;
-
- // If the pixel has non-opaque alpha, insert it into the
- // alpha palette.
- if (alpha != 0xff) {
- alpha_palette.insert(color);
- }
-
- // Check if the image is indeed grayscale.
- if (grayscale) {
- if (red != green || red != blue) {
- grayscale = false;
- }
- }
-
- // Calculate the gray scale deviation so that it can be compared
- // with the threshold.
- max_gray_deviation = std::max(std::abs(red - green), max_gray_deviation);
- max_gray_deviation = std::max(std::abs(green - blue), max_gray_deviation);
- max_gray_deviation = std::max(std::abs(blue - red), max_gray_deviation);
- }
- }
-
- if (context->IsVerbose()) {
- android::DiagMessage msg;
- msg << " paletteSize=" << color_palette.size()
- << " alphaPaletteSize=" << alpha_palette.size()
- << " maxGrayDeviation=" << max_gray_deviation
- << " grayScale=" << (grayscale ? "true" : "false");
- context->GetDiagnostics()->Note(msg);
- }
-
- const bool convertible_to_grayscale = max_gray_deviation <= options.grayscale_tolerance;
-
- const int new_color_type = PickColorType(
- image->width, image->height, grayscale, convertible_to_grayscale,
- nine_patch != nullptr, color_palette.size(), alpha_palette.size());
-
- if (context->IsVerbose()) {
- android::DiagMessage msg;
- msg << "encoding PNG ";
- if (nine_patch) {
- msg << "(with 9-patch) as ";
- }
- switch (new_color_type) {
- case PNG_COLOR_TYPE_GRAY:
- msg << "GRAY";
- break;
- case PNG_COLOR_TYPE_GRAY_ALPHA:
- msg << "GRAY + ALPHA";
- break;
- case PNG_COLOR_TYPE_RGB:
- msg << "RGB";
- break;
- case PNG_COLOR_TYPE_RGB_ALPHA:
- msg << "RGBA";
- break;
- case PNG_COLOR_TYPE_PALETTE:
- msg << "PALETTE";
- break;
- default:
- msg << "unknown type " << new_color_type;
- break;
- }
- context->GetDiagnostics()->Note(msg);
- }
-
- png_set_IHDR(write_ptr, write_info_ptr, image->width, image->height, 8,
- new_color_type, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
- PNG_FILTER_TYPE_DEFAULT);
-
- if (new_color_type & PNG_COLOR_MASK_PALETTE) {
- // Assigns indices to the palette, and writes the encoded palette to the
- // libpng writePtr.
- WritePalette(write_ptr, write_info_ptr, &color_palette, &alpha_palette);
- png_set_filter(write_ptr, 0, PNG_NO_FILTERS);
- } else {
- png_set_filter(write_ptr, 0, PNG_ALL_FILTERS);
- }
-
- if (nine_patch) {
- WriteNinePatch(write_ptr, write_info_ptr, nine_patch);
- }
-
- // Flush our updates to the header.
- png_write_info(write_ptr, write_info_ptr);
-
- // Write out each row of image data according to its encoding.
- if (new_color_type == PNG_COLOR_TYPE_PALETTE) {
- // 1 byte/pixel.
- auto out_row = std::unique_ptr<png_byte[]>(new png_byte[image->width]);
-
- for (int32_t y = 0; y < image->height; y++) {
- png_const_bytep in_row = image->rows[y];
- for (int32_t x = 0; x < image->width; x++) {
- int rr = *in_row++;
- int gg = *in_row++;
- int bb = *in_row++;
- int aa = *in_row++;
- if (aa == 0) {
- // Zero out color channels when transparent.
- rr = gg = bb = 0;
- }
-
- const uint32_t color = rr << 24 | gg << 16 | bb << 8 | aa;
- const int idx = color_palette[color];
- CHECK(idx != -1);
- out_row[x] = static_cast<png_byte>(idx);
- }
- png_write_row(write_ptr, out_row.get());
- }
- } else if (new_color_type == PNG_COLOR_TYPE_GRAY ||
- new_color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
- const size_t bpp = new_color_type == PNG_COLOR_TYPE_GRAY ? 1 : 2;
- auto out_row =
- std::unique_ptr<png_byte[]>(new png_byte[image->width * bpp]);
-
- for (int32_t y = 0; y < image->height; y++) {
- png_const_bytep in_row = image->rows[y];
- for (int32_t x = 0; x < image->width; x++) {
- int rr = in_row[x * 4];
- int gg = in_row[x * 4 + 1];
- int bb = in_row[x * 4 + 2];
- int aa = in_row[x * 4 + 3];
- if (aa == 0) {
- // Zero out the gray channel when transparent.
- rr = gg = bb = 0;
- }
-
- if (grayscale) {
- // The image was already grayscale, red == green == blue.
- out_row[x * bpp] = in_row[x * 4];
- } else {
- // The image is convertible to grayscale, use linear-luminance of
- // sRGB colorspace:
- // https://en.wikipedia.org/wiki/Grayscale#Colorimetric_.28luminance-preserving.29_conversion_to_grayscale
- out_row[x * bpp] =
- (png_byte)(rr * 0.2126f + gg * 0.7152f + bb * 0.0722f);
- }
-
- if (bpp == 2) {
- // Write out alpha if we have it.
- out_row[x * bpp + 1] = aa;
- }
- }
- png_write_row(write_ptr, out_row.get());
- }
- } else if (new_color_type == PNG_COLOR_TYPE_RGB || new_color_type == PNG_COLOR_TYPE_RGBA) {
- const size_t bpp = new_color_type == PNG_COLOR_TYPE_RGB ? 3 : 4;
- if (needs_to_zero_rgb_channels_of_transparent_pixels) {
- // The source RGBA data can't be used as-is, because we need to zero out
- // the RGB values of transparent pixels.
- auto out_row = std::unique_ptr<png_byte[]>(new png_byte[image->width * bpp]);
-
- for (int32_t y = 0; y < image->height; y++) {
- png_const_bytep in_row = image->rows[y];
- for (int32_t x = 0; x < image->width; x++) {
- int rr = *in_row++;
- int gg = *in_row++;
- int bb = *in_row++;
- int aa = *in_row++;
- if (aa == 0) {
- // Zero out the RGB channels when transparent.
- rr = gg = bb = 0;
- }
- out_row[x * bpp] = rr;
- out_row[x * bpp + 1] = gg;
- out_row[x * bpp + 2] = bb;
- if (bpp == 4) {
- out_row[x * bpp + 3] = aa;
- }
- }
- png_write_row(write_ptr, out_row.get());
- }
- } else {
- // The source image can be used as-is, just tell libpng whether or not to
- // ignore the alpha channel.
- if (new_color_type == PNG_COLOR_TYPE_RGB) {
- // Delete the extraneous alpha values that we appended to our buffer
- // when reading the original values.
- png_set_filler(write_ptr, 0, PNG_FILLER_AFTER);
- }
- png_write_image(write_ptr, image->rows.get());
- }
- } else {
- LOG(FATAL) << "unreachable";
- }
-
- png_write_end(write_ptr, write_info_ptr);
- return true;
-}
-
-} // namespace aapt
diff --git a/tools/aapt2/dump/DumpManifest.cpp b/tools/aapt2/dump/DumpManifest.cpp
index a2b48187c24f..a5962292b5b0 100644
--- a/tools/aapt2/dump/DumpManifest.cpp
+++ b/tools/aapt2/dump/DumpManifest.cpp
@@ -29,8 +29,8 @@
#include "SdkConstants.h"
#include "ValueVisitor.h"
#include "androidfw/ConfigDescription.h"
+#include "androidfw/FileStream.h"
#include "io/File.h"
-#include "io/FileStream.h"
#include "process/IResourceTableConsumer.h"
#include "xml/XmlDom.h"
diff --git a/tools/aapt2/format/Archive.cpp b/tools/aapt2/format/Archive.cpp
index e9a93d8b12ad..91768a09ea59 100644
--- a/tools/aapt2/format/Archive.cpp
+++ b/tools/aapt2/format/Archive.cpp
@@ -91,7 +91,7 @@ class DirectoryWriter : public IArchiveWriter {
return true;
}
- bool WriteFile(StringPiece path, uint32_t flags, io::InputStream* in) override {
+ bool WriteFile(StringPiece path, uint32_t flags, android::InputStream* in) override {
if (!StartEntry(path, flags)) {
return false;
}
@@ -182,7 +182,7 @@ class ZipFileWriter : public IArchiveWriter {
return true;
}
- bool WriteFile(StringPiece path, uint32_t flags, io::InputStream* in) override {
+ bool WriteFile(StringPiece path, uint32_t flags, android::InputStream* in) override {
while (true) {
if (!StartEntry(path, flags)) {
return false;
diff --git a/tools/aapt2/format/Archive.h b/tools/aapt2/format/Archive.h
index 6cde753a255d..3c3d0ab74c52 100644
--- a/tools/aapt2/format/Archive.h
+++ b/tools/aapt2/format/Archive.h
@@ -24,9 +24,9 @@
#include "androidfw/BigBuffer.h"
#include "androidfw/IDiagnostics.h"
+#include "androidfw/Streams.h"
#include "androidfw/StringPiece.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
-#include "io/Io.h"
#include "util/Files.h"
namespace aapt {
@@ -46,7 +46,7 @@ class IArchiveWriter : public ::google::protobuf::io::CopyingOutputStream {
public:
virtual ~IArchiveWriter() = default;
- virtual bool WriteFile(android::StringPiece path, uint32_t flags, io::InputStream* in) = 0;
+ virtual bool WriteFile(android::StringPiece path, uint32_t flags, android::InputStream* in) = 0;
// Starts a new entry and allows caller to write bytes to it sequentially.
// Only use StartEntry if code you do not control needs to write to a CopyingOutputStream.
diff --git a/tools/aapt2/format/Archive_test.cpp b/tools/aapt2/format/Archive_test.cpp
index fd50af92ceee..df105f8a83e5 100644
--- a/tools/aapt2/format/Archive_test.cpp
+++ b/tools/aapt2/format/Archive_test.cpp
@@ -95,7 +95,7 @@ void VerifyDirectory(const std::string& path, const std::string& file, const uin
void VerifyZipFile(const std::string& output_path, const std::string& file, const uint8_t array[]) {
std::unique_ptr<io::ZipFileCollection> zip = io::ZipFileCollection::Create(output_path, nullptr);
- std::unique_ptr<io::InputStream> stream = zip->FindFile(file)->OpenInputStream();
+ std::unique_ptr<android::InputStream> stream = zip->FindFile(file)->OpenInputStream();
std::vector<uint8_t> buffer;
const void* data;
diff --git a/tools/aapt2/format/Container.cpp b/tools/aapt2/format/Container.cpp
index 1ff6c4996b91..cb4a225c73e7 100644
--- a/tools/aapt2/format/Container.cpp
+++ b/tools/aapt2/format/Container.cpp
@@ -94,7 +94,7 @@ bool ContainerWriter::AddResTableEntry(const pb::ResourceTable& table) {
}
bool ContainerWriter::AddResFileEntry(const pb::internal::CompiledFile& file,
- io::KnownSizeInputStream* in) {
+ android::KnownSizeInputStream* in) {
if (current_entry_count_ >= total_entry_count_) {
error_ = "too many entries being serialized";
return false;
@@ -264,7 +264,7 @@ std::string ContainerReaderEntry::GetError() const {
return reader_->GetError();
}
-ContainerReader::ContainerReader(io::InputStream* in)
+ContainerReader::ContainerReader(android::InputStream* in)
: in_(in),
adaptor_(in),
coded_in_(&adaptor_),
diff --git a/tools/aapt2/format/Container.h b/tools/aapt2/format/Container.h
index 121c592537bf..c5d567697a5a 100644
--- a/tools/aapt2/format/Container.h
+++ b/tools/aapt2/format/Container.h
@@ -22,9 +22,9 @@
#include "Resources.pb.h"
#include "ResourcesInternal.pb.h"
#include "androidfw/BigBuffer.h"
+#include "androidfw/Streams.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/zero_copy_stream.h"
-#include "io/Io.h"
#include "io/Util.h"
namespace aapt {
@@ -39,7 +39,7 @@ class ContainerWriter {
explicit ContainerWriter(::google::protobuf::io::ZeroCopyOutputStream* out, size_t entry_count);
bool AddResTableEntry(const pb::ResourceTable& table);
- bool AddResFileEntry(const pb::internal::CompiledFile& file, io::KnownSizeInputStream* in);
+ bool AddResFileEntry(const pb::internal::CompiledFile& file, android::KnownSizeInputStream* in);
bool HadError() const;
std::string GetError() const;
@@ -79,7 +79,7 @@ class ContainerReaderEntry {
class ContainerReader {
public:
- explicit ContainerReader(io::InputStream* in);
+ explicit ContainerReader(android::InputStream* in);
ContainerReaderEntry* Next();
@@ -91,7 +91,7 @@ class ContainerReader {
friend class ContainerReaderEntry;
- io::InputStream* in_;
+ android::InputStream* in_;
io::ZeroCopyInputAdaptor adaptor_;
::google::protobuf::io::CodedInputStream coded_in_;
size_t total_entry_count_;
diff --git a/tools/aapt2/io/BigBufferStream.cpp b/tools/aapt2/io/BigBufferStream.cpp
deleted file mode 100644
index 9704caae4719..000000000000
--- a/tools/aapt2/io/BigBufferStream.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "io/BigBufferStream.h"
-
-namespace aapt {
-namespace io {
-
-//
-// BigBufferInputStream
-//
-
-bool BigBufferInputStream::Next(const void** data, size_t* size) {
- if (iter_ == buffer_->end()) {
- return false;
- }
-
- if (offset_ == iter_->size) {
- ++iter_;
- if (iter_ == buffer_->end()) {
- return false;
- }
- offset_ = 0;
- }
-
- *data = iter_->buffer.get() + offset_;
- *size = iter_->size - offset_;
- bytes_read_ += iter_->size - offset_;
- offset_ = iter_->size;
- return true;
-}
-
-void BigBufferInputStream::BackUp(size_t count) {
- if (count > offset_) {
- bytes_read_ -= offset_;
- offset_ = 0;
- } else {
- offset_ -= count;
- bytes_read_ -= count;
- }
-}
-
-bool BigBufferInputStream::CanRewind() const {
- return true;
-}
-
-bool BigBufferInputStream::Rewind() {
- iter_ = buffer_->begin();
- offset_ = 0;
- bytes_read_ = 0;
- return true;
-}
-
-size_t BigBufferInputStream::ByteCount() const {
- return bytes_read_;
-}
-
-bool BigBufferInputStream::HadError() const {
- return false;
-}
-
-size_t BigBufferInputStream::TotalSize() const {
- return buffer_->size();
-}
-
-//
-// BigBufferOutputStream
-//
-
-bool BigBufferOutputStream::Next(void** data, size_t* size) {
- *data = buffer_->NextBlock(size);
- return true;
-}
-
-void BigBufferOutputStream::BackUp(size_t count) {
- buffer_->BackUp(count);
-}
-
-size_t BigBufferOutputStream::ByteCount() const {
- return buffer_->size();
-}
-
-bool BigBufferOutputStream::HadError() const {
- return false;
-}
-
-} // namespace io
-} // namespace aapt
diff --git a/tools/aapt2/io/BigBufferStream.h b/tools/aapt2/io/BigBufferStream.h
deleted file mode 100644
index 63a5e5756ed4..000000000000
--- a/tools/aapt2/io/BigBufferStream.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef AAPT_IO_BIGBUFFERSTREAM_H
-#define AAPT_IO_BIGBUFFERSTREAM_H
-
-#include "androidfw/BigBuffer.h"
-#include "io/Io.h"
-
-namespace aapt {
-namespace io {
-
-class BigBufferInputStream : public KnownSizeInputStream {
- public:
- inline explicit BigBufferInputStream(const android::BigBuffer* buffer)
- : buffer_(buffer), iter_(buffer->begin()) {
- }
- virtual ~BigBufferInputStream() = default;
-
- bool Next(const void** data, size_t* size) override;
-
- void BackUp(size_t count) override;
-
- bool CanRewind() const override;
-
- bool Rewind() override;
-
- size_t ByteCount() const override;
-
- bool HadError() const override;
-
- size_t TotalSize() const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BigBufferInputStream);
-
- const android::BigBuffer* buffer_;
- android::BigBuffer::const_iterator iter_;
- size_t offset_ = 0;
- size_t bytes_read_ = 0;
-};
-
-class BigBufferOutputStream : public OutputStream {
- public:
- inline explicit BigBufferOutputStream(android::BigBuffer* buffer) : buffer_(buffer) {
- }
- virtual ~BigBufferOutputStream() = default;
-
- bool Next(void** data, size_t* size) override;
-
- void BackUp(size_t count) override;
-
- size_t ByteCount() const override;
-
- bool HadError() const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BigBufferOutputStream);
-
- android::BigBuffer* buffer_;
-};
-
-} // namespace io
-} // namespace aapt
-
-#endif // AAPT_IO_BIGBUFFERSTREAM_H
diff --git a/tools/aapt2/io/Data.h b/tools/aapt2/io/Data.h
index db91a77a5ae6..29f523aeff1b 100644
--- a/tools/aapt2/io/Data.h
+++ b/tools/aapt2/io/Data.h
@@ -20,15 +20,14 @@
#include <memory>
#include "android-base/macros.h"
+#include "androidfw/Streams.h"
#include "utils/FileMap.h"
-#include "io/Io.h"
-
namespace aapt {
namespace io {
// Interface for a block of contiguous memory. An instance of this interface owns the data.
-class IData : public KnownSizeInputStream {
+class IData : public android::KnownSizeInputStream {
public:
virtual ~IData() = default;
diff --git a/tools/aapt2/io/File.cpp b/tools/aapt2/io/File.cpp
index b4f1ff3a5b49..4dfdb5bb8ad9 100644
--- a/tools/aapt2/io/File.cpp
+++ b/tools/aapt2/io/File.cpp
@@ -39,7 +39,7 @@ std::unique_ptr<IData> FileSegment::OpenAsData() {
return {};
}
-std::unique_ptr<io::InputStream> FileSegment::OpenInputStream() {
+std::unique_ptr<android::InputStream> FileSegment::OpenInputStream() {
return OpenAsData();
}
diff --git a/tools/aapt2/io/File.h b/tools/aapt2/io/File.h
index 673d1b75e660..248756b51f2e 100644
--- a/tools/aapt2/io/File.h
+++ b/tools/aapt2/io/File.h
@@ -43,7 +43,7 @@ class IFile {
// Returns nullptr on failure.
virtual std::unique_ptr<IData> OpenAsData() = 0;
- virtual std::unique_ptr<io::InputStream> OpenInputStream() = 0;
+ virtual std::unique_ptr<android::InputStream> OpenInputStream() = 0;
// Returns the source of this file. This is for presentation to the user and
// may not be a valid file system path (for example, it may contain a '@' sign to separate
@@ -78,7 +78,7 @@ class FileSegment : public IFile {
: file_(file), offset_(offset), len_(len) {}
std::unique_ptr<IData> OpenAsData() override;
- std::unique_ptr<io::InputStream> OpenInputStream() override;
+ std::unique_ptr<android::InputStream> OpenInputStream() override;
const android::Source& GetSource() const override {
return file_->GetSource();
diff --git a/tools/aapt2/io/FileStream.cpp b/tools/aapt2/io/FileStream.cpp
deleted file mode 100644
index 27529bc08a16..000000000000
--- a/tools/aapt2/io/FileStream.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "io/FileStream.h"
-
-#include <errno.h> // for errno
-#include <fcntl.h> // for O_RDONLY
-#include <unistd.h> // for read
-
-#include "android-base/errors.h"
-#include "android-base/file.h" // for O_BINARY
-#include "android-base/macros.h"
-#include "android-base/utf8.h"
-
-#if defined(_WIN32)
-// This is only needed for O_CLOEXEC.
-#include <windows.h>
-#define O_CLOEXEC O_NOINHERIT
-#endif
-
-using ::android::base::SystemErrorCodeToString;
-using ::android::base::unique_fd;
-
-namespace aapt {
-namespace io {
-
-FileInputStream::FileInputStream(const std::string& path, size_t buffer_capacity)
- : buffer_capacity_(buffer_capacity) {
- int mode = O_RDONLY | O_CLOEXEC | O_BINARY;
- fd_.reset(TEMP_FAILURE_RETRY(::android::base::utf8::open(path.c_str(), mode)));
- if (fd_ == -1) {
- error_ = SystemErrorCodeToString(errno);
- } else {
- buffer_.reset(new uint8_t[buffer_capacity_]);
- }
-}
-
-FileInputStream::FileInputStream(int fd, size_t buffer_capacity)
- : fd_(fd), buffer_capacity_(buffer_capacity) {
- if (fd_ < 0) {
- error_ = "Bad File Descriptor";
- } else {
- buffer_.reset(new uint8_t[buffer_capacity_]);
- }
-}
-
-bool FileInputStream::Next(const void** data, size_t* size) {
- if (HadError()) {
- return false;
- }
-
- // Deal with any remaining bytes after BackUp was called.
- if (buffer_offset_ != buffer_size_) {
- *data = buffer_.get() + buffer_offset_;
- *size = buffer_size_ - buffer_offset_;
- total_byte_count_ += buffer_size_ - buffer_offset_;
- buffer_offset_ = buffer_size_;
- return true;
- }
-
- ssize_t n = TEMP_FAILURE_RETRY(read(fd_, buffer_.get(), buffer_capacity_));
- if (n < 0) {
- error_ = SystemErrorCodeToString(errno);
- fd_.reset();
- buffer_.reset();
- return false;
- }
-
- buffer_size_ = static_cast<size_t>(n);
- buffer_offset_ = buffer_size_;
- total_byte_count_ += buffer_size_;
-
- *data = buffer_.get();
- *size = buffer_size_;
- return buffer_size_ != 0u;
-}
-
-void FileInputStream::BackUp(size_t count) {
- if (count > buffer_offset_) {
- count = buffer_offset_;
- }
- buffer_offset_ -= count;
- total_byte_count_ -= count;
-}
-
-size_t FileInputStream::ByteCount() const {
- return total_byte_count_;
-}
-
-bool FileInputStream::HadError() const {
- return fd_ == -1;
-}
-
-std::string FileInputStream::GetError() const {
- return error_;
-}
-
-FileOutputStream::FileOutputStream(const std::string& path, size_t buffer_capacity)
- : buffer_capacity_(buffer_capacity) {
- int mode = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_BINARY;
- owned_fd_.reset(TEMP_FAILURE_RETRY(::android::base::utf8::open(path.c_str(), mode, 0666)));
- fd_ = owned_fd_.get();
- if (fd_ < 0) {
- error_ = SystemErrorCodeToString(errno);
- } else {
- buffer_.reset(new uint8_t[buffer_capacity_]);
- }
-}
-
-FileOutputStream::FileOutputStream(unique_fd fd, size_t buffer_capacity)
- : FileOutputStream(fd.get(), buffer_capacity) {
- owned_fd_ = std::move(fd);
-}
-
-FileOutputStream::FileOutputStream(int fd, size_t buffer_capacity)
- : fd_(fd), buffer_capacity_(buffer_capacity) {
- if (fd_ < 0) {
- error_ = "Bad File Descriptor";
- } else {
- buffer_.reset(new uint8_t[buffer_capacity_]);
- }
-}
-
-FileOutputStream::~FileOutputStream() {
- // Flush the buffer.
- Flush();
-}
-
-bool FileOutputStream::Next(void** data, size_t* size) {
- if (HadError()) {
- return false;
- }
-
- if (buffer_offset_ == buffer_capacity_) {
- if (!FlushImpl()) {
- return false;
- }
- }
-
- const size_t buffer_size = buffer_capacity_ - buffer_offset_;
- *data = buffer_.get() + buffer_offset_;
- *size = buffer_size;
- total_byte_count_ += buffer_size;
- buffer_offset_ = buffer_capacity_;
- return true;
-}
-
-void FileOutputStream::BackUp(size_t count) {
- if (count > buffer_offset_) {
- count = buffer_offset_;
- }
- buffer_offset_ -= count;
- total_byte_count_ -= count;
-}
-
-size_t FileOutputStream::ByteCount() const {
- return total_byte_count_;
-}
-
-bool FileOutputStream::Flush() {
- if (!HadError()) {
- return FlushImpl();
- }
- return false;
-}
-
-bool FileOutputStream::FlushImpl() {
- ssize_t n = TEMP_FAILURE_RETRY(write(fd_, buffer_.get(), buffer_offset_));
- if (n < 0) {
- error_ = SystemErrorCodeToString(errno);
- owned_fd_.reset();
- fd_ = -1;
- buffer_.reset();
- return false;
- }
-
- buffer_offset_ = 0u;
- return true;
-}
-
-bool FileOutputStream::HadError() const {
- return fd_ == -1;
-}
-
-std::string FileOutputStream::GetError() const {
- return error_;
-}
-
-} // namespace io
-} // namespace aapt
diff --git a/tools/aapt2/io/FileStream.h b/tools/aapt2/io/FileStream.h
deleted file mode 100644
index 62d910f0b06a..000000000000
--- a/tools/aapt2/io/FileStream.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef AAPT_IO_FILESTREAM_H
-#define AAPT_IO_FILESTREAM_H
-
-#include "io/Io.h"
-
-#include <memory>
-#include <string>
-
-#include "android-base/macros.h"
-#include "android-base/unique_fd.h"
-
-namespace aapt {
-namespace io {
-
-constexpr size_t kDefaultBufferCapacity = 4096u;
-
-class FileInputStream : public InputStream {
- public:
- explicit FileInputStream(const std::string& path,
- size_t buffer_capacity = kDefaultBufferCapacity);
-
- // Take ownership of `fd`.
- explicit FileInputStream(int fd, size_t buffer_capacity = kDefaultBufferCapacity);
-
- bool Next(const void** data, size_t* size) override;
-
- void BackUp(size_t count) override;
-
- size_t ByteCount() const override;
-
- bool HadError() const override;
-
- std::string GetError() const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(FileInputStream);
-
- android::base::unique_fd fd_;
- std::string error_;
- std::unique_ptr<uint8_t[]> buffer_;
- size_t buffer_capacity_ = 0u;
- size_t buffer_offset_ = 0u;
- size_t buffer_size_ = 0u;
- size_t total_byte_count_ = 0u;
-};
-
-class FileOutputStream : public OutputStream {
- public:
- explicit FileOutputStream(const std::string& path,
- size_t buffer_capacity = kDefaultBufferCapacity);
-
- // Does not take ownership of `fd`.
- explicit FileOutputStream(int fd, size_t buffer_capacity = kDefaultBufferCapacity);
-
- // Takes ownership of `fd`.
- explicit FileOutputStream(android::base::unique_fd fd,
- size_t buffer_capacity = kDefaultBufferCapacity);
-
- ~FileOutputStream();
-
- bool Next(void** data, size_t* size) override;
-
- // Immediately flushes out the contents of the buffer to disk.
- bool Flush();
-
- void BackUp(size_t count) override;
-
- size_t ByteCount() const override;
-
- bool HadError() const override;
-
- std::string GetError() const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(FileOutputStream);
-
- bool FlushImpl();
-
- android::base::unique_fd owned_fd_;
- int fd_;
- std::string error_;
- std::unique_ptr<uint8_t[]> buffer_;
- size_t buffer_capacity_ = 0u;
- size_t buffer_offset_ = 0u;
- size_t total_byte_count_ = 0u;
-};
-
-} // namespace io
-} // namespace aapt
-
-#endif // AAPT_IO_FILESTREAM_H
diff --git a/tools/aapt2/io/FileStream_test.cpp b/tools/aapt2/io/FileStream_test.cpp
deleted file mode 100644
index cc9cd2808a0c..000000000000
--- a/tools/aapt2/io/FileStream_test.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "io/FileStream.h"
-
-#include "android-base/file.h"
-#include "android-base/macros.h"
-
-#include "test/Test.h"
-
-using ::android::StringPiece;
-using ::testing::Eq;
-using ::testing::NotNull;
-using ::testing::StrEq;
-
-namespace aapt {
-namespace io {
-
-TEST(FileInputStreamTest, NextAndBackup) {
- std::string input = "this is a cool string";
- TemporaryFile file;
- ASSERT_THAT(TEMP_FAILURE_RETRY(write(file.fd, input.c_str(), input.size())), Eq(21));
- lseek64(file.fd, 0, SEEK_SET);
-
- // Use a small buffer size so that we can call Next() a few times.
- FileInputStream in(file.release(), 10u);
- ASSERT_FALSE(in.HadError());
- EXPECT_THAT(in.ByteCount(), Eq(0u));
-
- const void* buffer;
- size_t size;
- ASSERT_TRUE(in.Next(&buffer, &size)) << in.GetError();
- ASSERT_THAT(size, Eq(10u));
- ASSERT_THAT(buffer, NotNull());
- EXPECT_THAT(in.ByteCount(), Eq(10u));
- EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("this is a "));
-
- ASSERT_TRUE(in.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(10u));
- ASSERT_THAT(buffer, NotNull());
- EXPECT_THAT(in.ByteCount(), Eq(20u));
- EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("cool strin"));
-
- in.BackUp(5u);
- EXPECT_THAT(in.ByteCount(), Eq(15u));
-
- ASSERT_TRUE(in.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(5u));
- ASSERT_THAT(buffer, NotNull());
- ASSERT_THAT(in.ByteCount(), Eq(20u));
- EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("strin"));
-
- // Backup 1 more than possible. Should clamp.
- in.BackUp(11u);
- EXPECT_THAT(in.ByteCount(), Eq(10u));
-
- ASSERT_TRUE(in.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(10u));
- ASSERT_THAT(buffer, NotNull());
- ASSERT_THAT(in.ByteCount(), Eq(20u));
- EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("cool strin"));
-
- ASSERT_TRUE(in.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(1u));
- ASSERT_THAT(buffer, NotNull());
- ASSERT_THAT(in.ByteCount(), Eq(21u));
- EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("g"));
-
- EXPECT_FALSE(in.Next(&buffer, &size));
- EXPECT_FALSE(in.HadError());
-}
-
-TEST(FileOutputStreamTest, NextAndBackup) {
- const std::string input = "this is a cool string";
-
- TemporaryFile file;
-
- FileOutputStream out(file.fd, 10u);
- ASSERT_FALSE(out.HadError());
- EXPECT_THAT(out.ByteCount(), Eq(0u));
-
- void* buffer;
- size_t size;
- ASSERT_TRUE(out.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(10u));
- ASSERT_THAT(buffer, NotNull());
- EXPECT_THAT(out.ByteCount(), Eq(10u));
- memcpy(reinterpret_cast<char*>(buffer), input.c_str(), size);
-
- ASSERT_TRUE(out.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(10u));
- ASSERT_THAT(buffer, NotNull());
- EXPECT_THAT(out.ByteCount(), Eq(20u));
- memcpy(reinterpret_cast<char*>(buffer), input.c_str() + 10u, size);
-
- ASSERT_TRUE(out.Next(&buffer, &size));
- ASSERT_THAT(size, Eq(10u));
- ASSERT_THAT(buffer, NotNull());
- EXPECT_THAT(out.ByteCount(), Eq(30u));
- reinterpret_cast<char*>(buffer)[0] = input[20u];
- out.BackUp(size - 1);
- EXPECT_THAT(out.ByteCount(), Eq(21u));
-
- ASSERT_TRUE(out.Flush());
-
- lseek64(file.fd, 0, SEEK_SET);
-
- std::string actual;
- ASSERT_TRUE(android::base::ReadFdToString(file.fd, &actual));
- EXPECT_THAT(actual, StrEq(input));
-}
-
-} // namespace io
-} // namespace aapt
diff --git a/tools/aapt2/io/FileSystem.cpp b/tools/aapt2/io/FileSystem.cpp
index 6a692e497816..03fabcc4dcce 100644
--- a/tools/aapt2/io/FileSystem.cpp
+++ b/tools/aapt2/io/FileSystem.cpp
@@ -22,9 +22,9 @@
#include <sys/stat.h>
#include "android-base/errors.h"
+#include "androidfw/FileStream.h"
#include "androidfw/Source.h"
#include "androidfw/StringPiece.h"
-#include "io/FileStream.h"
#include "util/Files.h"
#include "util/Util.h"
#include "utils/FileMap.h"
@@ -49,8 +49,8 @@ std::unique_ptr<IData> RegularFile::OpenAsData() {
return {};
}
-std::unique_ptr<io::InputStream> RegularFile::OpenInputStream() {
- return util::make_unique<FileInputStream>(source_.path);
+std::unique_ptr<android::InputStream> RegularFile::OpenInputStream() {
+ return util::make_unique<android::FileInputStream>(source_.path);
}
const android::Source& RegularFile::GetSource() const {
diff --git a/tools/aapt2/io/FileSystem.h b/tools/aapt2/io/FileSystem.h
index f975196b9cfa..d6ecfebab67d 100644
--- a/tools/aapt2/io/FileSystem.h
+++ b/tools/aapt2/io/FileSystem.h
@@ -30,7 +30,7 @@ class RegularFile : public IFile {
explicit RegularFile(const android::Source& source);
std::unique_ptr<IData> OpenAsData() override;
- std::unique_ptr<io::InputStream> OpenInputStream() override;
+ std::unique_ptr<android::InputStream> OpenInputStream() override;
const android::Source& GetSource() const override;
bool GetModificationTime(struct tm* buf) const override;
diff --git a/tools/aapt2/io/Io.h b/tools/aapt2/io/Io.h
deleted file mode 100644
index e1df23a698f5..000000000000
--- a/tools/aapt2/io/Io.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef AAPT_IO_IO_H
-#define AAPT_IO_IO_H
-
-#include <string>
-
-namespace aapt {
-namespace io {
-
-// InputStream interface that mimics protobuf's ZeroCopyInputStream,
-// with added error handling methods to better report issues.
-class InputStream {
- public:
- virtual ~InputStream() = default;
-
- // Returns a chunk of data for reading. data and size must not be nullptr.
- // Returns true so long as there is more data to read, returns false if an error occurred
- // or no data remains. If an error occurred, check HadError().
- // The stream owns the buffer returned from this method and the buffer is invalidated
- // anytime another mutable method is called.
- virtual bool Next(const void** data, size_t* size) = 0;
-
- // Backup count bytes, where count is smaller or equal to the size of the last buffer returned
- // from Next().
- // Useful when the last block returned from Next() wasn't fully read.
- virtual void BackUp(size_t count) = 0;
-
- // Returns true if this InputStream can rewind. If so, Rewind() can be called.
- virtual bool CanRewind() const { return false; };
-
- // Rewinds the stream to the beginning so it can be read again.
- // Returns true if the rewind succeeded.
- // This does nothing if CanRewind() returns false.
- virtual bool Rewind() { return false; }
-
- // Returns the number of bytes that have been read from the stream.
- virtual size_t ByteCount() const = 0;
-
- // Returns an error message if HadError() returned true.
- virtual std::string GetError() const { return {}; }
-
- // Returns true if an error occurred. Errors are permanent.
- virtual bool HadError() const = 0;
-};
-
-// A sub-InputStream interface that knows the total size of its stream.
-class KnownSizeInputStream : public InputStream {
- public:
- virtual size_t TotalSize() const = 0;
-};
-
-// OutputStream interface that mimics protobuf's ZeroCopyOutputStream,
-// with added error handling methods to better report issues.
-class OutputStream {
- public:
- virtual ~OutputStream() = default;
-
- // Returns a buffer to which data can be written to. The data written to this buffer will
- // eventually be written to the stream. Call BackUp() if the data written doesn't occupy the
- // entire buffer.
- // Return false if there was an error.
- // The stream owns the buffer returned from this method and the buffer is invalidated
- // anytime another mutable method is called.
- virtual bool Next(void** data, size_t* size) = 0;
-
- // Backup count bytes, where count is smaller or equal to the size of the last buffer returned
- // from Next().
- // Useful for when the last block returned from Next() wasn't fully written to.
- virtual void BackUp(size_t count) = 0;
-
- // Returns the number of bytes that have been written to the stream.
- virtual size_t ByteCount() const = 0;
-
- // Returns an error message if HadError() returned true.
- virtual std::string GetError() const { return {}; }
-
- // Returns true if an error occurred. Errors are permanent.
- virtual bool HadError() const = 0;
-};
-
-} // namespace io
-} // namespace aapt
-
-#endif /* AAPT_IO_IO_H */
diff --git a/tools/aapt2/io/StringStream.cpp b/tools/aapt2/io/StringStream.cpp
index 9c497882b99b..bb3911b20175 100644
--- a/tools/aapt2/io/StringStream.cpp
+++ b/tools/aapt2/io/StringStream.cpp
@@ -51,6 +51,23 @@ size_t StringInputStream::TotalSize() const {
return str_.size();
}
+bool StringInputStream::ReadFullyAtOffset(void* data, size_t byte_count, off64_t offset) {
+ if (byte_count == 0) {
+ return true;
+ }
+ if (offset < 0) {
+ return false;
+ }
+ if (offset > std::numeric_limits<off64_t>::max() - byte_count) {
+ return false;
+ }
+ if (offset + byte_count > str_.size()) {
+ return false;
+ }
+ memcpy(data, str_.data() + offset, byte_count);
+ return true;
+}
+
StringOutputStream::StringOutputStream(std::string* str, size_t buffer_capacity)
: str_(str),
buffer_capacity_(buffer_capacity),
diff --git a/tools/aapt2/io/StringStream.h b/tools/aapt2/io/StringStream.h
index f7bdecca0dee..7e1abe583170 100644
--- a/tools/aapt2/io/StringStream.h
+++ b/tools/aapt2/io/StringStream.h
@@ -17,17 +17,16 @@
#ifndef AAPT_IO_STRINGSTREAM_H
#define AAPT_IO_STRINGSTREAM_H
-#include "io/Io.h"
-
#include <memory>
#include "android-base/macros.h"
+#include "androidfw/Streams.h"
#include "androidfw/StringPiece.h"
namespace aapt {
namespace io {
-class StringInputStream : public KnownSizeInputStream {
+class StringInputStream : public android::KnownSizeInputStream {
public:
explicit StringInputStream(android::StringPiece str);
@@ -47,6 +46,8 @@ class StringInputStream : public KnownSizeInputStream {
size_t TotalSize() const override;
+ bool ReadFullyAtOffset(void* data, size_t byte_count, off64_t offset) override;
+
private:
DISALLOW_COPY_AND_ASSIGN(StringInputStream);
@@ -54,7 +55,7 @@ class StringInputStream : public KnownSizeInputStream {
size_t offset_;
};
-class StringOutputStream : public OutputStream {
+class StringOutputStream : public android::OutputStream {
public:
explicit StringOutputStream(std::string* str, size_t buffer_capacity = 4096u);
diff --git a/tools/aapt2/io/Util.cpp b/tools/aapt2/io/Util.cpp
index 79d8d527fe8b..9616e479eda0 100644
--- a/tools/aapt2/io/Util.cpp
+++ b/tools/aapt2/io/Util.cpp
@@ -26,8 +26,9 @@ using ::google::protobuf::io::ZeroCopyOutputStream;
namespace aapt {
namespace io {
-bool CopyInputStreamToArchive(IAaptContext* context, InputStream* in, std::string_view out_path,
- uint32_t compression_flags, IArchiveWriter* writer) {
+bool CopyInputStreamToArchive(IAaptContext* context, android::InputStream* in,
+ std::string_view out_path, uint32_t compression_flags,
+ IArchiveWriter* writer) {
TRACE_CALL();
if (context->IsVerbose()) {
context->GetDiagnostics()->Note(android::DiagMessage()
@@ -91,7 +92,7 @@ bool CopyProtoToArchive(IAaptContext* context, ::google::protobuf::Message* prot
return false;
}
-bool Copy(OutputStream* out, InputStream* in) {
+bool Copy(android::OutputStream* out, android::InputStream* in) {
TRACE_CALL();
const void* in_buffer;
size_t in_len;
@@ -110,7 +111,7 @@ bool Copy(OutputStream* out, InputStream* in) {
return !in->HadError();
}
-bool Copy(OutputStream* out, StringPiece in) {
+bool Copy(android::OutputStream* out, StringPiece in) {
const char* in_buffer = in.data();
size_t in_len = in.size();
while (in_len != 0) {
@@ -129,7 +130,7 @@ bool Copy(OutputStream* out, StringPiece in) {
return true;
}
-bool Copy(ZeroCopyOutputStream* out, InputStream* in) {
+bool Copy(ZeroCopyOutputStream* out, android::InputStream* in) {
OutputStreamAdaptor adaptor(out);
return Copy(&adaptor, in);
}
diff --git a/tools/aapt2/io/Util.h b/tools/aapt2/io/Util.h
index 685f522a2e71..25aa8f8d1916 100644
--- a/tools/aapt2/io/Util.h
+++ b/tools/aapt2/io/Util.h
@@ -19,18 +19,19 @@
#include <string_view>
+#include "androidfw/Streams.h"
#include "format/Archive.h"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/message.h"
#include "io/File.h"
-#include "io/Io.h"
#include "process/IResourceTableConsumer.h"
namespace aapt {
namespace io {
-bool CopyInputStreamToArchive(IAaptContext* context, InputStream* in, std::string_view out_path,
- uint32_t compression_flags, IArchiveWriter* writer);
+bool CopyInputStreamToArchive(IAaptContext* context, android::InputStream* in,
+ std::string_view out_path, uint32_t compression_flags,
+ IArchiveWriter* writer);
bool CopyFileToArchive(IAaptContext* context, IFile* file, std::string_view out_path,
uint32_t compression_flags, IArchiveWriter* writer);
@@ -44,11 +45,11 @@ bool CopyProtoToArchive(IAaptContext* context, ::google::protobuf::Message* prot
// Copies the data from in to out. Returns false if there was an error.
// If there was an error, check the individual streams' HadError/GetError methods.
-bool Copy(OutputStream* out, InputStream* in);
-bool Copy(OutputStream* out, android::StringPiece in);
-bool Copy(::google::protobuf::io::ZeroCopyOutputStream* out, InputStream* in);
+bool Copy(android::OutputStream* out, android::InputStream* in);
+bool Copy(android::OutputStream* out, android::StringPiece in);
+bool Copy(::google::protobuf::io::ZeroCopyOutputStream* out, android::InputStream* in);
-class OutputStreamAdaptor : public io::OutputStream {
+class OutputStreamAdaptor : public android::OutputStream {
public:
explicit OutputStreamAdaptor(::google::protobuf::io::ZeroCopyOutputStream* out) : out_(out) {
}
@@ -84,7 +85,7 @@ class OutputStreamAdaptor : public io::OutputStream {
class ZeroCopyInputAdaptor : public ::google::protobuf::io::ZeroCopyInputStream {
public:
- explicit ZeroCopyInputAdaptor(io::InputStream* in) : in_(in) {
+ explicit ZeroCopyInputAdaptor(android::InputStream* in) : in_(in) {
}
bool Next(const void** data, int* size) override {
@@ -119,12 +120,13 @@ class ZeroCopyInputAdaptor : public ::google::protobuf::io::ZeroCopyInputStream
private:
DISALLOW_COPY_AND_ASSIGN(ZeroCopyInputAdaptor);
- io::InputStream* in_;
+ android::InputStream* in_;
};
class ProtoInputStreamReader {
public:
- explicit ProtoInputStreamReader(io::InputStream* in) : in_(in) { }
+ explicit ProtoInputStreamReader(android::InputStream* in) : in_(in) {
+ }
/** Deserializes a Message proto from the current position in the input stream.*/
template <typename T> bool ReadMessage(T *message) {
@@ -135,7 +137,7 @@ class ProtoInputStreamReader {
}
private:
- io::InputStream* in_;
+ android::InputStream* in_;
};
} // namespace io
diff --git a/tools/aapt2/io/ZipArchive.cpp b/tools/aapt2/io/ZipArchive.cpp
index cb5bbe96b8b7..e44d61e08899 100644
--- a/tools/aapt2/io/ZipArchive.cpp
+++ b/tools/aapt2/io/ZipArchive.cpp
@@ -63,7 +63,7 @@ std::unique_ptr<IData> ZipFile::OpenAsData() {
}
}
-std::unique_ptr<io::InputStream> ZipFile::OpenInputStream() {
+std::unique_ptr<android::InputStream> ZipFile::OpenInputStream() {
return OpenAsData();
}
diff --git a/tools/aapt2/io/ZipArchive.h b/tools/aapt2/io/ZipArchive.h
index ac125d097983..a53c4a2e39f8 100644
--- a/tools/aapt2/io/ZipArchive.h
+++ b/tools/aapt2/io/ZipArchive.h
@@ -35,7 +35,7 @@ class ZipFile : public IFile {
ZipFile(::ZipArchiveHandle handle, const ::ZipEntry& entry, const android::Source& source);
std::unique_ptr<IData> OpenAsData() override;
- std::unique_ptr<io::InputStream> OpenInputStream() override;
+ std::unique_ptr<android::InputStream> OpenInputStream() override;
const android::Source& GetSource() const override;
bool WasCompressed() override;
bool GetModificationTime(struct tm* buf) const override;
diff --git a/tools/aapt2/java/ClassDefinition.cpp b/tools/aapt2/java/ClassDefinition.cpp
index 98f3bd2018b0..db7aa35d5ad4 100644
--- a/tools/aapt2/java/ClassDefinition.cpp
+++ b/tools/aapt2/java/ClassDefinition.cpp
@@ -111,7 +111,7 @@ constexpr static const char* sWarningHeader =
" */\n\n";
void ClassDefinition::WriteJavaFile(const ClassDefinition* def, StringPiece package, bool final,
- bool strip_api_annotations, io::OutputStream* out) {
+ bool strip_api_annotations, android::OutputStream* out) {
Printer printer(out);
printer.Print(sWarningHeader).Print("package ").Print(package).Println(";");
printer.Println();
diff --git a/tools/aapt2/java/ClassDefinition.h b/tools/aapt2/java/ClassDefinition.h
index 63c99821a836..84e3f33db941 100644
--- a/tools/aapt2/java/ClassDefinition.h
+++ b/tools/aapt2/java/ClassDefinition.h
@@ -241,7 +241,7 @@ enum class ClassQualifier { kNone, kStatic };
class ClassDefinition : public ClassMember {
public:
static void WriteJavaFile(const ClassDefinition* def, android::StringPiece package, bool final,
- bool strip_api_annotations, io::OutputStream* out);
+ bool strip_api_annotations, android::OutputStream* out);
ClassDefinition(android::StringPiece name, ClassQualifier qualifier, bool createIfEmpty)
: name_(name), qualifier_(qualifier), create_if_empty_(createIfEmpty) {
diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp
index 7665d0e8d9cb..58f656458177 100644
--- a/tools/aapt2/java/JavaClassGenerator.cpp
+++ b/tools/aapt2/java/JavaClassGenerator.cpp
@@ -37,8 +37,8 @@
#include "java/ClassDefinition.h"
#include "process/SymbolTable.h"
-using ::aapt::io::OutputStream;
using ::aapt::text::Printer;
+using ::android::OutputStream;
using ::android::StringPiece;
using ::android::base::StringPrintf;
diff --git a/tools/aapt2/java/JavaClassGenerator.h b/tools/aapt2/java/JavaClassGenerator.h
index 234df04472ce..9909eeccb6ac 100644
--- a/tools/aapt2/java/JavaClassGenerator.h
+++ b/tools/aapt2/java/JavaClassGenerator.h
@@ -19,11 +19,10 @@
#include <string>
-#include "androidfw/StringPiece.h"
-
#include "ResourceTable.h"
#include "ResourceValues.h"
-#include "io/Io.h"
+#include "androidfw/Streams.h"
+#include "androidfw/StringPiece.h"
#include "process/IResourceTableConsumer.h"
#include "process/SymbolTable.h"
#include "text/Printer.h"
@@ -70,12 +69,12 @@ class JavaClassGenerator {
// All symbols technically belong to a single package, but linked libraries will
// have their names mangled, denoting that they came from a different package.
// We need to generate these symbols in a separate file. Returns true on success.
- bool Generate(android::StringPiece package_name_to_generate, io::OutputStream* out,
- io::OutputStream* out_r_txt = nullptr);
+ bool Generate(android::StringPiece package_name_to_generate, android::OutputStream* out,
+ android::OutputStream* out_r_txt = nullptr);
bool Generate(android::StringPiece package_name_to_generate,
- android::StringPiece output_package_name, io::OutputStream* out,
- io::OutputStream* out_r_txt = nullptr);
+ android::StringPiece output_package_name, android::OutputStream* out,
+ android::OutputStream* out_r_txt = nullptr);
const std::string& GetError() const;
diff --git a/tools/aapt2/java/ProguardRules.cpp b/tools/aapt2/java/ProguardRules.cpp
index 80a46d553960..aef48fc102d7 100644
--- a/tools/aapt2/java/ProguardRules.cpp
+++ b/tools/aapt2/java/ProguardRules.cpp
@@ -29,8 +29,8 @@
#include "util/Util.h"
#include "xml/XmlDom.h"
-using ::aapt::io::OutputStream;
using ::aapt::text::Printer;
+using ::android::OutputStream;
namespace aapt {
namespace proguard {
diff --git a/tools/aapt2/java/ProguardRules.h b/tools/aapt2/java/ProguardRules.h
index 267f7ede274a..876ef48042f5 100644
--- a/tools/aapt2/java/ProguardRules.h
+++ b/tools/aapt2/java/ProguardRules.h
@@ -26,8 +26,8 @@
#include "ResourceTable.h"
#include "ValueVisitor.h"
#include "androidfw/Source.h"
+#include "androidfw/Streams.h"
#include "androidfw/StringPiece.h"
-#include "io/Io.h"
#include "process/IResourceTableConsumer.h"
#include "xml/XmlDom.h"
@@ -69,7 +69,7 @@ class KeepSet {
}
private:
- friend void WriteKeepSet(const KeepSet& keep_set, io::OutputStream* out, bool minimal_keep,
+ friend void WriteKeepSet(const KeepSet& keep_set, android::OutputStream* out, bool minimal_keep,
bool no_location_reference);
friend bool CollectLocations(const UsageLocation& location, const KeepSet& keep_set,
@@ -89,7 +89,7 @@ bool CollectProguardRules(IAaptContext* context, xml::XmlResource* res, KeepSet*
bool CollectResourceReferences(IAaptContext* context, ResourceTable* table, KeepSet* keep_set);
-void WriteKeepSet(const KeepSet& keep_set, io::OutputStream* out, bool minimal_keep,
+void WriteKeepSet(const KeepSet& keep_set, android::OutputStream* out, bool minimal_keep,
bool no_location_reference);
bool CollectLocations(const UsageLocation& location, const KeepSet& keep_set,
diff --git a/tools/aapt2/test/Common.h b/tools/aapt2/test/Common.h
index e48668cf96a3..04379804d8ee 100644
--- a/tools/aapt2/test/Common.h
+++ b/tools/aapt2/test/Common.h
@@ -90,7 +90,7 @@ class TestFile : public io::IFile {
return {};
}
- std::unique_ptr<io::InputStream> OpenInputStream() override {
+ std::unique_ptr<android::InputStream> OpenInputStream() override {
return OpenAsData();
}
diff --git a/tools/aapt2/test/Fixture.cpp b/tools/aapt2/test/Fixture.cpp
index 428372f31d0d..b91abe572306 100644
--- a/tools/aapt2/test/Fixture.cpp
+++ b/tools/aapt2/test/Fixture.cpp
@@ -20,6 +20,7 @@
#include <android-base/file.h>
#include <android-base/stringprintf.h>
#include <android-base/utf8.h>
+#include <androidfw/FileStream.h>
#include <androidfw/StringPiece.h>
#include <dirent.h>
#include <gmock/gmock.h>
@@ -28,7 +29,6 @@
#include "Diagnostics.h"
#include "cmd/Compile.h"
#include "cmd/Link.h"
-#include "io/FileStream.h"
#include "util/Files.h"
using testing::Eq;
diff --git a/tools/aapt2/text/Printer.cpp b/tools/aapt2/text/Printer.cpp
index 8e491aca794d..c2fa8cccd536 100644
--- a/tools/aapt2/text/Printer.cpp
+++ b/tools/aapt2/text/Printer.cpp
@@ -20,7 +20,7 @@
#include "io/Util.h"
-using ::aapt::io::OutputStream;
+using ::android::OutputStream;
using ::android::StringPiece;
namespace aapt {
diff --git a/tools/aapt2/text/Printer.h b/tools/aapt2/text/Printer.h
index f7ad98bfd981..44f0fc546c7c 100644
--- a/tools/aapt2/text/Printer.h
+++ b/tools/aapt2/text/Printer.h
@@ -18,17 +18,16 @@
#define AAPT_TEXT_PRINTER_H
#include "android-base/macros.h"
+#include "androidfw/Streams.h"
#include "androidfw/StringPiece.h"
-#include "io/Io.h"
-
namespace aapt {
namespace text {
// An indenting Printer that helps write formatted text to the OutputStream.
class Printer {
public:
- explicit Printer(::aapt::io::OutputStream* out) : out_(out) {
+ explicit Printer(android::OutputStream* out) : out_(out) {
}
Printer& Print(android::StringPiece str);
@@ -41,7 +40,7 @@ class Printer {
private:
DISALLOW_COPY_AND_ASSIGN(Printer);
- ::aapt::io::OutputStream* out_;
+ android::OutputStream* out_;
int indent_level_ = 0;
bool needs_indent_ = false;
bool error_ = false;
diff --git a/tools/aapt2/xml/XmlDom.cpp b/tools/aapt2/xml/XmlDom.cpp
index 8dea8ea52f92..49807db26bb7 100644
--- a/tools/aapt2/xml/XmlDom.cpp
+++ b/tools/aapt2/xml/XmlDom.cpp
@@ -30,7 +30,7 @@
#include "XmlPullParser.h"
#include "util/Util.h"
-using ::aapt::io::InputStream;
+using ::android::InputStream;
using ::android::StringPiece;
using ::android::StringPiece16;
diff --git a/tools/aapt2/xml/XmlDom.h b/tools/aapt2/xml/XmlDom.h
index c253b0a1f4a9..9668b6a6e8ef 100644
--- a/tools/aapt2/xml/XmlDom.h
+++ b/tools/aapt2/xml/XmlDom.h
@@ -24,8 +24,8 @@
#include "Resource.h"
#include "ResourceValues.h"
#include "androidfw/IDiagnostics.h"
+#include "androidfw/Streams.h"
#include "androidfw/StringPiece.h"
-#include "io/Io.h"
#include "util/Util.h"
#include "xml/XmlUtil.h"
@@ -152,7 +152,7 @@ class XmlResource {
};
// Inflates an XML DOM from an InputStream, logging errors to the logger.
-std::unique_ptr<XmlResource> Inflate(io::InputStream* in, android::IDiagnostics* diag,
+std::unique_ptr<XmlResource> Inflate(android::InputStream* in, android::IDiagnostics* diag,
const android::Source& source);
// Inflates an XML DOM from a binary ResXMLTree.
diff --git a/tools/aapt2/xml/XmlPullParser.cpp b/tools/aapt2/xml/XmlPullParser.cpp
index d79446bfae6f..203832d2dbe8 100644
--- a/tools/aapt2/xml/XmlPullParser.cpp
+++ b/tools/aapt2/xml/XmlPullParser.cpp
@@ -21,7 +21,7 @@
#include "xml/XmlPullParser.h"
#include "xml/XmlUtil.h"
-using ::aapt::io::InputStream;
+using ::android::InputStream;
using ::android::StringPiece;
namespace aapt {
diff --git a/tools/aapt2/xml/XmlPullParser.h b/tools/aapt2/xml/XmlPullParser.h
index fe4cd018d808..655e6dc93e75 100644
--- a/tools/aapt2/xml/XmlPullParser.h
+++ b/tools/aapt2/xml/XmlPullParser.h
@@ -27,11 +27,10 @@
#include <string>
#include <vector>
+#include "Resource.h"
#include "android-base/macros.h"
+#include "androidfw/Streams.h"
#include "androidfw/StringPiece.h"
-
-#include "Resource.h"
-#include "io/Io.h"
#include "process/IResourceTableConsumer.h"
#include "xml/XmlUtil.h"
@@ -66,7 +65,7 @@ class XmlPullParser : public IPackageDeclStack {
static bool SkipCurrentElement(XmlPullParser* parser);
static bool IsGoodEvent(Event event);
- explicit XmlPullParser(io::InputStream* in);
+ explicit XmlPullParser(android::InputStream* in);
~XmlPullParser();
/**
@@ -179,7 +178,7 @@ class XmlPullParser : public IPackageDeclStack {
std::vector<Attribute> attributes;
};
- io::InputStream* in_;
+ android::InputStream* in_;
XML_Parser parser_;
std::queue<EventData> event_queue_;
std::string error_;
diff --git a/tools/hoststubgen/README.md b/tools/hoststubgen/README.md
index b0a126292063..3455b0af4360 100644
--- a/tools/hoststubgen/README.md
+++ b/tools/hoststubgen/README.md
@@ -2,19 +2,27 @@
## Overview
-This directory contains tools / sample code / investigation for host side test support.
+HostStubGen is a tool built for ravenwood. It can read an Android framework jar file
+(such as `framework-minus-apex.jar` or `framework-all.jar`) and
+converts them, so that they can be used on the Ravenwood environment.
+This directory contains the HostStubGen source code, tests and some library source files
+used at runtime.
+
+- HostStubGen itself is design to be agnostic to Android. It doesn't use any Android APIs
+(hidden or not). But it may use Android specific knowledge -- e.g. as of now,
+AndroidHeuristicsFilter has hardcoded heuristics to detect AIDL generated classes.
+
+- `test-tiny-framework/` contains basic tests that are agnostic to Android.
+
+- More Android specific build files and code are stored in `frameworks/base/Ravenwood.bp`
+ `frameworks/base/ravenwood`.
## Directories and files
- `hoststubgen/`
Contains source code of the "hoststubgen" tool and relevant code
- - `framework-policy-override.txt`
- This file contains "policy overrides", which allows to control what goes to stub/impl without
- having to touch the target java files. This allows quicker iteration, because you can skip
- having to rebuild framework.jar.
-
- `src/`
HostStubGen tool source code.
@@ -26,14 +34,12 @@ This directory contains tools / sample code / investigation for host side test s
- `test-tiny-framework/` See `README.md` in it.
- - `test-framework` See `README.md` in it.
+ - `test-framework`
+ This directory was used during the prototype phase, but now that we have real ravenwood tests,
+ this directory is obsolete and should be deleted.
-- `scripts`
- - `run-host-test.sh`
-
- Run a host side test. Use it instead of `atest` for now. (`atest` works "mostly" but it has
- problems.)
+- `scripts`
- `dump-jar.sh`
A script to dump the content of `*.class` and `*.jar` files.
@@ -53,8 +59,8 @@ m hoststubgen
### Run the tests
-- Run all relevant tests and test scripts. Some of thests are still expected to fail,
- but this should print "finished, with no unexpected failures" at the end.
+- Run all relevant tests and test scripts. All of it is expected to pass, and it'll print
+ "Ready to submit" at the end.
However, because some of the script it executes depend on internal file paths to Soong's
intermediate directory, some of it might fail when something changes in the build system.
@@ -74,3 +80,7 @@ $ ./scripts/run-all-tests.sh
(or at least check it.)
- The `HostStubGenTest-framework-test-host-test-lib` jar somehow contain all ASM classes? Figure out where the dependency is coming from.
+
+- At some point, we can move or delete all Android specific code to `frameworks/base/ravenwood`.
+ - `helper-framework-*-src` should be moved to `frameworks/base/ravenwood`
+ - `test-framework` should be deleted. \ No newline at end of file
diff --git a/tools/hoststubgen/hoststubgen/Android.bp b/tools/hoststubgen/hoststubgen/Android.bp
index 5949bca2f9a3..0e2e158c327e 100644
--- a/tools/hoststubgen/hoststubgen/Android.bp
+++ b/tools/hoststubgen/hoststubgen/Android.bp
@@ -274,6 +274,22 @@ java_library_host {
],
}
+java_library_host {
+ name: "hoststubgen-helper-libcore-runtime",
+ defaults: ["hoststubgen-for-prototype-only-java"],
+ srcs: [
+ "helper-framework-runtime-src/libcore-fake/**/*.java",
+ ],
+}
+
+java_host_for_device {
+ name: "hoststubgen-helper-libcore-runtime.ravenwood",
+ defaults: ["hoststubgen-for-prototype-only-java"],
+ libs: [
+ "hoststubgen-helper-libcore-runtime",
+ ],
+}
+
java_library {
name: "hoststubgen-helper-framework-runtime.ravenwood",
defaults: ["hoststubgen-for-prototype-only-java"],
@@ -286,6 +302,7 @@ java_library {
],
static_libs: [
"core-xml-for-device",
+ "hoststubgen-helper-libcore-runtime.ravenwood",
],
}
diff --git a/tools/hoststubgen/hoststubgen/framework-policy-override.txt b/tools/hoststubgen/hoststubgen/framework-policy-override.txt
index ff0fe32ad267..af3789e270a4 100644
--- a/tools/hoststubgen/hoststubgen/framework-policy-override.txt
+++ b/tools/hoststubgen/hoststubgen/framework-policy-override.txt
@@ -78,6 +78,9 @@ class android.util.Log !com.android.hoststubgen.nativesubstitution.Log_host
class com.android.internal.util.FastPrintWriter keepclass
class com.android.internal.util.LineBreakBufferedWriter keepclass
+class android.util.EventLog stubclass
+class android.util.EventLog !com.android.hoststubgen.nativesubstitution.EventLog_host
+class android.util.EventLog$Event stubclass
# Expose Context because it's referred to by AndroidTestCase, but don't need to expose any of
# its members.
@@ -97,3 +100,6 @@ class android.os.BadTypeParcelableException stubclass
class android.os.BaseBundle stubclass
class android.os.Bundle stubclass
class android.os.PersistableBundle stubclass
+
+class android.os.MessageQueue stubclass
+class android.os.MessageQueue !com.android.hoststubgen.nativesubstitution.MessageQueue_host
diff --git a/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/EventLog_host.java b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/EventLog_host.java
new file mode 100644
index 000000000000..292e8da0de10
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/EventLog_host.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.nativesubstitution;
+
+import android.util.Log;
+import android.util.Log.Level;
+
+import java.util.Collection;
+
+public class EventLog_host {
+ public static int writeEvent(int tag, int value) {
+ return writeEvent(tag, (Object) value);
+ }
+
+ public static int writeEvent(int tag, long value) {
+ return writeEvent(tag, (Object) value);
+ }
+
+ public static int writeEvent(int tag, float value) {
+ return writeEvent(tag, (Object) value);
+ }
+
+ public static int writeEvent(int tag, String str) {
+ return writeEvent(tag, (Object) str);
+ }
+
+ public static int writeEvent(int tag, Object... list) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("logd: [event] ");
+ final String tagName = android.util.EventLog.getTagName(tag);
+ if (tagName != null) {
+ sb.append(tagName);
+ } else {
+ sb.append(tag);
+ }
+ sb.append(": [");
+ for (int i = 0; i < list.length; i++) {
+ sb.append(String.valueOf(list[i]));
+ if (i < list.length - 1) {
+ sb.append(',');
+ }
+ }
+ sb.append(']');
+ System.out.println(sb.toString());
+ return sb.length();
+ }
+
+ public static void readEvents(int[] tags, Collection<android.util.EventLog.Event> output) {
+ throw new UnsupportedOperationException();
+ }
+
+ public static void readEventsOnWrapping(int[] tags, long timestamp,
+ Collection<android.util.EventLog.Event> output) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/MessageQueue_host.java b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/MessageQueue_host.java
new file mode 100644
index 000000000000..2e47d48f4fa0
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/MessageQueue_host.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.hoststubgen.nativesubstitution;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+public class MessageQueue_host {
+ private static final AtomicLong sNextId = new AtomicLong(1);
+ private static final Map<Long, MessageQueue_host> sInstances = new ConcurrentHashMap<>();
+
+ private boolean mDeleted = false;
+
+ private final Object mPoller = new Object();
+ private volatile boolean mPolling;
+
+ private void validate() {
+ if (mDeleted) {
+ // TODO: Put more info
+ throw new RuntimeException("MessageQueue already destroyed");
+ }
+ }
+
+ private static MessageQueue_host getInstance(long id) {
+ MessageQueue_host q = sInstances.get(id);
+ if (q == null) {
+ throw new RuntimeException("MessageQueue doesn't exist with id=" + id);
+ }
+ q.validate();
+ return q;
+ }
+
+ public static long nativeInit() {
+ final long id = sNextId.getAndIncrement();
+ final MessageQueue_host q = new MessageQueue_host();
+ sInstances.put(id, q);
+ return id;
+ }
+
+ public static void nativeDestroy(long ptr) {
+ getInstance(ptr).mDeleted = true;
+ sInstances.remove(ptr);
+ }
+
+ public static void nativePollOnce(android.os.MessageQueue queue, long ptr, int timeoutMillis) {
+ var q = getInstance(ptr);
+ synchronized (q.mPoller) {
+ q.mPolling = true;
+ try {
+ if (timeoutMillis == 0) {
+ // Calling epoll_wait() with 0 returns immediately
+ } else if (timeoutMillis == -1) {
+ q.mPoller.wait();
+ } else {
+ q.mPoller.wait(timeoutMillis);
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ q.mPolling = false;
+ }
+ }
+
+ public static void nativeWake(long ptr) {
+ var q = getInstance(ptr);
+ synchronized (q.mPoller) {
+ q.mPoller.notifyAll();
+ }
+ }
+
+ public static boolean nativeIsPolling(long ptr) {
+ var q = getInstance(ptr);
+ return q.mPolling;
+ }
+
+ public static void nativeSetFileDescriptorEvents(long ptr, int fd, int events) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java
index 4a3a79803b65..22553451e128 100644
--- a/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java
+++ b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java
@@ -27,16 +27,17 @@ import java.util.concurrent.atomic.AtomicLong;
/**
* Tentative, partial implementation of the Parcel native methods, using Java's
- * {@link ByteBuffer}. It turned out there's enough semantics differences between Parcel
- * and {@link ByteBuffer}, so it didn't actually work.
- * (e.g. Parcel seems to allow moving the data position to be beyond its size? Which
+ * {@code byte[]}.
+ * (We don't use a {@link ByteBuffer} because there's enough semantics differences between Parcel
+ * and {@link ByteBuffer}, and it didn't work out.
+ * e.g. Parcel seems to allow moving the data position to be beyond its size? Which
* {@link ByteBuffer} wouldn't allow...)
*/
public class Parcel_host {
private Parcel_host() {
}
- private static final AtomicLong sNextId = new AtomicLong(0);
+ private static final AtomicLong sNextId = new AtomicLong(1);
private static final Map<Long, Parcel_host> sInstances = new ConcurrentHashMap<>();
diff --git a/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/android/system/ErrnoException.java b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/android/system/ErrnoException.java
new file mode 100644
index 000000000000..388156aa3694
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/android/system/ErrnoException.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.system;
+
+import java.io.IOException;
+import java.net.SocketException;
+
+/**
+ * A checked exception thrown when {@link Os} methods fail. This exception contains the native
+ * errno value, for comparison against the constants in {@link OsConstants}, should sophisticated
+ * callers need to adjust their behavior based on the exact failure.
+ */
+public final class ErrnoException extends Exception {
+ private final String functionName;
+
+ /**
+ * The errno value, for comparison with the {@code E} constants in {@link OsConstants}.
+ */
+ public final int errno;
+
+ /**
+ * Constructs an instance with the given function name and errno value.
+ */
+ public ErrnoException(String functionName, int errno) {
+ this.functionName = functionName;
+ this.errno = errno;
+ }
+
+ /**
+ * Constructs an instance with the given function name, errno value, and cause.
+ */
+ public ErrnoException(String functionName, int errno, Throwable cause) {
+ super(cause);
+ this.functionName = functionName;
+ this.errno = errno;
+ }
+
+ /**
+ * Converts the stashed function name and errno value to a human-readable string.
+ * We do this here rather than in the constructor so that callers only pay for
+ * this if they need it.
+ */
+ @Override public String getMessage() {
+ return functionName + " failed: " + errno;
+ }
+
+ /**
+ * Throws an {@link IOException} with a message based on {@link #getMessage()} and with this
+ * instance as the cause.
+ *
+ * <p>This method always terminates by throwing the exception. Callers can write
+ * {@code throw e.rethrowAsIOException()} to make that clear to the compiler.
+ */
+ public IOException rethrowAsIOException() throws IOException {
+ IOException newException = new IOException(getMessage());
+ newException.initCause(this);
+ throw newException;
+ }
+
+ /**
+ * Throws a {@link SocketException} with a message based on {@link #getMessage()} and with this
+ * instance as the cause.
+ *
+ * <p>This method always terminates by throwing the exception. Callers can write
+ * {@code throw e.rethrowAsIOException()} to make that clear to the compiler.
+ */
+ public SocketException rethrowAsSocketException() throws SocketException {
+ throw new SocketException(getMessage());
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/libcore/io/IoUtils.java b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/libcore/io/IoUtils.java
new file mode 100644
index 000000000000..65c285e06bf8
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-framework-runtime-src/libcore-fake/libcore/io/IoUtils.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.Socket;
+
+/** @hide */
+public final class IoUtils {
+ private IoUtils() {
+ }
+
+ public static void closeQuietly(AutoCloseable closeable) {
+ if (closeable != null) {
+ try {
+ closeable.close();
+ } catch (RuntimeException rethrown) {
+ throw rethrown;
+ } catch (Exception ignored) {
+ }
+ }
+ }
+
+ public static void closeQuietly(Socket socket) {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch (RuntimeException rethrown) {
+ throw rethrown;
+ } catch (Exception ignored) {
+ }
+ }
+ }
+
+ public static void deleteContents(File dir) throws IOException {
+ File[] files = dir.listFiles();
+ if (files != null) {
+ for (File file : files) {
+ if (file.isDirectory()) {
+ deleteContents(file);
+ }
+ file.delete();
+ }
+ }
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInImpl.java b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInImpl.java
new file mode 100644
index 000000000000..2cc500f527c0
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInImpl.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.hosthelper;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation injected to all classes/methods/fields that are kept in the "impl" jar.
+ */
+@Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface HostStubGenKeptInImpl {
+ String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenKeptInImpl.class);
+ String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInStub.java b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInStub.java
new file mode 100644
index 000000000000..12b9875fcf53
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenKeptInStub.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.hosthelper;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation injected to all classes/methods/fields that are kept in the "stub" jar.
+ *
+ * All items in the stub jar are automatically kept in the impl jar as well, so
+ * the items with this annotation will all have {@link HostStubGenKeptInImpl} too.
+ */
+@Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface HostStubGenKeptInStub {
+ String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenKeptInStub.class);
+ String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedKeepClass.java b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsIgnore.java
index 7ada961d710f..cb50404c96d9 100644
--- a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedKeepClass.java
+++ b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsIgnore.java
@@ -15,18 +15,20 @@
*/
package com.android.hoststubgen.hosthelper;
-import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Annotation added to all "stub" classes generated by HostStubGen.
+ * Annotation injected to all methods processed as "ignore".
+ *
+ * (This annotation is only added in the impl jar, but not the stub jar)
*/
-@Target({TYPE})
+@Target({METHOD})
@Retention(RetentionPolicy.RUNTIME)
-public @interface HostStubGenProcessedKeepClass {
- String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenProcessedKeepClass.class);
+public @interface HostStubGenProcessedAsIgnore {
+ String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenProcessedAsIgnore.class);
String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
}
diff --git a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsSubstitute.java b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsSubstitute.java
new file mode 100644
index 000000000000..cfa4896fdfa0
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsSubstitute.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.hosthelper;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation injected to all methods that are processed as "substitute".
+ *
+ * (This annotation is only added in the impl jar, but not the stub jar)
+ */
+@Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface HostStubGenProcessedAsSubstitute {
+ String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(
+ HostStubGenProcessedAsSubstitute.class);
+ String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
+}
diff --git a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedStubClass.java b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsThrow.java
index e598da0a3cb9..0d2da114da97 100644
--- a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedStubClass.java
+++ b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostStubGenProcessedAsThrow.java
@@ -15,18 +15,20 @@
*/
package com.android.hoststubgen.hosthelper;
-import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Annotation added to all "stub" classes generated by HostStubGen.
+ * Annotation injected to all methods that are processed as "throw".
+ *
+ * (This annotation is only added in the impl jar, but not the stub jar)
*/
-@Target({TYPE})
+@Target({METHOD})
@Retention(RetentionPolicy.RUNTIME)
-public @interface HostStubGenProcessedStubClass {
- String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenProcessedStubClass.class);
+public @interface HostStubGenProcessedAsThrow {
+ String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenProcessedAsThrow.class);
String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
}
diff --git a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostTestUtils.java b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostTestUtils.java
index c770b9ccc800..7c6aa25bf5ea 100644
--- a/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostTestUtils.java
+++ b/tools/hoststubgen/hoststubgen/helper-runtime-src/com/android/hoststubgen/hosthelper/HostTestUtils.java
@@ -23,8 +23,6 @@ import java.util.HashMap;
import javax.annotation.concurrent.GuardedBy;
-import org.junit.AssumptionViolatedException;
-
/**
* Utilities used in the host side test environment.
*/
@@ -128,7 +126,7 @@ public class HostTestUtils {
}
}
// All processed classes have this annotation.
- var allowed = clazz.getAnnotation(HostStubGenProcessedKeepClass.class) != null;
+ var allowed = clazz.getAnnotation(HostStubGenKeptInImpl.class) != null;
// Java classes should be able to access any methods. (via callbacks, etc.)
if (!allowed) {
diff --git a/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh b/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh
index 89daa2084420..d97dd7c18045 100755
--- a/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh
+++ b/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# This command is expected to be executed with: atest hoststubgen-invoke-test
+
set -e # Exit when any command files
# This script runs HostStubGen directly with various arguments and make sure
@@ -35,6 +37,12 @@ if [[ "$TEMP" == "" ]] ; then
mkdir -p $TEMP
fi
+cleanup_temp() {
+ rm -fr $TEMP/*
+}
+
+cleanup_temp
+
JAR=hoststubgen-test-tiny-framework.jar
STUB=$TEMP/stub.jar
IMPL=$TEMP/impl.jar
@@ -43,16 +51,16 @@ ANNOTATION_FILTER=$TEMP/annotation-filter.txt
HOSTSTUBGEN_OUT=$TEMP/output.txt
+EXTRA_ARGS=""
+
# Because of `set -e`, we can't return non-zero from functions, so we store
# HostStubGen result in it.
HOSTSTUBGEN_RC=0
-# Define the functions to
-
-
# Note, because the build rule will only install hoststubgen.jar, but not the wrapper script,
# we need to execute it manually with the java command.
hoststubgen() {
+ echo "Running hoststubgen with: $*"
java -jar ./hoststubgen.jar "$@"
}
@@ -62,7 +70,7 @@ run_hoststubgen() {
echo "# Test: $test_name"
- rm -f $HOSTSTUBGEN_OUT
+ cleanup_temp
local filter_arg=""
@@ -73,11 +81,21 @@ run_hoststubgen() {
cat $ANNOTATION_FILTER
fi
+ local stub_arg=""
+ local impl_arg=""
+
+ if [[ "$STUB" != "" ]] ; then
+ stub_arg="--out-stub-jar $STUB"
+ fi
+ if [[ "$IMPL" != "" ]] ; then
+ impl_arg="--out-impl-jar $IMPL"
+ fi
+
hoststubgen \
--debug \
--in-jar $JAR \
- --out-stub-jar $STUB \
- --out-impl-jar $IMPL \
+ $stub_arg \
+ $impl_arg \
--stub-annotation \
android.hosttest.annotation.HostSideTestStub \
--keep-annotation \
@@ -99,12 +117,28 @@ run_hoststubgen() {
--keep-static-initializer-annotation \
android.hosttest.annotation.HostSideTestStaticInitializerKeep \
$filter_arg \
+ $EXTRA_ARGS \
|& tee $HOSTSTUBGEN_OUT
HOSTSTUBGEN_RC=${PIPESTATUS[0]}
echo "HostStubGen exited with $HOSTSTUBGEN_RC"
return 0
}
+assert_file_generated() {
+ local file="$1"
+ if [[ "$file" == "" ]] ; then
+ if [[ -f "$file" ]] ; then
+ echo "HostStubGen shouldn't have generated $file"
+ return 1
+ fi
+ else
+ if ! [[ -f "$file" ]] ; then
+ echo "HostStubGen didn't generate $file"
+ return 1
+ fi
+ fi
+}
+
run_hoststubgen_for_success() {
run_hoststubgen "$@"
@@ -112,6 +146,9 @@ run_hoststubgen_for_success() {
echo "HostStubGen expected to finish successfully, but failed with $rc"
return 1
fi
+
+ assert_file_generated "$STUB"
+ assert_file_generated "$IMPL"
}
run_hoststubgen_for_failure() {
@@ -175,7 +212,6 @@ com.supported.*
com.unsupported.*
"
-
run_hoststubgen_for_failure "One specific class disallowed" \
"TinyFrameworkClassAnnotations is not allowed to have Ravenwood annotations" \
"
@@ -189,6 +225,15 @@ run_hoststubgen_for_success "One specific class disallowed, but it doesn't use a
* # All other classes allowed
"
+STUB="" run_hoststubgen_for_success "No stub generation" ""
+
+IMPL="" run_hoststubgen_for_success "No impl generation" ""
+
+STUB="" IMPL="" run_hoststubgen_for_success "No stub, no impl generation" ""
+
+EXTRA_ARGS="--in-jar abc" run_hoststubgen_for_failure "Duplicate arg" \
+ "Duplicate or conflicting argument found: --in-jar" \
+ ""
echo "All tests passed"
diff --git a/tools/hoststubgen/hoststubgen/jarjar-rules.txt b/tools/hoststubgen/hoststubgen/jarjar-rules.txt
index 4e61ba6f67b3..b1f2fc21c8e9 100644
--- a/tools/hoststubgen/hoststubgen/jarjar-rules.txt
+++ b/tools/hoststubgen/hoststubgen/jarjar-rules.txt
@@ -1,2 +1,2 @@
# Rename guava
-rule com.google.common.** com.android.hoststubgen.x.@0 \ No newline at end of file
+rule com.google.** com.android.hoststubgen.x.google.@0 \ No newline at end of file
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt
index 07bd2dc7c867..4db583f109d2 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt
@@ -22,7 +22,6 @@ import com.android.hoststubgen.filters.ConstantFilter
import com.android.hoststubgen.filters.DefaultHookInjectingFilter
import com.android.hoststubgen.filters.FilterPolicy
import com.android.hoststubgen.filters.ImplicitOutputFilter
-import com.android.hoststubgen.filters.KeepAllClassesFilter
import com.android.hoststubgen.filters.OutputFilter
import com.android.hoststubgen.filters.StubIntersectingFilter
import com.android.hoststubgen.filters.createFilterFromTextPolicyFile
@@ -52,15 +51,15 @@ class HostStubGen(val options: HostStubGenOptions) {
val errors = HostStubGenErrors()
// Load all classes.
- val allClasses = loadClassStructures(options.inJar)
+ val allClasses = loadClassStructures(options.inJar.get)
// Dump the classes, if specified.
- options.inputJarDumpFile?.let {
+ options.inputJarDumpFile.ifSet {
PrintWriter(it).use { pw -> allClasses.dump(pw) }
log.i("Dump file created at $it")
}
- options.inputJarAsKeepAllFile?.let {
+ options.inputJarAsKeepAllFile.ifSet {
PrintWriter(it).use {
pw -> allClasses.forEach {
classNode -> printAsTextPolicy(pw, classNode)
@@ -74,11 +73,11 @@ class HostStubGen(val options: HostStubGenOptions) {
// Transform the jar.
convert(
- options.inJar,
- options.outStubJar,
- options.outImplJar,
+ options.inJar.get,
+ options.outStubJar.get,
+ options.outImplJar.get,
filter,
- options.enableClassChecker,
+ options.enableClassChecker.get,
allClasses,
errors,
)
@@ -153,26 +152,26 @@ class HostStubGen(val options: HostStubGenOptions) {
// text-file based filter, which is handled by parseTextFilterPolicyFile.
// The first filter is for the default policy from the command line options.
- var filter: OutputFilter = ConstantFilter(options.defaultPolicy, "default-by-options")
+ var filter: OutputFilter = ConstantFilter(options.defaultPolicy.get, "default-by-options")
// Next, we need a filter that resolves "class-wide" policies.
// This is used when a member (methods, fields, nested classes) don't get any polices
// from upper filters. e.g. when a method has no annotations, then this filter will apply
// the class-wide policy, if any. (if not, we'll fall back to the above filter.)
- filter = ClassWidePolicyPropagatingFilter(filter)
+ filter = ClassWidePolicyPropagatingFilter(allClasses, filter)
// Inject default hooks from options.
filter = DefaultHookInjectingFilter(
- options.defaultClassLoadHook,
- options.defaultMethodCallHook,
+ options.defaultClassLoadHook.get,
+ options.defaultMethodCallHook.get,
filter
)
- val annotationAllowedClassesFilter = options.annotationAllowedClassesFile.let { filename ->
- if (filename == null) {
+ val annotationAllowedClassesFilter = options.annotationAllowedClassesFile.get.let { file ->
+ if (file == null) {
ClassFilter.newNullFilter(true) // Allow all classes
} else {
- ClassFilter.loadFromFile(filename, false)
+ ClassFilter.loadFromFile(file, false)
}
}
@@ -196,7 +195,7 @@ class HostStubGen(val options: HostStubGenOptions) {
// Next, "text based" filter, which allows to override polices without touching
// the target code.
- options.policyOverrideFile?.let {
+ options.policyOverrideFile.ifSet {
filter = createFilterFromTextPolicyFile(it, allClasses, filter)
}
@@ -212,11 +211,6 @@ class HostStubGen(val options: HostStubGenOptions) {
// Apply the implicit filter.
filter = ImplicitOutputFilter(errors, allClasses, filter)
- // Optionally keep all classes.
- if (options.keepAllClasses) {
- filter = KeepAllClassesFilter(filter)
- }
-
return filter
}
@@ -237,15 +231,15 @@ class HostStubGen(val options: HostStubGenOptions) {
*/
private fun convert(
inJar: String,
- outStubJar: String,
- outImplJar: String,
+ outStubJar: String?,
+ outImplJar: String?,
filter: OutputFilter,
enableChecker: Boolean,
classes: ClassNodes,
errors: HostStubGenErrors,
) {
log.i("Converting %s into [stub: %s, impl: %s] ...", inJar, outStubJar, outImplJar)
- log.i("Checker is %s", if (enableChecker) "enabled" else "disabled")
+ log.i("ASM CheckClassAdapter is %s", if (enableChecker) "enabled" else "disabled")
val start = System.currentTimeMillis()
@@ -254,8 +248,8 @@ class HostStubGen(val options: HostStubGenOptions) {
log.withIndent {
// Open the input jar file and process each entry.
ZipFile(inJar).use { inZip ->
- ZipOutputStream(FileOutputStream(outStubJar)).use { stubOutStream ->
- ZipOutputStream(FileOutputStream(outImplJar)).use { implOutStream ->
+ maybeWithZipOutputStream(outStubJar) { stubOutStream ->
+ maybeWithZipOutputStream(outImplJar) { implOutStream ->
val inEntries = inZip.entries()
while (inEntries.hasMoreElements()) {
val entry = inEntries.nextElement()
@@ -265,12 +259,19 @@ class HostStubGen(val options: HostStubGenOptions) {
log.i("Converted all entries.")
}
}
- log.i("Created stub: $outStubJar")
- log.i("Created impl: $outImplJar")
+ outStubJar?.let { log.i("Created stub: $it") }
+ outImplJar?.let { log.i("Created impl: $it") }
}
}
val end = System.currentTimeMillis()
- log.v("Done transforming the jar in %.1f second(s).", (end - start) / 1000.0)
+ log.i("Done transforming the jar in %.1f second(s).", (end - start) / 1000.0)
+ }
+
+ private fun <T> maybeWithZipOutputStream(filename: String?, block: (ZipOutputStream?) -> T): T {
+ if (filename == null) {
+ return block(null)
+ }
+ return ZipOutputStream(FileOutputStream(filename)).use(block)
}
/**
@@ -279,8 +280,8 @@ class HostStubGen(val options: HostStubGenOptions) {
private fun convertSingleEntry(
inZip: ZipFile,
entry: ZipEntry,
- stubOutStream: ZipOutputStream,
- implOutStream: ZipOutputStream,
+ stubOutStream: ZipOutputStream?,
+ implOutStream: ZipOutputStream?,
filter: OutputFilter,
packageRedirector: PackageRedirectRemapper,
enableChecker: Boolean,
@@ -316,8 +317,8 @@ class HostStubGen(val options: HostStubGenOptions) {
// Unknown type, we just copy it to both output zip files.
// TODO: We probably shouldn't do it for stub jar?
log.v("Copying: %s", entry.name)
- copyZipEntry(inZip, entry, stubOutStream)
- copyZipEntry(inZip, entry, implOutStream)
+ stubOutStream?.let { copyZipEntry(inZip, entry, it) }
+ implOutStream?.let { copyZipEntry(inZip, entry, it) }
}
}
@@ -346,8 +347,8 @@ class HostStubGen(val options: HostStubGenOptions) {
private fun processSingleClass(
inZip: ZipFile,
entry: ZipEntry,
- stubOutStream: ZipOutputStream,
- implOutStream: ZipOutputStream,
+ stubOutStream: ZipOutputStream?,
+ implOutStream: ZipOutputStream?,
filter: OutputFilter,
packageRedirector: PackageRedirectRemapper,
enableChecker: Boolean,
@@ -361,7 +362,7 @@ class HostStubGen(val options: HostStubGenOptions) {
return
}
// Generate stub first.
- if (classPolicy.policy.needsInStub) {
+ if (stubOutStream != null && classPolicy.policy.needsInStub) {
log.v("Creating stub class: %s Policy: %s", classInternalName, classPolicy)
log.withIndent {
BufferedInputStream(inZip.getInputStream(entry)).use { bis ->
@@ -374,8 +375,8 @@ class HostStubGen(val options: HostStubGenOptions) {
}
}
}
- log.v("Creating impl class: %s Policy: %s", classInternalName, classPolicy)
- if (classPolicy.policy.needsInImpl) {
+ if (implOutStream != null && classPolicy.policy.needsInImpl) {
+ log.v("Creating impl class: %s Policy: %s", classInternalName, classPolicy)
log.withIndent {
BufferedInputStream(inZip.getInputStream(entry)).use { bis ->
val newEntry = ZipEntry(entry.name)
@@ -415,9 +416,9 @@ class HostStubGen(val options: HostStubGenOptions) {
outVisitor = CheckClassAdapter(outVisitor)
}
val visitorOptions = BaseAdapter.Options(
- enablePreTrace = options.enablePreTrace,
- enablePostTrace = options.enablePostTrace,
- enableNonStubMethodCallDetection = options.enableNonStubMethodCallDetection,
+ enablePreTrace = options.enablePreTrace.get,
+ enablePostTrace = options.enablePostTrace.get,
+ enableNonStubMethodCallDetection = options.enableNonStubMethodCallDetection.get,
errors = errors,
)
outVisitor = BaseAdapter.getVisitor(classInternalName, classes, outVisitor, filter,
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenLogger.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenLogger.kt
index 5e71a3690700..18065ba56c52 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenLogger.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenLogger.kt
@@ -15,10 +15,12 @@
*/
package com.android.hoststubgen
-import java.io.OutputStream
-import java.io.PrintStream
+import java.io.BufferedOutputStream
+import java.io.FileOutputStream
+import java.io.PrintWriter
+import java.io.Writer
-val log: HostStubGenLogger = HostStubGenLogger()
+val log: HostStubGenLogger = HostStubGenLogger().setConsoleLogLevel(LogLevel.Info)
/** Logging level */
enum class LogLevel {
@@ -30,15 +32,13 @@ enum class LogLevel {
Debug,
}
-/** Simple logging class. */
-class HostStubGenLogger(
- private var out: PrintStream = System.out!!,
- var level: LogLevel = LogLevel.Info,
-) {
- companion object {
- private val sNullPrintStream: PrintStream = PrintStream(OutputStream.nullOutputStream())
- }
-
+/**
+ * Simple logging class.
+ *
+ * By default, it has no printers set. Use [setConsoleLogLevel] or [addFilePrinter] to actually
+ * write log.
+ */
+class HostStubGenLogger {
private var indentLevel: Int = 0
get() = field
set(value) {
@@ -47,6 +47,56 @@ class HostStubGenLogger(
}
private var indent: String = ""
+ private val printers: MutableList<LogPrinter> = mutableListOf()
+
+ private var consolePrinter: LogPrinter? = null
+
+ private var maxLogLevel = LogLevel.None
+
+ private fun updateMaxLogLevel() {
+ maxLogLevel = LogLevel.None
+
+ printers.forEach {
+ if (maxLogLevel < it.logLevel) {
+ maxLogLevel = it.logLevel
+ }
+ }
+ }
+
+ private fun addPrinter(printer: LogPrinter) {
+ printers.add(printer)
+ updateMaxLogLevel()
+ }
+
+ private fun removePrinter(printer: LogPrinter) {
+ printers.remove(printer)
+ updateMaxLogLevel()
+ }
+
+ fun setConsoleLogLevel(level: LogLevel): HostStubGenLogger {
+ // If there's already a console log printer set, remove it, and then add a new one
+ consolePrinter?.let {
+ removePrinter(it)
+ }
+ val cp = StreamPrinter(level, PrintWriter(System.out))
+ addPrinter(cp)
+ consolePrinter = cp
+
+ return this
+ }
+
+ fun addFilePrinter(level: LogLevel, logFilename: String): HostStubGenLogger {
+ addPrinter(StreamPrinter(level, PrintWriter(BufferedOutputStream(
+ FileOutputStream(logFilename)))))
+
+ return this
+ }
+
+ /** Flush all the printers */
+ fun flush() {
+ printers.forEach { it.flush() }
+ }
+
fun indent() {
indentLevel++
}
@@ -68,92 +118,71 @@ class HostStubGenLogger(
}
fun isEnabled(level: LogLevel): Boolean {
- return level.ordinal <= this.level.ordinal
+ return level.ordinal <= maxLogLevel.ordinal
}
- private fun println(message: String) {
- out.print(indent)
- out.println(message)
+ private fun println(level: LogLevel, message: String) {
+ printers.forEach {
+ if (it.logLevel.ordinal >= level.ordinal) {
+ it.println(level, indent, message)
+ }
+ }
+ }
+
+ private fun println(level: LogLevel, format: String, vararg args: Any?) {
+ if (isEnabled(level)) {
+ println(level, String.format(format, *args))
+ }
}
/** Log an error. */
fun e(message: String) {
- if (level.ordinal < LogLevel.Error.ordinal) {
- return
- }
- println(message)
+ println(LogLevel.Error, message)
}
/** Log an error. */
fun e(format: String, vararg args: Any?) {
- if (level.ordinal < LogLevel.Error.ordinal) {
- return
- }
- e(String.format(format, *args))
+ println(LogLevel.Error, format, *args)
}
/** Log a warning. */
fun w(message: String) {
- if (level.ordinal < LogLevel.Warn.ordinal) {
- return
- }
- println(message)
+ println(LogLevel.Warn, message)
}
/** Log a warning. */
fun w(format: String, vararg args: Any?) {
- if (level.ordinal < LogLevel.Warn.ordinal) {
- return
- }
- w(String.format(format, *args))
+ println(LogLevel.Warn, format, *args)
}
/** Log an info message. */
fun i(message: String) {
- if (level.ordinal < LogLevel.Info.ordinal) {
- return
- }
- println(message)
+ println(LogLevel.Info, message)
}
- /** Log a debug message. */
+ /** Log an info message. */
fun i(format: String, vararg args: Any?) {
- if (level.ordinal < LogLevel.Warn.ordinal) {
- return
- }
- i(String.format(format, *args))
+ println(LogLevel.Info, format, *args)
}
/** Log a verbose message. */
fun v(message: String) {
- if (level.ordinal < LogLevel.Verbose.ordinal) {
- return
- }
- println(message)
+ println(LogLevel.Verbose, message)
}
/** Log a verbose message. */
fun v(format: String, vararg args: Any?) {
- if (level.ordinal < LogLevel.Verbose.ordinal) {
- return
- }
- v(String.format(format, *args))
+ println(LogLevel.Verbose, format, *args)
}
/** Log a debug message. */
fun d(message: String) {
- if (level.ordinal < LogLevel.Debug.ordinal) {
- return
- }
- println(message)
+ println(LogLevel.Debug, message)
}
/** Log a debug message. */
fun d(format: String, vararg args: Any?) {
- if (level.ordinal < LogLevel.Warn.ordinal) {
- return
- }
- d(String.format(format, *args))
+ println(LogLevel.Debug, format, *args)
}
inline fun forVerbose(block: () -> Unit) {
@@ -168,31 +197,65 @@ class HostStubGenLogger(
}
}
- /** Return a stream for error. */
- fun getErrorPrintStream(): PrintStream {
- if (level.ordinal < LogLevel.Error.ordinal) {
- return sNullPrintStream
+ /** Return a Writer for a given log level. */
+ fun getWriter(level: LogLevel): Writer {
+ return MultiplexingWriter(level)
+ }
+
+ private inner class MultiplexingWriter(val level: LogLevel) : Writer() {
+ private inline fun forPrinters(callback: (LogPrinter) -> Unit) {
+ printers.forEach {
+ if (it.logLevel.ordinal >= level.ordinal) {
+ callback(it)
+ }
+ }
}
- // TODO Apply indent
- return PrintStream(out)
- }
+ override fun close() {
+ flush()
+ }
- /** Return a stream for verbose messages. */
- fun getVerbosePrintStream(): PrintStream {
- if (level.ordinal < LogLevel.Verbose.ordinal) {
- return sNullPrintStream
+ override fun flush() {
+ forPrinters {
+ it.flush()
+ }
}
- // TODO Apply indent
- return PrintStream(out)
- }
- /** Return a stream for debug messages. */
- fun getInfoPrintStream(): PrintStream {
- if (level.ordinal < LogLevel.Info.ordinal) {
- return sNullPrintStream
+ override fun write(cbuf: CharArray, off: Int, len: Int) {
+ // TODO Apply indent
+ forPrinters {
+ it.write(cbuf, off, len)
+ }
}
- // TODO Apply indent
- return PrintStream(out)
}
-} \ No newline at end of file
+}
+
+private interface LogPrinter {
+ val logLevel: LogLevel
+
+ fun println(logLevel: LogLevel, indent: String, message: String)
+
+ // TODO: This should be removed once MultiplexingWriter starts applying indent, at which point
+ // println() should be used instead.
+ fun write(cbuf: CharArray, off: Int, len: Int)
+
+ fun flush()
+}
+
+private class StreamPrinter(
+ override val logLevel: LogLevel,
+ val out: PrintWriter,
+) : LogPrinter {
+ override fun println(logLevel: LogLevel, indent: String, message: String) {
+ out.print(indent)
+ out.println(message)
+ }
+
+ override fun write(cbuf: CharArray, off: Int, len: Int) {
+ out.write(cbuf, off, len)
+ }
+
+ override fun flush() {
+ out.flush()
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
index da5348707528..d2ead18b5492 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
@@ -21,21 +21,60 @@ import java.io.File
import java.io.FileReader
/**
+ * A single value that can only set once.
+ */
+class SetOnce<T>(
+ private var value: T,
+) {
+ class SetMoreThanOnceException : Exception()
+
+ private var set = false
+
+ fun set(v: T) {
+ if (set) {
+ throw SetMoreThanOnceException()
+ }
+ if (v == null) {
+ throw NullPointerException("This shouldn't happen")
+ }
+ set = true
+ value = v
+ }
+
+ val get: T
+ get() = this.value
+
+ val isSet: Boolean
+ get() = this.set
+
+ fun <R> ifSet(block: (T & Any) -> R): R? {
+ if (isSet) {
+ return block(value!!)
+ }
+ return null
+ }
+
+ override fun toString(): String {
+ return "$value"
+ }
+}
+
+/**
* Options that can be set from command line arguments.
*/
class HostStubGenOptions(
/** Input jar file*/
- var inJar: String = "",
+ var inJar: SetOnce<String> = SetOnce(""),
/** Output stub jar file */
- var outStubJar: String = "",
+ var outStubJar: SetOnce<String?> = SetOnce(null),
/** Output implementation jar file */
- var outImplJar: String = "",
+ var outImplJar: SetOnce<String?> = SetOnce(null),
- var inputJarDumpFile: String? = null,
+ var inputJarDumpFile: SetOnce<String?> = SetOnce(null),
- var inputJarAsKeepAllFile: String? = null,
+ var inputJarAsKeepAllFile: SetOnce<String?> = SetOnce(null),
var stubAnnotations: MutableSet<String> = mutableSetOf(),
var keepAnnotations: MutableSet<String> = mutableSetOf(),
@@ -51,27 +90,24 @@ class HostStubGenOptions(
var packageRedirects: MutableList<Pair<String, String>> = mutableListOf(),
- var annotationAllowedClassesFile: String? = null,
+ var annotationAllowedClassesFile: SetOnce<String?> = SetOnce(null),
- var defaultClassLoadHook: String? = null,
- var defaultMethodCallHook: String? = null,
+ var defaultClassLoadHook: SetOnce<String?> = SetOnce(null),
+ var defaultMethodCallHook: SetOnce<String?> = SetOnce(null),
var intersectStubJars: MutableSet<String> = mutableSetOf(),
- var policyOverrideFile: String? = null,
-
- var defaultPolicy: FilterPolicy = FilterPolicy.Remove,
- var keepAllClasses: Boolean = false,
+ var policyOverrideFile: SetOnce<String?> = SetOnce(null),
- var logLevel: LogLevel = LogLevel.Info,
+ var defaultPolicy: SetOnce<FilterPolicy> = SetOnce(FilterPolicy.Remove),
- var cleanUpOnError: Boolean = false,
+ var cleanUpOnError: SetOnce<Boolean> = SetOnce(false),
- var enableClassChecker: Boolean = false,
- var enablePreTrace: Boolean = false,
- var enablePostTrace: Boolean = false,
+ var enableClassChecker: SetOnce<Boolean> = SetOnce(false),
+ var enablePreTrace: SetOnce<Boolean> = SetOnce(false),
+ var enablePostTrace: SetOnce<Boolean> = SetOnce(false),
- var enableNonStubMethodCallDetection: Boolean = true,
+ var enableNonStubMethodCallDetection: SetOnce<Boolean> = SetOnce(false),
) {
companion object {
@@ -105,115 +141,135 @@ class HostStubGenOptions(
return name
}
+ fun setLogFile(level: LogLevel, filename: String) {
+ log.addFilePrinter(level, filename)
+ log.i("$level log file: $filename")
+ }
+
while (true) {
val arg = ai.nextArgOptional()
if (arg == null) {
break
}
- when (arg) {
- // TODO: Write help
- "-h", "--h" -> TODO("Help is not implemented yet")
+ // Define some shorthands...
+ fun nextArg(): String = ai.nextArgRequired(arg)
+ fun SetOnce<String>.setNextStringArg(): String = nextArg().also { this.set(it) }
+ fun SetOnce<String?>.setNextStringArg(): String = nextArg().also { this.set(it) }
+ fun MutableSet<String>.addUniqueAnnotationArg(): String =
+ nextArg().also { this += ensureUniqueAnnotation(it) }
+
+ try {
+ when (arg) {
+ // TODO: Write help
+ "-h", "--help" -> TODO("Help is not implemented yet")
+
+ "-v", "--verbose" -> log.setConsoleLogLevel(LogLevel.Verbose)
+ "-d", "--debug" -> log.setConsoleLogLevel(LogLevel.Debug)
+ "-q", "--quiet" -> log.setConsoleLogLevel(LogLevel.None)
- "-v", "--verbose" -> ret.logLevel = LogLevel.Verbose
- "-d", "--debug" -> ret.logLevel = LogLevel.Debug
- "-q", "--quiet" -> ret.logLevel = LogLevel.None
+ "--in-jar" -> ret.inJar.setNextStringArg().ensureFileExists()
+ "--out-stub-jar" -> ret.outStubJar.setNextStringArg()
+ "--out-impl-jar" -> ret.outImplJar.setNextStringArg()
- "--in-jar" -> ret.inJar = ai.nextArgRequired(arg).ensureFileExists()
- "--out-stub-jar" -> ret.outStubJar = ai.nextArgRequired(arg)
- "--out-impl-jar" -> ret.outImplJar = ai.nextArgRequired(arg)
+ "--policy-override-file" ->
+ ret.policyOverrideFile.setNextStringArg().ensureFileExists()
- "--policy-override-file" ->
- ret.policyOverrideFile = ai.nextArgRequired(arg).ensureFileExists()
+ "--clean-up-on-error" -> ret.cleanUpOnError.set(true)
+ "--no-clean-up-on-error" -> ret.cleanUpOnError.set(false)
- "--clean-up-on-error" -> ret.cleanUpOnError = true
- "--no-clean-up-on-error" -> ret.cleanUpOnError = false
+ "--default-remove" -> ret.defaultPolicy.set(FilterPolicy.Remove)
+ "--default-throw" -> ret.defaultPolicy.set(FilterPolicy.Throw)
+ "--default-keep" -> ret.defaultPolicy.set(FilterPolicy.Keep)
+ "--default-stub" -> ret.defaultPolicy.set(FilterPolicy.Stub)
- "--default-remove" -> ret.defaultPolicy = FilterPolicy.Remove
- "--default-throw" -> ret.defaultPolicy = FilterPolicy.Throw
- "--default-keep" -> ret.defaultPolicy = FilterPolicy.Keep
- "--default-stub" -> ret.defaultPolicy = FilterPolicy.Stub
+ "--stub-annotation" ->
+ ret.stubAnnotations.addUniqueAnnotationArg()
- "--keep-all-classes" -> ret.keepAllClasses = true
- "--no-keep-all-classes" -> ret.keepAllClasses = false
+ "--keep-annotation" ->
+ ret.keepAnnotations.addUniqueAnnotationArg()
- "--stub-annotation" ->
- ret.stubAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--stub-class-annotation" ->
+ ret.stubClassAnnotations.addUniqueAnnotationArg()
- "--keep-annotation" ->
- ret.keepAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--keep-class-annotation" ->
+ ret.keepClassAnnotations.addUniqueAnnotationArg()
- "--stub-class-annotation" ->
- ret.stubClassAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--throw-annotation" ->
+ ret.throwAnnotations.addUniqueAnnotationArg()
- "--keep-class-annotation" ->
- ret.keepClassAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--remove-annotation" ->
+ ret.removeAnnotations.addUniqueAnnotationArg()
- "--throw-annotation" ->
- ret.throwAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--substitute-annotation" ->
+ ret.substituteAnnotations.addUniqueAnnotationArg()
- "--remove-annotation" ->
- ret.removeAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--native-substitute-annotation" ->
+ ret.nativeSubstituteAnnotations.addUniqueAnnotationArg()
- "--substitute-annotation" ->
- ret.substituteAnnotations += ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--class-load-hook-annotation" ->
+ ret.classLoadHookAnnotations.addUniqueAnnotationArg()
- "--native-substitute-annotation" ->
- ret.nativeSubstituteAnnotations +=
- ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--keep-static-initializer-annotation" ->
+ ret.keepStaticInitializerAnnotations.addUniqueAnnotationArg()
- "--class-load-hook-annotation" ->
- ret.classLoadHookAnnotations +=
- ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--package-redirect" ->
+ ret.packageRedirects += parsePackageRedirect(nextArg())
- "--keep-static-initializer-annotation" ->
- ret.keepStaticInitializerAnnotations +=
- ensureUniqueAnnotation(ai.nextArgRequired(arg))
+ "--annotation-allowed-classes-file" ->
+ ret.annotationAllowedClassesFile.setNextStringArg()
- "--package-redirect" ->
- ret.packageRedirects += parsePackageRedirect(ai.nextArgRequired(arg))
+ "--default-class-load-hook" ->
+ ret.defaultClassLoadHook.setNextStringArg()
- "--annotation-allowed-classes-file" ->
- ret.annotationAllowedClassesFile = ai.nextArgRequired(arg)
+ "--default-method-call-hook" ->
+ ret.defaultMethodCallHook.setNextStringArg()
- "--default-class-load-hook" ->
- ret.defaultClassLoadHook = ai.nextArgRequired(arg)
+ "--intersect-stub-jar" ->
+ ret.intersectStubJars += nextArg().ensureFileExists()
- "--default-method-call-hook" ->
- ret.defaultMethodCallHook = ai.nextArgRequired(arg)
+ "--gen-keep-all-file" ->
+ ret.inputJarAsKeepAllFile.setNextStringArg()
- "--intersect-stub-jar" ->
- ret.intersectStubJars += ai.nextArgRequired(arg).ensureFileExists()
+ // Following options are for debugging.
+ "--enable-class-checker" -> ret.enableClassChecker.set(true)
+ "--no-class-checker" -> ret.enableClassChecker.set(false)
- "--gen-keep-all-file" ->
- ret.inputJarAsKeepAllFile = ai.nextArgRequired(arg)
+ "--enable-pre-trace" -> ret.enablePreTrace.set(true)
+ "--no-pre-trace" -> ret.enablePreTrace.set(false)
- // Following options are for debugging.
- "--enable-class-checker" -> ret.enableClassChecker = true
- "--no-class-checker" -> ret.enableClassChecker = false
+ "--enable-post-trace" -> ret.enablePostTrace.set(true)
+ "--no-post-trace" -> ret.enablePostTrace.set(false)
- "--enable-pre-trace" -> ret.enablePreTrace = true
- "--no-pre-trace" -> ret.enablePreTrace = false
+ "--enable-non-stub-method-check" ->
+ ret.enableNonStubMethodCallDetection.set(true)
- "--enable-post-trace" -> ret.enablePostTrace = true
- "--no-post-trace" -> ret.enablePostTrace = false
+ "--no-non-stub-method-check" ->
+ ret.enableNonStubMethodCallDetection.set(false)
- "--enable-non-stub-method-check" -> ret.enableNonStubMethodCallDetection = true
- "--no-non-stub-method-check" -> ret.enableNonStubMethodCallDetection = false
+ "--gen-input-dump-file" -> ret.inputJarDumpFile.setNextStringArg()
- "--gen-input-dump-file" -> ret.inputJarDumpFile = ai.nextArgRequired(arg)
+ "--verbose-log" -> setLogFile(LogLevel.Verbose, nextArg())
+ "--debug-log" -> setLogFile(LogLevel.Debug, nextArg())
- else -> throw ArgumentsException("Unknown option: $arg")
+ else -> throw ArgumentsException("Unknown option: $arg")
+ }
+ } catch (e: SetOnce.SetMoreThanOnceException) {
+ throw ArgumentsException("Duplicate or conflicting argument found: $arg")
}
}
- if (ret.inJar.isEmpty()) {
+
+ if (!ret.inJar.isSet) {
throw ArgumentsException("Required option missing: --in-jar")
}
- if (ret.outStubJar.isEmpty()) {
- throw ArgumentsException("Required option missing: --out-stub-jar")
+ if (!ret.outStubJar.isSet && !ret.outImplJar.isSet) {
+ log.w("Neither --out-stub-jar nor --out-impl-jar is set." +
+ " $COMMAND_NAME will not generate jar files.")
}
- if (ret.outImplJar.isEmpty()) {
- throw ArgumentsException("Required option missing: --out-impl-jar")
+
+ if (ret.enableNonStubMethodCallDetection.get) {
+ log.w("--enable-non-stub-method-check is not fully implemented yet." +
+ " See the todo in doesMethodNeedNonStubCallCheck().")
}
return ret
@@ -326,8 +382,6 @@ class HostStubGenOptions(
intersectStubJars=$intersectStubJars,
policyOverrideFile=$policyOverrideFile,
defaultPolicy=$defaultPolicy,
- keepAllClasses=$keepAllClasses,
- logLevel=$logLevel,
cleanUpOnError=$cleanUpOnError,
enableClassChecker=$enableClassChecker,
enablePreTrace=$enablePreTrace,
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/Main.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/Main.kt
index 0321d9db03ed..4882c00d2b3c 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/Main.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/Main.kt
@@ -17,6 +17,8 @@
package com.android.hoststubgen
+import java.io.PrintWriter
+
const val COMMAND_NAME = "HostStubGen"
/**
@@ -25,12 +27,11 @@ const val COMMAND_NAME = "HostStubGen"
fun main(args: Array<String>) {
var success = false
var clanupOnError = false
+
try {
// Parse the command line arguments.
val options = HostStubGenOptions.parseArgs(args)
- clanupOnError = options.cleanUpOnError
-
- log.level = options.logLevel
+ clanupOnError = options.cleanUpOnError.get
log.v("HostStubGen started")
log.v("Options: $options")
@@ -39,17 +40,18 @@ fun main(args: Array<String>) {
HostStubGen(options).run()
success = true
- } catch (e: Exception) {
+ } catch (e: Throwable) {
log.e("$COMMAND_NAME: Error: ${e.message}")
if (e !is UserErrorException) {
- e.printStackTrace(log.getErrorPrintStream())
+ e.printStackTrace(PrintWriter(log.getWriter(LogLevel.Error)))
}
if (clanupOnError) {
- TODO("clanupOnError is not implemented yet")
+ TODO("Remove output jars here")
}
+ } finally {
+ log.i("$COMMAND_NAME finished")
+ log.flush()
}
- log.v("HostStubGen finished")
-
System.exit(if (success) 0 else 1 )
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
index 1bcf3642082f..6262fa19141c 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
@@ -17,6 +17,8 @@ package com.android.hoststubgen.asm
import com.android.hoststubgen.ClassParseException
import com.android.hoststubgen.HostStubGenInternalException
+import org.objectweb.asm.ClassVisitor
+import org.objectweb.asm.FieldVisitor
import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Type
@@ -108,7 +110,7 @@ fun isAnonymousInnerClass(cn: ClassNode): Boolean {
* Otherwise, return null.
*/
fun getDirectOuterClassName(className: String): String? {
- val pos = className.indexOf('$')
+ val pos = className.lastIndexOf('$')
if (pos < 0) {
return null
}
@@ -119,8 +121,12 @@ fun getDirectOuterClassName(className: String): String? {
* Write bytecode to push all the method arguments to the stack.
* The number of arguments and their type are taken from [methodDescriptor].
*/
-fun writeByteCodeToPushArguments(methodDescriptor: String, writer: MethodVisitor) {
- var i = -1
+fun writeByteCodeToPushArguments(
+ methodDescriptor: String,
+ writer: MethodVisitor,
+ argOffset: Int = 0,
+ ) {
+ var i = argOffset - 1
Type.getArgumentTypes(methodDescriptor).forEach { type ->
i++
@@ -159,6 +165,18 @@ fun writeByteCodeToReturn(methodDescriptor: String, writer: MethodVisitor) {
}
/**
+ * Given a method descriptor, insert an [argType] as the first argument to it.
+ */
+fun prependArgTypeToMethodDescriptor(methodDescriptor: String, argType: Type): String {
+ val returnType = Type.getReturnType(methodDescriptor)
+ val argTypes = Type.getArgumentTypes(methodDescriptor).toMutableList()
+
+ argTypes.add(0, argType)
+
+ return Type.getMethodDescriptor(returnType, *argTypes.toTypedArray())
+}
+
+/**
* Return the "visibility" modifier from an `access` integer.
*
* (see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1-200-E.1)
@@ -267,3 +285,36 @@ fun isAutoGeneratedEnumMember(fn: FieldNode): Boolean {
}
return false
}
+
+/**
+ * Class to help handle [ClassVisitor], [MethodVisitor] and [FieldVisitor] in a unified way.
+ */
+abstract class UnifiedVisitor {
+ abstract fun visitAnnotation(descriptor: String, visible: Boolean)
+
+ companion object {
+ fun on(target: ClassVisitor): UnifiedVisitor {
+ return object : UnifiedVisitor() {
+ override fun visitAnnotation(descriptor: String, visible: Boolean) {
+ target.visitAnnotation(descriptor, visible)
+ }
+ }
+ }
+
+ fun on(target: MethodVisitor): UnifiedVisitor {
+ return object : UnifiedVisitor() {
+ override fun visitAnnotation(descriptor: String, visible: Boolean) {
+ target.visitAnnotation(descriptor, visible)
+ }
+ }
+ }
+
+ fun on(target: FieldVisitor): UnifiedVisitor {
+ return object : UnifiedVisitor() {
+ override fun visitAnnotation(descriptor: String, visible: Boolean) {
+ target.visitAnnotation(descriptor, visible)
+ }
+ }
+ }
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/ClassNodes.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/ClassNodes.kt
index 4df0bfc4a8d1..bc34ef0dc8a7 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/ClassNodes.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/ClassNodes.kt
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.hoststubgen.asm
import com.android.hoststubgen.ClassParseException
@@ -40,6 +55,11 @@ class ClassNodes {
return findClass(name) ?: throw ClassParseException("Class $name not found")
}
+ /** @return whether a class exists or not */
+ fun hasClass(name: String): Boolean {
+ return mAllClasses.containsKey(name.toJvmClassName())
+ }
+
/** Find a field, which may not exist. */
fun findField(
className: String,
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/KeepAllClassesFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AndroidHeuristicsFilter.kt
index 45dd38d10ef5..8354d985abfd 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/KeepAllClassesFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AndroidHeuristicsFilter.kt
@@ -15,16 +15,29 @@
*/
package com.android.hoststubgen.filters
+import com.android.hoststubgen.asm.ClassNodes
+
/**
- * An [OutputFilter] that keeps all classes by default. (but none of its members)
- *
- * We're not currently using it, but using it *might* make certain things easier. For example, with
- * this, all classes would at least be loadable.
+ * Filter that deals with Android specific heuristics.
*/
-class KeepAllClassesFilter(fallback: OutputFilter) : DelegatingFilter(fallback) {
+class AndroidHeuristicsFilter(
+ private val classes: ClassNodes,
+ val aidlPolicy: FilterPolicyWithReason?,
+ fallback: OutputFilter
+) : DelegatingFilter(fallback) {
override fun getPolicyForClass(className: String): FilterPolicyWithReason {
- // If the default visibility wouldn't keep it, change it to "keep".
- val f = super.getPolicyForClass(className)
- return f.promoteToKeep("keep-all-classes")
+ if (aidlPolicy != null && classes.isAidlClass(className)) {
+ return aidlPolicy
+ }
+ return super.getPolicyForClass(className)
}
+}
+
+/**
+ * @return if a given class "seems like" an AIDL (top-level) class.
+ */
+private fun ClassNodes.isAidlClass(className: String): Boolean {
+ return hasClass(className) &&
+ hasClass("$className\$Stub") &&
+ hasClass("$className\$Stub\$Proxy")
} \ No newline at end of file
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt
index 6aac3d88b8b1..47790b10782a 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt
@@ -15,6 +15,7 @@
*/
package com.android.hoststubgen.filters
+import com.android.hoststubgen.asm.ClassNodes
import com.android.hoststubgen.asm.getDirectOuterClassName
/**
@@ -22,22 +23,38 @@ import com.android.hoststubgen.asm.getDirectOuterClassName
* (obtained from [outermostFilter]) to the fields and methods.
*/
class ClassWidePolicyPropagatingFilter(
- fallback: OutputFilter,
+ private val classes: ClassNodes,
+ fallback: OutputFilter,
) : DelegatingFilter(fallback) {
private fun getClassWidePolicy(className: String, resolve: Boolean): FilterPolicyWithReason? {
var currentClass = className
+
+ // If the class name is `a.b.c.A$B$C`, then we try to get the class wide policy
+ // from a.b.c.A$B$C, then a.b.c.A$B, and then a.b.c.A.
while (true) {
- outermostFilter.getPolicyForClass(className).let { policy ->
- if (policy.policy.isClassWidePolicy) {
- val p = if (resolve) policy.policy.resolveClassWidePolicy() else policy.policy
+ // Sometimes a class name has a `$` in it but not as a nest class name separator --
+ // e.g. class name like "MyClass$$". In this case, `MyClass$` may not actually be
+ // a class name.
+ // So before getting the class policy on a nonexistent class, which may cause an
+ // incorrect result, we make sure if className actually exists.
+ if (classes.hasClass(className)) {
+ outermostFilter.getPolicyForClass(className).let { policy ->
+ if (policy.policy.isClassWidePolicy) {
+ val p = if (resolve) {
+ policy.policy.resolveClassWidePolicy()
+ } else {
+ policy.policy
+ }
- return p.withReason(policy.reason).wrapReason("class-wide in $currentClass")
- }
- // If the class's policy is remove, then remove it.
- if (policy.policy == FilterPolicy.Remove) {
- return FilterPolicy.Remove.withReason("class-wide in $currentClass")
+ return p.withReason(policy.reason)
+ .wrapReason("class-wide in $currentClass")
+ }
+ // If the class's policy is remove, then remove it.
+ if (policy.policy == FilterPolicy.Remove) {
+ return FilterPolicy.Remove.withReason("class-wide in $currentClass")
+ }
}
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt
index 45f61c5b2c22..cdd24e809ff8 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt
@@ -19,7 +19,7 @@ package com.android.hoststubgen.filters
* Base class for an [OutputFilter] that uses another filter as a fallback.
*/
abstract class DelegatingFilter(
- // fallback shouldn't be used by subclasses, so make it private.
+ // fallback shouldn't be used by subclasses directly, so make it private.
// They should instead be calling into `super` or `outermostFilter`.
private val fallback: OutputFilter
) : OutputFilter() {
@@ -27,11 +27,21 @@ abstract class DelegatingFilter(
fallback.outermostFilter = this
}
+ /**
+ * Returns the outermost filter in a filter chain.
+ *
+ * When methods in a subclass needs to refer to a policy on an item (class, fields, methods)
+ * that are not the "subject" item -- e.g.
+ * in [ClassWidePolicyPropagatingFilter.getPolicyForField], when it checks the
+ * class policy -- [outermostFilter] must be used, rather than the super's method.
+ * The former will always return the correct policy, but the later won't consult outer
+ * filters than the current filter.
+ */
override var outermostFilter: OutputFilter = this
get() = field
set(value) {
field = value
- // Propagate the inner filters.
+ // Propagate to the inner filters.
fallback.outermostFilter = value
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ImplicitOutputFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ImplicitOutputFilter.kt
index 84856aca84cc..ea7d1d0ff391 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ImplicitOutputFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ImplicitOutputFilter.kt
@@ -149,7 +149,7 @@ class ImplicitOutputFilter(
val fallback = super.getPolicyForField(className, fieldName)
val cn = classes.getClass(className)
- val classPolicy = super.getPolicyForClass(className)
+ val classPolicy = outermostFilter.getPolicyForClass(className)
log.d("Class ${cn.name} Class policy: $classPolicy")
if (classPolicy.policy.needsInImpl) {
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt
index 416f08505867..b4354ba84e16 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt
@@ -58,10 +58,12 @@ fun createFilterFromTextPolicyFile(
): OutputFilter {
log.i("Loading offloaded annotations from $filename ...")
log.withIndent {
- val ret = InMemoryOutputFilter(classes, fallback)
+ val imf = InMemoryOutputFilter(classes, fallback)
var lineNo = 0
+ var aidlPolicy: FilterPolicy? = null
+
try {
BufferedReader(FileReader(filename)).use { reader ->
var className = ""
@@ -79,6 +81,9 @@ fun createFilterFromTextPolicyFile(
continue // skip empty lines.
}
+
+ // TODO: Method too long, break it up.
+
val fields = line.split(whitespaceRegex).toTypedArray()
when (fields[0].lowercase()) {
"c", "class" -> {
@@ -86,14 +91,27 @@ fun createFilterFromTextPolicyFile(
throw ParseException("Class ('c') expects 2 fields.")
}
className = fields[1]
+
+ val classType = resolveSpecialClass(className)
+
if (fields[2].startsWith("!")) {
+ if (classType != SpecialClass.NotSpecial) {
+ // We could support it, but not needed at least for now.
+ throw ParseException(
+ "Special class can't have a substitution")
+ }
// It's a native-substitution.
val toClass = fields[2].substring(1)
- ret.setNativeSubstitutionClass(className, toClass)
+ imf.setNativeSubstitutionClass(className, toClass)
} else if (fields[2].startsWith("~")) {
+ if (classType != SpecialClass.NotSpecial) {
+ // We could support it, but not needed at least for now.
+ throw ParseException(
+ "Special class can't have a class load hook")
+ }
// It's a class-load hook
val callback = fields[2].substring(1)
- ret.setClassLoadHook(className, callback)
+ imf.setClassLoadHook(className, callback)
} else {
val policy = parsePolicy(fields[2])
if (!policy.isUsableWithClasses) {
@@ -101,8 +119,20 @@ fun createFilterFromTextPolicyFile(
}
Objects.requireNonNull(className)
- // TODO: Duplicate check, etc
- ret.setPolicyForClass(className, policy.withReason(FILTER_REASON))
+ when (classType) {
+ SpecialClass.NotSpecial -> {
+ // TODO: Duplicate check, etc
+ imf.setPolicyForClass(
+ className, policy.withReason(FILTER_REASON))
+ }
+ SpecialClass.Aidl -> {
+ if (aidlPolicy != null) {
+ throw ParseException(
+ "Policy for AIDL classes already defined")
+ }
+ aidlPolicy = policy
+ }
+ }
}
}
@@ -118,7 +148,7 @@ fun createFilterFromTextPolicyFile(
Objects.requireNonNull(className)
// TODO: Duplicate check, etc
- ret.setPolicyForField(className, name, policy.withReason(FILTER_REASON))
+ imf.setPolicyForField(className, name, policy.withReason(FILTER_REASON))
}
"m", "method" -> {
@@ -135,7 +165,7 @@ fun createFilterFromTextPolicyFile(
Objects.requireNonNull(className)
- ret.setPolicyForMethod(className, name, signature,
+ imf.setPolicyForMethod(className, name, signature,
policy.withReason(FILTER_REASON))
if (policy.isSubstitute) {
val fromName = fields[3].substring(1)
@@ -146,12 +176,12 @@ fun createFilterFromTextPolicyFile(
}
// Set the policy for the "from" method.
- ret.setPolicyForMethod(className, fromName, signature,
+ imf.setPolicyForMethod(className, fromName, signature,
policy.getSubstitutionBasePolicy()
.withReason(FILTER_REASON))
// Keep "from" -> "to" mapping.
- ret.setRenameTo(className, fromName, signature, name)
+ imf.setRenameTo(className, fromName, signature, name)
}
}
@@ -164,10 +194,32 @@ fun createFilterFromTextPolicyFile(
} catch (e: ParseException) {
throw e.withSourceInfo(filename, lineNo)
}
+
+ var ret: OutputFilter = imf
+ aidlPolicy?.let { policy ->
+ log.d("AndroidHeuristicsFilter enabled")
+ ret = AndroidHeuristicsFilter(
+ classes, policy.withReason("$FILTER_REASON (AIDL)"), imf)
+ }
return ret
}
}
+private enum class SpecialClass {
+ NotSpecial,
+ Aidl,
+}
+
+private fun resolveSpecialClass(className: String): SpecialClass {
+ if (!className.startsWith(":")) {
+ return SpecialClass.NotSpecial
+ }
+ when (className.lowercase()) {
+ ":aidl" -> return SpecialClass.Aidl
+ }
+ throw ParseException("Invalid special class name \"$className\"")
+}
+
private fun parsePolicy(s: String): FilterPolicy {
return when (s.lowercase()) {
"s", "stub" -> FilterPolicy.Stub
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
index f25e862d6095..18dd4c25368a 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
@@ -16,6 +16,8 @@
package com.android.hoststubgen.visitors
import com.android.hoststubgen.HostStubGenErrors
+import com.android.hoststubgen.LogLevel
+import com.android.hoststubgen.asm.UnifiedVisitor
import com.android.hoststubgen.asm.ClassNodes
import com.android.hoststubgen.asm.getPackageNameFromClassName
import com.android.hoststubgen.asm.resolveClassName
@@ -23,8 +25,8 @@ import com.android.hoststubgen.asm.toJvmClassName
import com.android.hoststubgen.filters.FilterPolicy
import com.android.hoststubgen.filters.FilterPolicyWithReason
import com.android.hoststubgen.filters.OutputFilter
-import com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
-import com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+import com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+import com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
import com.android.hoststubgen.log
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.FieldVisitor
@@ -63,6 +65,18 @@ abstract class BaseAdapter (
*/
protected abstract fun shouldEmit(policy: FilterPolicy): Boolean
+ /**
+ * Inject [HostStubGenKeptInStub] and [HostStubGenKeptInImpl] as needed to an item.
+ */
+ protected fun injectInStubAndKeepAnnotations(policy: FilterPolicy, v: UnifiedVisitor) {
+ if (policy.needsInStub) {
+ v.visitAnnotation(HostStubGenKeptInStub.CLASS_DESCRIPTOR, true)
+ }
+ if (policy.needsInImpl) {
+ v.visitAnnotation(HostStubGenKeptInImpl.CLASS_DESCRIPTOR, true)
+ }
+ }
+
override fun visit(
version: Int,
access: Int,
@@ -99,12 +113,7 @@ abstract class BaseAdapter (
nativeSubstitutionClass = fullClassName
}
// Inject annotations to generated classes.
- if (classPolicy.policy.needsInStub) {
- visitAnnotation(HostStubGenProcessedStubClass.CLASS_DESCRIPTOR, true)
- }
- if (classPolicy.policy.needsInImpl) {
- visitAnnotation(HostStubGenProcessedKeepClass.CLASS_DESCRIPTOR, true)
- }
+ injectInStubAndKeepAnnotations(classPolicy.policy, UnifiedVisitor.on(this))
}
override fun visitEnd() {
@@ -147,7 +156,11 @@ abstract class BaseAdapter (
}
log.v("Emitting field: %s %s %s", name, descriptor, policy)
- return super.visitField(access, name, descriptor, signature, value)
+ val ret = super.visitField(access, name, descriptor, signature, value)
+
+ injectInStubAndKeepAnnotations(policy.policy, UnifiedVisitor.on(ret))
+
+ return ret
}
}
@@ -194,8 +207,15 @@ abstract class BaseAdapter (
// it can do so inside visitMethodInner().
val newAccess = updateAccessFlags(access, name, descriptor)
- return visitMethodInner(access, newName, descriptor, signature, exceptions, policy,
- super.visitMethod(newAccess, newName, descriptor, signature, exceptions))
+ val ret = visitMethodInner(access, newName, descriptor, signature, exceptions, policy,
+ substituteTo != null,
+ super.visitMethod(newAccess, newName, descriptor, signature, exceptions))
+
+ ret?.let {
+ injectInStubAndKeepAnnotations(policy.policy, UnifiedVisitor.on(ret))
+ }
+
+ return ret
}
}
@@ -214,6 +234,7 @@ abstract class BaseAdapter (
signature: String?,
exceptions: Array<String>?,
policy: FilterPolicyWithReason,
+ substituted: Boolean,
superVisitor: MethodVisitor?,
): MethodVisitor?
@@ -229,7 +250,7 @@ abstract class BaseAdapter (
): ClassVisitor {
var next = nextVisitor
- val verbosePrinter = PrintWriter(log.getVerbosePrintStream())
+ val verbosePrinter = PrintWriter(log.getWriter(LogLevel.Verbose))
// Inject TraceClassVisitor for debugging.
if (options.enablePostTrace) {
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt
index e63efd0e43ba..9274a96ed9f2 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt
@@ -19,11 +19,15 @@ import com.android.hoststubgen.asm.CLASS_INITIALIZER_DESC
import com.android.hoststubgen.asm.CLASS_INITIALIZER_NAME
import com.android.hoststubgen.asm.ClassNodes
import com.android.hoststubgen.asm.isVisibilityPrivateOrPackagePrivate
+import com.android.hoststubgen.asm.prependArgTypeToMethodDescriptor
import com.android.hoststubgen.asm.writeByteCodeToPushArguments
import com.android.hoststubgen.asm.writeByteCodeToReturn
import com.android.hoststubgen.filters.FilterPolicy
import com.android.hoststubgen.filters.FilterPolicyWithReason
import com.android.hoststubgen.filters.OutputFilter
+import com.android.hoststubgen.hosthelper.HostStubGenProcessedAsIgnore
+import com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+import com.android.hoststubgen.hosthelper.HostStubGenProcessedAsThrow
import com.android.hoststubgen.hosthelper.HostTestUtils
import com.android.hoststubgen.log
import org.objectweb.asm.ClassVisitor
@@ -134,6 +138,7 @@ class ImplGeneratingAdapter(
signature: String?,
exceptions: Array<String>?,
policy: FilterPolicyWithReason,
+ substituted: Boolean,
superVisitor: MethodVisitor?,
): MethodVisitor? {
// Inject method log, if needed.
@@ -181,16 +186,23 @@ class ImplGeneratingAdapter(
)
}
+ fun MethodVisitor.withAnnotation(descriptor: String): MethodVisitor {
+ this.visitAnnotation(descriptor, true)
+ return this
+ }
+
log.withIndent {
if ((access and Opcodes.ACC_NATIVE) != 0 && nativeSubstitutionClass != null) {
log.v("Rewriting native method...")
return NativeSubstitutingMethodAdapter(
access, name, descriptor, signature, exceptions, innerVisitor)
+ .withAnnotation(HostStubGenProcessedAsSubstitute.CLASS_DESCRIPTOR)
}
if (policy.policy == FilterPolicy.Throw) {
log.v("Making method throw...")
return ThrowingMethodAdapter(
access, name, descriptor, signature, exceptions, innerVisitor)
+ .withAnnotation(HostStubGenProcessedAsThrow.CLASS_DESCRIPTOR)
}
if (policy.policy == FilterPolicy.Ignore) {
when (Type.getReturnType(descriptor)) {
@@ -198,6 +210,7 @@ class ImplGeneratingAdapter(
log.v("Making method ignored...")
return IgnoreMethodAdapter(
access, name, descriptor, signature, exceptions, innerVisitor)
+ .withAnnotation(HostStubGenProcessedAsIgnore.CLASS_DESCRIPTOR)
}
else -> {
throw RuntimeException("Ignored policy only allowed for void methods")
@@ -205,6 +218,9 @@ class ImplGeneratingAdapter(
}
}
}
+ if (substituted && innerVisitor != null) {
+ innerVisitor.withAnnotation(HostStubGenProcessedAsSubstitute.CLASS_DESCRIPTOR)
+ }
return innerVisitor
}
@@ -285,7 +301,7 @@ class ImplGeneratingAdapter(
* class.
*/
private inner class NativeSubstitutingMethodAdapter(
- access: Int,
+ val access: Int,
private val name: String,
private val descriptor: String,
signature: String?,
@@ -300,12 +316,33 @@ class ImplGeneratingAdapter(
}
override fun visitEnd() {
- writeByteCodeToPushArguments(descriptor, this)
+ var targetDescriptor = descriptor
+ var argOffset = 0
+
+ // For non-static native method, we need to tweak it a bit.
+ if ((access and Opcodes.ACC_STATIC) == 0) {
+ // Push `this` as the first argument.
+ this.visitVarInsn(Opcodes.ALOAD, 0)
+
+ // Update the descriptor -- add this class's type as the first argument
+ // to the method descriptor.
+ val thisType = Type.getType("L" + currentClassName + ";")
+
+ targetDescriptor = prependArgTypeToMethodDescriptor(
+ descriptor,
+ thisType,
+ )
+
+ // Shift the original arguments by one.
+ argOffset = 1
+ }
+
+ writeByteCodeToPushArguments(descriptor, this, argOffset)
visitMethodInsn(Opcodes.INVOKESTATIC,
nativeSubstitutionClass,
name,
- descriptor,
+ targetDescriptor,
false)
writeByteCodeToReturn(descriptor, this)
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/StubGeneratingAdapter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/StubGeneratingAdapter.kt
index 37e2a888969d..fc20f2832d28 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/StubGeneratingAdapter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/StubGeneratingAdapter.kt
@@ -45,6 +45,7 @@ class StubGeneratingAdapter(
signature: String?,
exceptions: Array<String>?,
policy: FilterPolicyWithReason,
+ substituted: Boolean,
superVisitor: MethodVisitor?,
): MethodVisitor? {
return StubMethodVisitor(access, name, descriptor, signature, exceptions, superVisitor)
diff --git a/tools/hoststubgen/hoststubgen/test-framework/README.md b/tools/hoststubgen/hoststubgen/test-framework/README.md
index 20e2f873b152..26a9ad13f746 100644
--- a/tools/hoststubgen/hoststubgen/test-framework/README.md
+++ b/tools/hoststubgen/hoststubgen/test-framework/README.md
@@ -1,26 +1,21 @@
-# HostStubGen: real framework test
+# HostStubGen: (obsolete) real framework test
This directory contains tests against the actual framework.jar code. The tests were
copied from somewhere else in the android tree. We use this directory to quickly run existing
tests.
+This directory was used during the prototype phase, but now that we have real ravenwood tests,
+this directory is obsolete and should be deleted.
+
## How to run
- With `atest`. This is the proper way to run it, but it may fail due to atest's known problems.
- See the top level README.md on why `--no-bazel-mode` is needed (for now).
-
-```
-$ atest --no-bazel-mode HostStubGenTest-framework-test-host-test
-```
-
-- With `run-ravenwood-test`
-
```
-$ run-ravenwood-test HostStubGenTest-framework-test-host-test
+$ atest HostStubGenTest-framework-all-test-host-test
```
-- Advanced option: `run-test-without-atest.sh` runs the test without using `atest` or `run-ravenwood-test`
+- Advanced option: `run-test-without-atest.sh` runs the test without using `atest`
```
$ ./run-test-without-atest.sh
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/README.md b/tools/hoststubgen/hoststubgen/test-tiny-framework/README.md
index f3c0450d42a3..344b4e953b23 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/README.md
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/README.md
@@ -2,7 +2,7 @@
This directory contains a small classes that "simulates" framework.jar, and tests against it.
-This test doesn't use the actual android framework code.
+This test is agnostic to Android, and it doesn't use any android framework code or knowledge.
## How to run
@@ -13,12 +13,6 @@ This test doesn't use the actual android framework code.
$ atest hoststubgen-test-tiny-test
```
-- With `run-ravenwood-test` should work too. This is the proper way to run it.
-
-```
-$ run-ravenwood-test hoststubgen-test-tiny-test
-```
-
- `run-test-manually.sh` also run the test, but it builds the stub/impl jars and the test without
using the build system. This is useful for debugging the tool.
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
index 3474ae49d3b6..3956893ee7ed 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
@@ -223,6 +223,105 @@ RuntimeVisibleAnnotations:
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD]
)
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 3
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=1, locals=1, args_size=1
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy;
+
+ public static int addTwo(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=2, locals=1, args_size=1
+ x: iload_0
+ x: iconst_2
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 4 0 a I
+}
+SourceFile: "IPretendingAidl.java"
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 3
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=1, locals=1, args_size=1
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub;
+
+ public static int addOne(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=2, locals=1, args_size=1
+ x: iload_0
+ x: iconst_1
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 4 0 a I
+}
+SourceFile: "IPretendingAidl.java"
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl.class
+ Compiled from "IPretendingAidl.java"
+public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl
+ minor version: 0
+ major version: 61
+ flags: (0x0601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 0, attributes: 3
+}
+SourceFile: "IPretendingAidl.java"
+NestMembers:
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.class
Compiled from "TinyFrameworkCallerCheck.java"
class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
@@ -1718,7 +1817,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 5, attributes: 2
+ interfaces: 0, fields: 1, methods: 8, attributes: 2
+ int value;
+ descriptor: I
+ flags: (0x0000)
+
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -1767,6 +1870,40 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
Start Length Slot Name Signature
0 6 0 arg1 J
0 6 2 arg2 J
+
+ public void setValue(int);
+ descriptor: (I)V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: iload_1
+ x: putfield #x // Field value:I
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 0 6 1 v I
+
+ public native int nativeNonStaticAddToValue(int);
+ descriptor: (I)I
+ flags: (0x0101) ACC_PUBLIC, ACC_NATIVE
+
+ public int nativeNonStaticAddToValue_should_be_like_this(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: iload_1
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeNonStaticAddToValue:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 0 6 1 arg I
}
SourceFile: "TinyFrameworkNative.java"
RuntimeInvisibleAnnotations:
@@ -1782,9 +1919,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
minor version: 0
major version: 61
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
- this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 3, attributes: 2
+ interfaces: 0, fields: 0, methods: 4, attributes: 2
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -1826,6 +1963,22 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
Start Length Slot Name Signature
0 4 0 arg1 J
0 4 2 arg2 J
+
+ public static int nativeNonStaticAddToValue(com.android.hoststubgen.test.tinyframework.TinyFrameworkNative, int);
+ descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: getfield #x // Field com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.value:I
+ x: iload_1
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 7 0 source Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 0 7 1 arg I
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeInvisibleAnnotations:
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt
index a1aae8a46c14..ebe14225a825 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/02-hoststubgen-test-tiny-framework-host-stub-dump.txt
@@ -1,3 +1,127 @@
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 4
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addTwo(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 4
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addOne(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl.class
+ Compiled from "IPretendingAidl.java"
+public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl
+ minor version: 0
+ major version: 61
+ flags: (0x0601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 0, attributes: 4
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestMembers:
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.class
Compiled from "TinyFrameworkCallerCheck.java"
class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
@@ -17,6 +141,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOneStub();
descriptor: ()I
@@ -28,6 +157,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -37,9 +171,9 @@ InnerClasses:
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck.class
Compiled from "TinyFrameworkCallerCheck.java"
@@ -60,6 +194,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_withCheck();
descriptor: ()I
@@ -71,6 +210,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_noCheck();
descriptor: ()I
@@ -82,15 +226,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -108,6 +257,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -122,6 +276,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -136,6 +295,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -150,6 +314,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -161,6 +330,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -172,6 +346,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -179,9 +358,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -201,14 +380,29 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int remove;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassWideAnnotations();
descriptor: ()V
@@ -220,6 +414,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -231,6 +430,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOneInner(int);
descriptor: (I)I
@@ -242,6 +446,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public void toBeRemoved(java.lang.String);
descriptor: (Ljava/lang/String;)V
@@ -253,6 +462,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -264,6 +478,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -275,6 +494,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -286,6 +510,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -297,13 +526,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -320,6 +554,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
descriptor: Ljava/util/Set;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/Set<Ljava/lang/Class<*>;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook();
descriptor: ()V
@@ -331,6 +570,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static void onClassLoaded(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)V
@@ -343,6 +587,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // (Ljava/lang/Class<*>;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -354,13 +603,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -376,6 +630,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -383,6 +642,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -391,9 +655,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
SourceFile: "TinyFrameworkClassWithInitializerDefault.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -409,6 +673,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -416,6 +685,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -424,9 +698,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
SourceFile: "TinyFrameworkClassWithInitializerStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
@@ -448,6 +722,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -455,6 +734,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex GREEN;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -462,6 +746,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex BLUE;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -469,6 +758,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -480,6 +774,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -491,6 +790,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
@@ -503,6 +807,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // (Ljava/lang/String;Ljava/lang/String;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -517,6 +826,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -531,6 +845,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -545,6 +864,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -556,14 +880,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;>;
SourceFile: "TinyFrameworkEnumComplex.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -579,6 +908,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -586,6 +920,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple DOG;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -593,6 +932,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -604,6 +948,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -615,6 +964,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple();
descriptor: (Ljava/lang/String;I)V
@@ -627,6 +981,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -638,6 +997,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -649,14 +1013,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;>;
SourceFile: "TinyFrameworkEnumSimple.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -679,6 +1048,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int testException();
descriptor: ()I
@@ -690,13 +1064,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -712,6 +1091,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPolicy();
descriptor: ()V
@@ -723,6 +1107,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -734,6 +1123,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -745,6 +1139,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -756,6 +1155,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -767,13 +1171,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkForTextPolicy.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested.class
Compiled from "TinyFrameworkLambdas.java"
public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nested
@@ -787,6 +1196,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -795,6 +1209,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -809,6 +1228,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -824,6 +1248,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -839,6 +1268,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -853,6 +1287,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -864,6 +1303,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -875,6 +1319,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -886,6 +1335,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -893,9 +1347,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -915,6 +1369,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -923,6 +1382,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -937,6 +1401,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -952,6 +1421,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -967,6 +1441,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -981,6 +1460,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -992,6 +1476,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -1003,6 +1492,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -1014,6 +1508,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -1021,9 +1520,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1039,7 +1538,16 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 5, attributes: 3
+ interfaces: 0, fields: 1, methods: 8, attributes: 3
+ int value;
+ descriptor: I
+ flags: (0x0000)
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -1050,10 +1558,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static native int nativeAddTwo(int);
descriptor: (I)I
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -1065,10 +1583,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static native long nativeLongPlus(long, long);
descriptor: (JJ)J
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -1080,13 +1608,59 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public void setValue(int);
+ descriptor: (I)V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=2, args_size=2
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public native int nativeNonStaticAddToValue(int);
+ descriptor: (I)I
+ flags: (0x0101) ACC_PUBLIC, ACC_NATIVE
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public int nativeNonStaticAddToValue_should_be_like_this(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=2, args_size=2
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1106,6 +1680,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$BaseClass(int);
descriptor: (I)V
@@ -1117,15 +1696,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1139,10 +1723,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$InnerClass(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses);
descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
@@ -1154,15 +1748,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public #x= #x of #x; // InnerClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1179,6 +1778,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$StaticNestedClass();
descriptor: ()V
@@ -1190,6 +1794,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -1202,6 +1811,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // StaticNestedClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -1209,9 +1823,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1235,6 +1849,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -1242,9 +1861,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1259,11 +1878,21 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static final java.util.function.Supplier<java.lang.Integer> sSupplier;
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses();
descriptor: ()V
@@ -1275,6 +1904,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.util.function.Supplier<java.lang.Integer> getSupplier();
descriptor: ()Ljava/util/function/Supplier;
@@ -1287,6 +1921,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -1299,6 +1938,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1310,6 +1954,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -1324,9 +1973,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1359,6 +2008,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int foo(int);
descriptor: (I)I
@@ -1370,13 +2024,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkPackageRedirect.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1399,6 +2058,11 @@ public class com.unsupported.UnsupportedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int getValue();
descriptor: ()I
@@ -1410,13 +2074,18 @@ public class com.unsupported.UnsupportedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "UnsupportedClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt
index 29626f26d367..4cb2a9f326f9 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-impl-dump.txt
@@ -10,11 +10,14 @@ public interface android.hosttest.annotation.HostSideTestClassLoadHook extends j
public abstract java.lang.String value();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "HostSideTestClassLoadHook.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -36,7 +39,7 @@ public interface android.hosttest.annotation.HostSideTestKeep extends java.lang.
SourceFile: "HostSideTestKeep.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -57,11 +60,14 @@ public interface android.hosttest.annotation.HostSideTestNativeSubstitutionClass
public abstract java.lang.String value();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "HostSideTestNativeSubstitutionClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -83,7 +89,7 @@ public interface android.hosttest.annotation.HostSideTestRemove extends java.lan
SourceFile: "HostSideTestRemove.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -105,7 +111,7 @@ public interface android.hosttest.annotation.HostSideTestStub extends java.lang.
SourceFile: "HostSideTestStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -126,11 +132,14 @@ public interface android.hosttest.annotation.HostSideTestSubstitute extends java
public abstract java.lang.String suffix();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "HostSideTestSubstitute.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD]
@@ -152,7 +161,7 @@ public interface android.hosttest.annotation.HostSideTestThrow extends java.lang
SourceFile: "HostSideTestThrow.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -174,7 +183,7 @@ public interface android.hosttest.annotation.HostSideTestWholeClassKeep extends
SourceFile: "HostSideTestWholeClassKeep.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -196,7 +205,7 @@ public interface android.hosttest.annotation.HostSideTestWholeClassStub extends
SourceFile: "HostSideTestWholeClassStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -205,6 +214,140 @@ RuntimeVisibleAnnotations:
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 4
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=1, locals=1, args_size=1
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addTwo(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=2, locals=1, args_size=1
+ x: iload_0
+ x: iconst_2
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 4 0 a I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 4
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=1, locals=1, args_size=1
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addOne(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=2, locals=1, args_size=1
+ x: iload_0
+ x: iconst_1
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 4 0 a I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl.class
+ Compiled from "IPretendingAidl.java"
+public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl
+ minor version: 0
+ major version: 61
+ flags: (0x0601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 0, attributes: 4
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestMembers:
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.class
Compiled from "TinyFrameworkCallerCheck.java"
class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
@@ -226,6 +369,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOneKeep();
descriptor: ()I
@@ -241,6 +389,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: iconst_1
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -253,6 +404,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: iconst_1
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -262,9 +418,9 @@ InnerClasses:
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck.class
Compiled from "TinyFrameworkCallerCheck.java"
@@ -287,6 +443,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_withCheck();
descriptor: ()I
@@ -296,6 +457,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneKeep:()I
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_noCheck();
descriptor: ()I
@@ -305,15 +471,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneStub:()I
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -331,6 +502,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -338,6 +514,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -370,6 +549,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
LocalVariableTable:
Start Length Slot Name Signature
0 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -388,6 +572,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 6 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -412,6 +601,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
Start Length Slot Name Signature
15 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
15 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -430,6 +622,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
Start Length Slot Name Signature
0 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
0 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -444,6 +643,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
LocalVariableTable:
Start Length Slot Name Signature
0 4 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -462,6 +668,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Unreachable
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsThrow
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestThrow
@@ -478,6 +689,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -485,9 +701,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -507,14 +723,29 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int remove;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassWideAnnotations();
descriptor: ()V
@@ -534,6 +765,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
0 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -549,6 +785,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
0 6 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOneInner(int);
descriptor: (I)I
@@ -564,6 +805,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
0 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
0 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public void toBeRemoved(java.lang.String);
descriptor: (Ljava/lang/String;)V
@@ -579,6 +825,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
0 8 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
0 8 1 foo Ljava/lang/String;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -594,6 +845,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
0 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
0 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -608,6 +866,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
0 4 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -620,6 +885,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
0 3 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -633,13 +903,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -656,6 +931,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
descriptor: Ljava/util/Set;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/Set<Ljava/lang/Class<*>;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook();
descriptor: ()V
@@ -669,6 +949,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static void onClassLoaded(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)V
@@ -688,6 +973,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
Start Length Slot Name Signature
0 11 0 clazz Ljava/lang/Class<*>;
Signature: #x // (Ljava/lang/Class<*>;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -700,13 +990,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: putstatic #x // Field sLoadedClasses:Ljava/util/Set;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -722,6 +1017,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -729,6 +1029,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -737,9 +1042,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
SourceFile: "TinyFrameworkClassWithInitializerDefault.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -755,6 +1060,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -762,6 +1072,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -782,13 +1097,16 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
x: putstatic #x // Field sObject:Ljava/lang/Object;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassWithInitializerStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
@@ -810,6 +1128,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -817,6 +1140,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex GREEN;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -824,6 +1152,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex BLUE;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -831,6 +1164,9 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private final java.lang.String mLongName;
descriptor: Ljava/lang/String;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -838,6 +1174,9 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private final java.lang.String mShortName;
descriptor: Ljava/lang/String;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -845,6 +1184,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -856,6 +1200,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: checkcast #x // class "[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;"
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -871,6 +1220,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 name Ljava/lang/String;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
@@ -895,6 +1249,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
0 18 3 longName Ljava/lang/String;
0 18 4 shortName Ljava/lang/String;
Signature: #x // (Ljava/lang/String;Ljava/lang/String;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -911,6 +1270,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -927,6 +1291,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -952,6 +1321,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: aastore
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -986,14 +1360,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: putstatic #x // Field $VALUES:[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;>;
SourceFile: "TinyFrameworkEnumComplex.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1009,6 +1388,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1016,6 +1400,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple DOG;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1023,6 +1412,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -1034,6 +1428,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: checkcast #x // class "[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;"
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -1049,6 +1448,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 name Ljava/lang/String;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple();
descriptor: (Ljava/lang/String;I)V
@@ -1065,6 +1469,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
Start Length Slot Name Signature
0 7 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
Signature: #x // ()V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -1083,6 +1492,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: aastore
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1105,14 +1519,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: putstatic #x // Field $VALUES:[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;>;
SourceFile: "TinyFrameworkEnumSimple.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1137,6 +1556,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int testException();
descriptor: ()I
@@ -1165,13 +1589,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
LocalVariableTable:
Start Length Slot Name Signature
11 11 0 e Ljava/lang/Exception;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1187,10 +1616,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -1220,6 +1657,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
LocalVariableTable:
Start Length Slot Name Signature
0 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -1235,6 +1677,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
0 6 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOneInner(int);
descriptor: (I)I
@@ -1256,6 +1703,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
Start Length Slot Name Signature
15 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
15 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -1271,6 +1721,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
Start Length Slot Name Signature
0 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
0 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -1285,6 +1742,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
LocalVariableTable:
Start Length Slot Name Signature
0 4 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -1303,6 +1767,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Unreachable
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsThrow
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -1316,13 +1785,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkForTextPolicy.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested.class
Compiled from "TinyFrameworkLambdas.java"
public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nested
@@ -1336,6 +1810,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1344,6 +1823,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1363,6 +1847,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
LocalVariableTable:
Start Length Slot Name Signature
0 14 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1379,6 +1868,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested;
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1392,6 +1886,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1405,6 +1904,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -1415,6 +1919,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -1425,6 +1934,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -1435,6 +1949,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1445,6 +1964,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -1452,9 +1974,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1495,6 +2017,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1503,6 +2030,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1522,6 +2054,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
LocalVariableTable:
Start Length Slot Name Signature
0 14 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1538,6 +2075,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas;
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1551,6 +2093,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1564,6 +2111,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -1574,6 +2126,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -1584,6 +2141,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -1594,6 +2156,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1604,6 +2171,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -1611,9 +2181,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1650,7 +2220,16 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 5, attributes: 3
+ interfaces: 0, fields: 1, methods: 8, attributes: 3
+ int value;
+ descriptor: I
+ flags: (0x0000)
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -1663,6 +2242,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo(int);
descriptor: (I)I
@@ -1672,6 +2256,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: iload_0
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
x: ireturn
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -1685,6 +2276,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus(long, long);
descriptor: (JJ)J
@@ -1695,6 +2291,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: lload_2
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
x: lreturn
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -1710,13 +2313,75 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
Start Length Slot Name Signature
0 6 0 arg1 J
0 6 2 arg2 J
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public void setValue(int);
+ descriptor: (I)V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: iload_1
+ x: putfield #x // Field value:I
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 0 6 1 v I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public int nativeNonStaticAddToValue(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: iload_1
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeNonStaticAddToValue:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: ireturn
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public int nativeNonStaticAddToValue_should_be_like_this(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: iload_1
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeNonStaticAddToValue:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 0 6 1 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1732,7 +2397,7 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 3, attributes: 3
+ interfaces: 0, fields: 0, methods: 4, attributes: 3
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -1751,6 +2416,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo(int);
descriptor: (I)I
@@ -1771,6 +2439,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
LocalVariableTable:
Start Length Slot Name Signature
15 4 0 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus(long, long);
descriptor: (JJ)J
@@ -1792,11 +2463,39 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
Start Length Slot Name Signature
15 4 0 arg1 J
15 4 2 arg2 J
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int nativeNonStaticAddToValue(com.android.hoststubgen.test.tinyframework.TinyFrameworkNative, int);
+ descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=2, args_size=2
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String nativeNonStaticAddToValue
+ x: ldc #x // String (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: getfield #x // Field com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.value:I
+ x: iload_1
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 15 7 0 source Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 15 7 1 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
@@ -1812,6 +2511,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses);
descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
@@ -1829,6 +2531,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
Start Length Slot Name Signature
0 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1;
0 10 1 this$0 Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -1848,6 +2553,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -1867,6 +2575,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -1875,7 +2586,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1898,6 +2609,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -1917,6 +2631,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -1936,6 +2653,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
@@ -1944,7 +2664,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1958,6 +2678,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses);
descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
@@ -1975,6 +2698,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
Start Length Slot Name Signature
0 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3;
0 10 1 this$0 Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -1994,6 +2720,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2013,6 +2742,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
@@ -2021,7 +2753,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2044,6 +2776,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2063,6 +2798,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2082,6 +2820,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
@@ -2090,7 +2831,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2104,6 +2845,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$BaseClass(int);
descriptor: (I)V
@@ -2121,15 +2867,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
0 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass;
0 10 1 x I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2143,10 +2894,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$InnerClass(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses);
descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
@@ -2167,15 +2928,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
0 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass;
0 15 1 this$0 Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public #x= #x of #x; // InnerClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -2201,6 +2967,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2220,6 +2989,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat
LocalVariableTable:
Start Length Slot Name Signature
15 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2239,6 +3011,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // StaticNestedClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -2248,7 +3023,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2262,6 +3037,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$StaticNestedClass();
descriptor: ()V
@@ -2278,6 +3058,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
LocalVariableTable:
Start Length Slot Name Signature
0 11 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -2290,6 +3075,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // StaticNestedClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -2297,9 +3087,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -2327,6 +3117,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
0 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass;
0 6 1 x I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -2334,9 +3129,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2351,11 +3146,21 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static final java.util.function.Supplier<java.lang.Integer> sSupplier;
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses();
descriptor: ()V
@@ -2375,6 +3180,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
LocalVariableTable:
Start Length Slot Name Signature
0 17 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.util.function.Supplier<java.lang.Integer> getSupplier();
descriptor: ()Ljava/util/function/Supplier;
@@ -2391,6 +3201,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
0 9 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -2403,6 +3218,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -2415,6 +3235,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -2429,9 +3254,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -2466,6 +3291,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPackageRedirect;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int foo(int);
descriptor: (I)I
@@ -2482,13 +3312,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
LocalVariableTable:
Start Length Slot Name Signature
0 12 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkPackageRedirect.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -2504,6 +3339,9 @@ public class com.supported.UnsupportedClass
private final int mValue;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.supported.UnsupportedClass(int);
descriptor: (I)V
@@ -2527,6 +3365,9 @@ public class com.supported.UnsupportedClass
Start Length Slot Name Signature
15 10 0 this Lcom/supported/UnsupportedClass;
15 10 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int getValue();
descriptor: ()I
@@ -2546,11 +3387,14 @@ public class com.supported.UnsupportedClass
LocalVariableTable:
Start Length Slot Name Signature
15 5 0 this Lcom/supported/UnsupportedClass;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "UnsupportedClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
@@ -2580,6 +3424,11 @@ public class com.unsupported.UnsupportedClass
Start Length Slot Name Signature
0 14 0 this Lcom/unsupported/UnsupportedClass;
0 14 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int getValue();
descriptor: ()I
@@ -2595,13 +3444,18 @@ public class com.unsupported.UnsupportedClass
LocalVariableTable:
Start Length Slot Name Signature
0 10 0 this Lcom/unsupported/UnsupportedClass;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "UnsupportedClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/12-hoststubgen-test-tiny-framework-host-ext-stub-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/12-hoststubgen-test-tiny-framework-host-ext-stub-dump.txt
index a1aae8a46c14..ebe14225a825 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/12-hoststubgen-test-tiny-framework-host-ext-stub-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/12-hoststubgen-test-tiny-framework-host-ext-stub-dump.txt
@@ -1,3 +1,127 @@
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 4
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addTwo(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 2, attributes: 4
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addOne(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=3, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl.class
+ Compiled from "IPretendingAidl.java"
+public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl
+ minor version: 0
+ major version: 61
+ flags: (0x0601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 0, attributes: 4
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestMembers:
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.class
Compiled from "TinyFrameworkCallerCheck.java"
class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
@@ -17,6 +141,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOneStub();
descriptor: ()I
@@ -28,6 +157,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -37,9 +171,9 @@ InnerClasses:
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck.class
Compiled from "TinyFrameworkCallerCheck.java"
@@ -60,6 +194,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_withCheck();
descriptor: ()I
@@ -71,6 +210,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_noCheck();
descriptor: ()I
@@ -82,15 +226,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -108,6 +257,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -122,6 +276,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -136,6 +295,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -150,6 +314,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -161,6 +330,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -172,6 +346,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -179,9 +358,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -201,14 +380,29 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int remove;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassWideAnnotations();
descriptor: ()V
@@ -220,6 +414,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -231,6 +430,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOneInner(int);
descriptor: (I)I
@@ -242,6 +446,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public void toBeRemoved(java.lang.String);
descriptor: (Ljava/lang/String;)V
@@ -253,6 +462,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -264,6 +478,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -275,6 +494,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -286,6 +510,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -297,13 +526,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -320,6 +554,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
descriptor: Ljava/util/Set;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/Set<Ljava/lang/Class<*>;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook();
descriptor: ()V
@@ -331,6 +570,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static void onClassLoaded(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)V
@@ -343,6 +587,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // (Ljava/lang/Class<*>;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -354,13 +603,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -376,6 +630,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -383,6 +642,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -391,9 +655,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
SourceFile: "TinyFrameworkClassWithInitializerDefault.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -409,6 +673,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -416,6 +685,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -424,9 +698,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
SourceFile: "TinyFrameworkClassWithInitializerStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
@@ -448,6 +722,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -455,6 +734,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex GREEN;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -462,6 +746,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex BLUE;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -469,6 +758,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -480,6 +774,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -491,6 +790,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
@@ -503,6 +807,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // (Ljava/lang/String;Ljava/lang/String;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -517,6 +826,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -531,6 +845,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -545,6 +864,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -556,14 +880,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;>;
SourceFile: "TinyFrameworkEnumComplex.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -579,6 +908,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -586,6 +920,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple DOG;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -593,6 +932,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -604,6 +948,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -615,6 +964,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple();
descriptor: (Ljava/lang/String;I)V
@@ -627,6 +981,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -638,6 +997,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -649,14 +1013,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;>;
SourceFile: "TinyFrameworkEnumSimple.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -679,6 +1048,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int testException();
descriptor: ()I
@@ -690,13 +1064,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -712,6 +1091,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPolicy();
descriptor: ()V
@@ -723,6 +1107,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -734,6 +1123,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -745,6 +1139,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -756,6 +1155,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -767,13 +1171,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkForTextPolicy.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested.class
Compiled from "TinyFrameworkLambdas.java"
public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nested
@@ -787,6 +1196,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -795,6 +1209,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -809,6 +1228,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -824,6 +1248,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -839,6 +1268,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -853,6 +1287,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -864,6 +1303,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -875,6 +1319,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -886,6 +1335,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -893,9 +1347,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -915,6 +1369,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -923,6 +1382,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -937,6 +1401,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -952,6 +1421,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -967,6 +1441,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -981,6 +1460,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -992,6 +1476,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -1003,6 +1492,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -1014,6 +1508,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -1021,9 +1520,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1039,7 +1538,16 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 5, attributes: 3
+ interfaces: 0, fields: 1, methods: 8, attributes: 3
+ int value;
+ descriptor: I
+ flags: (0x0000)
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -1050,10 +1558,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static native int nativeAddTwo(int);
descriptor: (I)I
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -1065,10 +1583,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static native long nativeLongPlus(long, long);
descriptor: (JJ)J
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -1080,13 +1608,59 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public void setValue(int);
+ descriptor: (I)V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=2, args_size=2
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public native int nativeNonStaticAddToValue(int);
+ descriptor: (I)I
+ flags: (0x0101) ACC_PUBLIC, ACC_NATIVE
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public int nativeNonStaticAddToValue_should_be_like_this(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=3, locals=2, args_size=2
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: ldc #x // String Stub!
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
+ x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1106,6 +1680,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$BaseClass(int);
descriptor: (I)V
@@ -1117,15 +1696,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1139,10 +1723,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$InnerClass(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses);
descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V
@@ -1154,15 +1748,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public #x= #x of #x; // InnerClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1179,6 +1778,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$StaticNestedClass();
descriptor: ()V
@@ -1190,6 +1794,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -1202,6 +1811,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // StaticNestedClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -1209,9 +1823,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1235,6 +1849,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -1242,9 +1861,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -1259,11 +1878,21 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static final java.util.function.Supplier<java.lang.Integer> sSupplier;
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses();
descriptor: ()V
@@ -1275,6 +1904,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.util.function.Supplier<java.lang.Integer> getSupplier();
descriptor: ()Ljava/util/function/Supplier;
@@ -1287,6 +1921,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -1299,6 +1938,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1310,6 +1954,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -1324,9 +1973,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1359,6 +2008,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int foo(int);
descriptor: (I)I
@@ -1370,13 +2024,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkPackageRedirect.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1399,6 +2058,11 @@ public class com.unsupported.UnsupportedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int getValue();
descriptor: ()I
@@ -1410,13 +2074,18 @@ public class com.unsupported.UnsupportedClass
x: ldc #x // String Stub!
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "UnsupportedClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-impl-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-impl-dump.txt
index ed7e7d3e6375..49be4db4eb9b 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-impl-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-impl-dump.txt
@@ -20,11 +20,14 @@ public interface android.hosttest.annotation.HostSideTestClassLoadHook extends j
public abstract java.lang.String value();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "HostSideTestClassLoadHook.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -55,7 +58,7 @@ public interface android.hosttest.annotation.HostSideTestKeep extends java.lang.
SourceFile: "HostSideTestKeep.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -86,11 +89,14 @@ public interface android.hosttest.annotation.HostSideTestNativeSubstitutionClass
public abstract java.lang.String value();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "HostSideTestNativeSubstitutionClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -121,7 +127,7 @@ public interface android.hosttest.annotation.HostSideTestRemove extends java.lan
SourceFile: "HostSideTestRemove.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -152,7 +158,7 @@ public interface android.hosttest.annotation.HostSideTestStub extends java.lang.
SourceFile: "HostSideTestStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x,e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE,Ljava/lang/annotation/ElementType;.FIELD,Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -183,11 +189,14 @@ public interface android.hosttest.annotation.HostSideTestSubstitute extends java
public abstract java.lang.String suffix();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "HostSideTestSubstitute.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD]
@@ -218,7 +227,7 @@ public interface android.hosttest.annotation.HostSideTestThrow extends java.lang
SourceFile: "HostSideTestThrow.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x,e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.METHOD,Ljava/lang/annotation/ElementType;.CONSTRUCTOR]
@@ -249,7 +258,7 @@ public interface android.hosttest.annotation.HostSideTestWholeClassKeep extends
SourceFile: "HostSideTestWholeClassKeep.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -280,7 +289,7 @@ public interface android.hosttest.annotation.HostSideTestWholeClassStub extends
SourceFile: "HostSideTestWholeClassStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
value=[Ljava/lang/annotation/ElementType;.TYPE]
@@ -289,6 +298,189 @@ RuntimeVisibleAnnotations:
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 3, attributes: 4
+ private static {};
+ descriptor: ()V
+ flags: (0x000a) ACC_PRIVATE, ACC_STATIC
+ Code:
+ stack=2, locals=0, args_size=0
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: return
+
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=4, locals=1, args_size=1
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ x: ldc #x // String <init>
+ x: ldc #x // String ()V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 5 0 this Lcom/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addTwo(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=1, args_size=1
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
+ x: ldc #x // String addTwo
+ x: ldc #x // String (I)I
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: iload_0
+ x: iconst_2
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 4 0 a I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub.class
+ Compiled from "IPretendingAidl.java"
+public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub
+ minor version: 0
+ major version: 61
+ flags: (0x0021) ACC_PUBLIC, ACC_SUPER
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 3, attributes: 4
+ private static {};
+ descriptor: ()V
+ flags: (0x000a) ACC_PRIVATE, ACC_STATIC
+ Code:
+ stack=2, locals=0, args_size=0
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: return
+
+ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=4, locals=1, args_size=1
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ x: ldc #x // String <init>
+ x: ldc #x // String ()V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: aload_0
+ x: invokespecial #x // Method java/lang/Object."<init>":()V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 5 0 this Lcom/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int addOne(int);
+ descriptor: (I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=1, args_size=1
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ x: ldc #x // String addOne
+ x: ldc #x // String (I)I
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: iload_0
+ x: iconst_1
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 4 0 a I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestHost: class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+## Class: com/android/hoststubgen/test/tinyframework/IPretendingAidl.class
+ Compiled from "IPretendingAidl.java"
+public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl
+ minor version: 0
+ major version: 61
+ flags: (0x0601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
+ this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ super_class: #x // java/lang/Object
+ interfaces: 0, fields: 0, methods: 1, attributes: 4
+ private static {};
+ descriptor: ()V
+ flags: (0x000a) ACC_PRIVATE, ACC_STATIC
+ Code:
+ stack=2, locals=0, args_size=0
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: return
+}
+InnerClasses:
+ public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl
+ public static #x= #x of #x; // Proxy=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy of class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+SourceFile: "IPretendingAidl.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+NestMembers:
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub
+ com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.class
Compiled from "TinyFrameworkCallerCheck.java"
class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
@@ -325,6 +517,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOneKeep();
descriptor: ()I
@@ -345,6 +542,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: iconst_1
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -362,6 +562,11 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck$Impl
x: iconst_1
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -371,9 +576,9 @@ InnerClasses:
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck.class
Compiled from "TinyFrameworkCallerCheck.java"
@@ -411,6 +616,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_withCheck();
descriptor: ()I
@@ -425,6 +635,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneKeep:()I
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int getOne_noCheck();
descriptor: ()I
@@ -439,15 +654,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkCallerCheck
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl.getOneStub:()I
x: ireturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
private static #x= #x of #x; // Impl=class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck$Impl of class com/android/hoststubgen/test/tinyframework/TinyFrameworkCallerCheck
SourceFile: "TinyFrameworkCallerCheck.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -465,6 +685,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -472,6 +697,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -512,6 +740,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
LocalVariableTable:
Start Length Slot Name Signature
11 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -535,6 +768,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
Start Length Slot Name Signature
11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
11 6 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -564,6 +802,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
Start Length Slot Name Signature
26 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
26 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -587,6 +828,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
Start Length Slot Name Signature
11 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
11 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -606,6 +854,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
LocalVariableTable:
Start Length Slot Name Signature
11 4 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -629,6 +884,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
x: ldc #x // String Unreachable
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsThrow
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestThrow
@@ -650,6 +910,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -657,9 +922,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
SourceFile: "TinyFrameworkClassAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -679,14 +944,29 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int remove;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -721,6 +1001,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
11 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -741,6 +1026,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
11 6 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOneInner(int);
descriptor: (I)I
@@ -761,6 +1051,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
11 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
11 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public void toBeRemoved(java.lang.String);
descriptor: (Ljava/lang/String;)V
@@ -781,6 +1076,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
11 8 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
11 8 1 foo Ljava/lang/String;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -801,6 +1101,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
Start Length Slot Name Signature
11 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
11 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -820,6 +1127,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
11 4 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -837,6 +1151,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
11 3 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -855,13 +1174,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassClassW
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassClassWideAnnotations;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassClassWideAnnotations.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -878,6 +1202,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
descriptor: Ljava/util/Set;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/Set<Ljava/lang/Class<*>;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook();
descriptor: ()V
@@ -896,6 +1225,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static void onClassLoaded(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)V
@@ -920,6 +1254,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
Start Length Slot Name Signature
11 11 0 clazz Ljava/lang/Class<*>;
Signature: #x // (Ljava/lang/Class<*>;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -940,13 +1279,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo
x: putstatic #x // Field sLoadedClasses:Ljava/util/Set;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassLoadHook.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -962,6 +1306,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -969,6 +1318,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -977,9 +1331,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
SourceFile: "TinyFrameworkClassWithInitializerDefault.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -995,6 +1349,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static boolean sInitialized;
descriptor: Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1002,6 +1361,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
public static java.lang.Object sObject;
descriptor: Ljava/lang/Object;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1030,13 +1394,16 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn
x: putstatic #x // Field sObject:Ljava/lang/Object;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkClassWithInitializerStub.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x(#x=s#x)
android.hosttest.annotation.HostSideTestClassLoadHook(
@@ -1058,6 +1425,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1065,6 +1437,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex GREEN;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1072,6 +1449,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex BLUE;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1079,6 +1461,9 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private final java.lang.String mLongName;
descriptor: Ljava/lang/String;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -1086,6 +1471,9 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private final java.lang.String mShortName;
descriptor: Ljava/lang/String;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestKeep
@@ -1093,6 +1481,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -1109,6 +1502,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: checkcast #x // class "[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;"
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
@@ -1129,6 +1527,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
LocalVariableTable:
Start Length Slot Name Signature
11 10 0 name Ljava/lang/String;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex(java.lang.String, java.lang.String);
descriptor: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
@@ -1158,6 +1561,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
11 18 3 longName Ljava/lang/String;
11 18 4 shortName Ljava/lang/String;
Signature: #x // (Ljava/lang/String;Ljava/lang/String;)V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1179,6 +1587,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1200,6 +1613,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1230,6 +1648,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: aastore
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1272,14 +1695,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC
x: putstatic #x // Field $VALUES:[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex;>;
SourceFile: "TinyFrameworkEnumComplex.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1295,6 +1723,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1302,6 +1735,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple DOG;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1309,6 +1747,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
private static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $VALUES;
descriptor: [Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
flags: (0x101a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -1325,6 +1768,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: checkcast #x // class "[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;"
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple valueOf(java.lang.String);
descriptor: (Ljava/lang/String;)Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -1345,6 +1793,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
LocalVariableTable:
Start Length Slot Name Signature
11 10 0 name Ljava/lang/String;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple();
descriptor: (Ljava/lang/String;I)V
@@ -1366,6 +1819,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
Start Length Slot Name Signature
11 7 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
Signature: #x // ()V
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple[] $values();
descriptor: ()[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
@@ -1389,6 +1847,11 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: aastore
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1419,14 +1882,19 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS
x: putstatic #x // Field $VALUES:[Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
Signature: #x // Ljava/lang/Enum<Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple;>;
SourceFile: "TinyFrameworkEnumSimple.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1466,6 +1934,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int testException();
descriptor: ()I
@@ -1499,13 +1972,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe
LocalVariableTable:
Start Length Slot Name Signature
22 11 0 e Ljava/lang/Exception;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkExceptionTester.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -1521,10 +1999,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
public int stub;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int keep;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -1562,6 +2048,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
LocalVariableTable:
Start Length Slot Name Signature
11 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOne(int);
descriptor: (I)I
@@ -1582,6 +2073,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
Start Length Slot Name Signature
11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
11 6 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addOneInner(int);
descriptor: (I)I
@@ -1608,6 +2104,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
Start Length Slot Name Signature
26 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
26 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int addTwo(int);
descriptor: (I)I
@@ -1628,6 +2127,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
Start Length Slot Name Signature
11 4 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
11 4 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddThree(int);
descriptor: (I)I
@@ -1647,6 +2153,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
LocalVariableTable:
Start Length Slot Name Signature
11 4 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String unsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -1670,6 +2183,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
x: ldc #x // String Unreachable
x: invokespecial #x // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
x: athrow
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsThrow
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.String visibleButUsesUnsupportedMethod();
descriptor: ()Ljava/lang/String;
@@ -1688,13 +2206,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkForTextPolicy.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested.class
Compiled from "TinyFrameworkLambdas.java"
public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nested
@@ -1708,6 +2231,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1716,6 +2244,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1740,6 +2273,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
LocalVariableTable:
Start Length Slot Name Signature
11 14 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1761,6 +2299,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
Start Length Slot Name Signature
11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested;
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1779,6 +2322,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1797,6 +2345,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -1812,6 +2365,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -1827,6 +2385,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -1842,6 +2405,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -1860,6 +2428,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes
x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -1867,9 +2438,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1910,6 +2481,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1918,6 +2494,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1942,6 +2523,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
LocalVariableTable:
Start Length Slot Name Signature
11 14 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1963,6 +2549,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
Start Length Slot Name Signature
11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas;
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1981,6 +2572,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -1999,6 +2595,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$getSupplier$2();
descriptor: ()Ljava/lang/Integer;
@@ -2014,6 +2615,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$static$1();
descriptor: ()Ljava/lang/Integer;
@@ -2029,6 +2635,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static java.lang.Integer lambda$new$0();
descriptor: ()Ljava/lang/Integer;
@@ -2044,6 +2655,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: invokestatic #x // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
x: areturn
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -2062,6 +2678,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas
x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // Nested=class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested of class com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas
@@ -2069,9 +2688,9 @@ InnerClasses:
SourceFile: "TinyFrameworkLambdas.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestStub
@@ -2108,7 +2727,16 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 6, attributes: 3
+ interfaces: 0, fields: 1, methods: 9, attributes: 3
+ int value;
+ descriptor: I
+ flags: (0x0000)
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
private static {};
descriptor: ()V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
@@ -2136,6 +2764,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo(int);
descriptor: (I)I
@@ -2145,6 +2778,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: iload_0
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeAddTwo:(I)I
x: ireturn
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -2163,6 +2803,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus(long, long);
descriptor: (JJ)J
@@ -2173,6 +2818,13 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
x: lload_2
x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeLongPlus:(JJ)J
x: lreturn
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -2193,13 +2845,85 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative
Start Length Slot Name Signature
11 6 0 arg1 J
11 6 2 arg2 J
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public void setValue(int);
+ descriptor: (I)V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=4, locals=2, args_size=2
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
+ x: ldc #x // String setValue
+ x: ldc #x // String (I)V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: aload_0
+ x: iload_1
+ x: putfield #x // Field value:I
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 11 6 1 v I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public int nativeNonStaticAddToValue(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=2, args_size=2
+ x: aload_0
+ x: iload_1
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeNonStaticAddToValue:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: ireturn
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public int nativeNonStaticAddToValue_should_be_like_this(int);
+ descriptor: (I)I
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=4, locals=2, args_size=2
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
+ x: ldc #x // String nativeNonStaticAddToValue_should_be_like_this
+ x: ldc #x // String (I)I
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: aload_0
+ x: iload_1
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.nativeNonStaticAddToValue:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 11 6 1 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -2215,7 +2939,7 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 4, attributes: 3
+ interfaces: 0, fields: 0, methods: 5, attributes: 3
private static {};
descriptor: ()V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
@@ -2249,6 +2973,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int nativeAddTwo(int);
descriptor: (I)I
@@ -2274,6 +3001,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
LocalVariableTable:
Start Length Slot Name Signature
26 4 0 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static long nativeLongPlus(long, long);
descriptor: (JJ)J
@@ -2300,11 +3030,44 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host
Start Length Slot Name Signature
26 4 0 arg1 J
26 4 2 arg2 J
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
+
+ public static int nativeNonStaticAddToValue(com.android.hoststubgen.test.tinyframework.TinyFrameworkNative, int);
+ descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=2, args_size=2
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String nativeNonStaticAddToValue
+ x: ldc #x // String (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: ldc #x // String com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String nativeNonStaticAddToValue
+ x: ldc #x // String (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;I)I
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.getStackWalker:()Ljava/lang/StackWalker;
+ x: invokevirtual #x // Method java/lang/StackWalker.getCallerClass:()Ljava/lang/Class;
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onNonStubMethodCalled:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V
+ x: aload_0
+ x: getfield #x // Field com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.value:I
+ x: iload_1
+ x: iadd
+ x: ireturn
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 26 7 0 source Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ 26 7 1 arg I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
@@ -2320,6 +3083,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -2352,6 +3118,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
Start Length Slot Name Signature
11 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1;
11 10 1 this$0 Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2376,6 +3145,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2400,6 +3172,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -2408,7 +3183,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2446,6 +3221,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2470,6 +3248,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2494,6 +3275,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2
@@ -2502,7 +3286,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2516,6 +3300,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -2548,6 +3335,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
Start Length Slot Name Signature
11 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3;
11 10 1 this$0 Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2572,6 +3362,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2596,6 +3389,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3
@@ -2604,7 +3400,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2642,6 +3438,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2666,6 +3465,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2690,6 +3492,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4
@@ -2698,7 +3503,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2712,6 +3517,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -2744,15 +3554,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
11 10 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass;
11 10 1 x I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2766,10 +3581,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0;
descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -2805,15 +3630,20 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
11 15 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass;
11 15 1 this$0 Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public #x= #x of #x; // InnerClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -2854,6 +3684,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Integer get();
descriptor: ()Ljava/lang/Integer;
@@ -2878,6 +3711,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat
LocalVariableTable:
Start Length Slot Name Signature
26 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.lang.Object get();
descriptor: ()Ljava/lang/Object;
@@ -2902,6 +3738,9 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // StaticNestedClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -2911,7 +3750,7 @@ Signature: #x // Ljava/lang/Object;Ljava/util/function
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -2925,6 +3764,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
public int value;
descriptor: I
flags: (0x0001) ACC_PUBLIC
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -2956,6 +3800,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
LocalVariableTable:
Start Length Slot Name Signature
11 11 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -2973,6 +3822,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // StaticNestedClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -2980,9 +3834,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -3025,6 +3879,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
11 6 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass;
11 6 1 x I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
public static #x= #x of #x; // BaseClass=class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass of class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
@@ -3032,9 +3891,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses.class
Compiled from "TinyFrameworkNestedClasses.java"
@@ -3049,11 +3908,21 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
descriptor: Ljava/util/function/Supplier;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static final java.util.function.Supplier<java.lang.Integer> sSupplier;
descriptor: Ljava/util/function/Supplier;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Signature: #x // Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses();
descriptor: ()V
@@ -3078,6 +3947,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
LocalVariableTable:
Start Length Slot Name Signature
11 17 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public java.util.function.Supplier<java.lang.Integer> getSupplier();
descriptor: ()Ljava/util/function/Supplier;
@@ -3099,6 +3973,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
Start Length Slot Name Signature
11 9 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static java.util.function.Supplier<java.lang.Integer> getSupplier_static();
descriptor: ()Ljava/util/function/Supplier;
@@ -3116,6 +3995,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: areturn
LineNumberTable:
Signature: #x // ()Ljava/util/function/Supplier<Ljava/lang/Integer;>;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
static {};
descriptor: ()V
@@ -3136,6 +4020,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass
x: putstatic #x // Field sSupplier:Ljava/util/function/Supplier;
x: return
LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
InnerClasses:
#x; // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1
@@ -3150,9 +4039,9 @@ InnerClasses:
SourceFile: "TinyFrameworkNestedClasses.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -3202,6 +4091,11 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
LocalVariableTable:
Start Length Slot Name Signature
11 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPackageRedirect;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public static int foo(int);
descriptor: (I)I
@@ -3223,13 +4117,18 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi
LocalVariableTable:
Start Length Slot Name Signature
11 12 0 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "TinyFrameworkPackageRedirect.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
@@ -3245,6 +4144,9 @@ public class com.supported.UnsupportedClass
private final int mValue;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
private static {};
descriptor: ()V
@@ -3283,6 +4185,9 @@ public class com.supported.UnsupportedClass
Start Length Slot Name Signature
26 10 0 this Lcom/supported/UnsupportedClass;
26 10 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int getValue();
descriptor: ()I
@@ -3307,11 +4212,14 @@ public class com.supported.UnsupportedClass
LocalVariableTable:
Start Length Slot Name Signature
26 5 0 this Lcom/supported/UnsupportedClass;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "UnsupportedClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
@@ -3356,6 +4264,11 @@ public class com.unsupported.UnsupportedClass
Start Length Slot Name Signature
11 14 0 this Lcom/unsupported/UnsupportedClass;
11 14 1 value I
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
public int getValue();
descriptor: ()I
@@ -3376,13 +4289,18 @@ public class com.unsupported.UnsupportedClass
LocalVariableTable:
Start Length Slot Name Signature
11 10 0 this Lcom/unsupported/UnsupportedClass;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
}
SourceFile: "UnsupportedClass.java"
RuntimeVisibleAnnotations:
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedStubClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInStub
x: #x()
- com.android.hoststubgen.hosthelper.HostStubGenProcessedKeepClass
+ com.android.hoststubgen.hosthelper.HostStubGenKeptInImpl
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassStub
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt
index 079d2a84e498..9b6b6e4c9f5b 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt
@@ -15,3 +15,6 @@ class com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy stub
# Class load hook
class com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy ~com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHook.onClassLoaded
+
+# Heuristics rule: Stub all the AIDL classes.
+class :aidl stubclass \ No newline at end of file
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/IPretendingAidl.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/IPretendingAidl.java
new file mode 100644
index 000000000000..0a07c2b91fc3
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/IPretendingAidl.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.test.tinyframework;
+
+/**
+ * An interface that matches the "AIDL detection heuristics' logic.
+ *
+ * The "class :aidl" line in the text policy file will control the visibility of it.
+ */
+public interface IPretendingAidl {
+ public static class Stub {
+ public static int addOne(int a) {
+ return a + 1;
+ }
+
+ public static class Proxy {
+ public static int addTwo(int a) {
+ return a + 2;
+ }
+ }
+ }
+
+}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java
index c151dcc9c90e..e7b5d9fc2ece 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java
@@ -32,4 +32,16 @@ public class TinyFrameworkNative {
public static long nativeLongPlus_should_be_like_this(long arg1, long arg2) {
return TinyFrameworkNative_host.nativeLongPlus(arg1, arg2);
}
+
+ int value;
+
+ public void setValue(int v) {
+ this.value = v;
+ }
+
+ public native int nativeNonStaticAddToValue(int arg);
+
+ public int nativeNonStaticAddToValue_should_be_like_this(int arg) {
+ return TinyFrameworkNative_host.nativeNonStaticAddToValue(this, arg);
+ }
}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java
index 48f7dea8c66c..749ebaa378e3 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java
@@ -28,4 +28,10 @@ public class TinyFrameworkNative_host {
public static long nativeLongPlus(long arg1, long arg2) {
return arg1 + arg2;
}
+
+ // Note, the method must be static even for a non-static native method, but instead it
+ // must take the "source" instance as the first argument.
+ public static int nativeNonStaticAddToValue(TinyFrameworkNative source, int arg) {
+ return source.value + arg;
+ }
}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java
index b01566111250..d3501057163d 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java
@@ -152,6 +152,13 @@ public class TinyFrameworkClassTest {
}
@Test
+ public void testNativeSubstitutionClass_nonStatic() {
+ TinyFrameworkNative instance = new TinyFrameworkNative();
+ instance.setValue(5);
+ assertThat(instance.nativeNonStaticAddToValue(3)).isEqualTo(8);
+ }
+
+ @Test
public void testExitLog() {
thrown.expect(RuntimeException.class);
thrown.expectMessage("Outer exception");
@@ -251,7 +258,7 @@ public class TinyFrameworkClassTest {
assertThat(TinyFrameworkEnumSimple.valueOf("DOG").ordinal()).isEqualTo(1);
assertThat(TinyFrameworkEnumSimple.values()).isEqualTo(
- new TinyFrameworkEnumSimple[] {
+ new TinyFrameworkEnumSimple[]{
TinyFrameworkEnumSimple.CAT,
TinyFrameworkEnumSimple.DOG,
}
@@ -271,11 +278,17 @@ public class TinyFrameworkClassTest {
assertThat(TinyFrameworkEnumComplex.valueOf("BLUE").ordinal()).isEqualTo(2);
assertThat(TinyFrameworkEnumComplex.values()).isEqualTo(
- new TinyFrameworkEnumComplex[] {
+ new TinyFrameworkEnumComplex[]{
TinyFrameworkEnumComplex.RED,
TinyFrameworkEnumComplex.GREEN,
TinyFrameworkEnumComplex.BLUE,
}
);
}
+
+ @Test
+ public void testAidlHeuristics() {
+ assertThat(IPretendingAidl.Stub.addOne(1)).isEqualTo(2);
+ assertThat(IPretendingAidl.Stub.Proxy.addTwo(1)).isEqualTo(3);
+ }
}
diff --git a/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/utils/AsmUtilsTest.kt b/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/utils/AsmUtilsTest.kt
new file mode 100644
index 000000000000..66624d17ab54
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/utils/AsmUtilsTest.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.utils
+
+import com.android.hoststubgen.asm.getDirectOuterClassName
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class AsmUtilsTest {
+ private fun checkGetDirectOuterClassName(input: String, expected: String?) {
+ assertThat(getDirectOuterClassName(input)).isEqualTo(expected)
+ }
+
+ @Test
+ fun testGetDirectOuterClassName() {
+ checkGetDirectOuterClassName("a", null)
+ checkGetDirectOuterClassName("a\$x", "a")
+ checkGetDirectOuterClassName("a.b.c\$x", "a.b.c")
+ checkGetDirectOuterClassName("a.b.c\$x\$y", "a.b.c\$x")
+ }
+} \ No newline at end of file
diff --git a/tools/hoststubgen/scripts/Android.bp b/tools/hoststubgen/scripts/Android.bp
index 5da805e5640e..b1ba07ec540d 100644
--- a/tools/hoststubgen/scripts/Android.bp
+++ b/tools/hoststubgen/scripts/Android.bp
@@ -18,9 +18,3 @@ genrule_defaults {
tools: ["dump-jar"],
cmd: "$(location dump-jar) -s -o $(out) $(in)",
}
-
-sh_binary_host {
- name: "run-ravenwood-test",
- src: "run-ravenwood-test",
- visibility: ["//visibility:public"],
-}
diff --git a/tools/hoststubgen/scripts/run-all-tests.sh b/tools/hoststubgen/scripts/run-all-tests.sh
index 2dac08969d44..c7007db6028e 100755
--- a/tools/hoststubgen/scripts/run-all-tests.sh
+++ b/tools/hoststubgen/scripts/run-all-tests.sh
@@ -18,14 +18,16 @@ source "${0%/*}"/../common.sh
# Move to the top directory of hoststubgen
cd ..
+ATEST_ARGS="--host"
+
# These tests are known to pass.
READY_TEST_MODULES=(
HostStubGenTest-framework-all-test-host-test
hoststubgen-test-tiny-test
+ CtsUtilTestCasesRavenwood
)
MUST_BUILD_MODULES=(
- run-ravenwood-test
"${NOT_READY_TEST_MODULES[*]}"
HostStubGenTest-framework-test
)
@@ -34,7 +36,7 @@ MUST_BUILD_MODULES=(
run m "${MUST_BUILD_MODULES[@]}"
# Run the hoststubgen unittests / etc
-run atest hoststubgentest hoststubgen-invoke-test
+run atest $ATEST_ARGS hoststubgentest hoststubgen-invoke-test
# Next, run the golden check. This should always pass too.
# The following scripts _should_ pass too, but they depend on the internal paths to soong generated
@@ -44,15 +46,13 @@ run ./hoststubgen/test-tiny-framework/diff-and-update-golden.sh
run ./hoststubgen/test-framework/run-test-without-atest.sh
run ./hoststubgen/test-tiny-framework/run-test-manually.sh
-run atest tiny-framework-dump-test
+run atest $ATEST_ARGS tiny-framework-dump-test
run ./scripts/build-framework-hostside-jars-and-extract.sh
# This script is already broken on goog/master
# run ./scripts/build-framework-hostside-jars-without-genrules.sh
# These tests should all pass.
-run-ravenwood-test ${READY_TEST_MODULES[*]}
-
-run atest CtsUtilTestCasesRavenwood
+run atest $ATEST_ARGS ${READY_TEST_MODULES[*]}
-echo ""${0##*/}" finished, with no unexpected failures. Ready to submit!" \ No newline at end of file
+echo ""${0##*/}" finished, with no failures. Ready to submit!" \ No newline at end of file
diff --git a/tools/hoststubgen/scripts/run-ravenwood-test b/tools/hoststubgen/scripts/run-ravenwood-test
deleted file mode 100755
index 9bbb859f5c3d..000000000000
--- a/tools/hoststubgen/scripts/run-ravenwood-test
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-# Copyright (C) 2023 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-# Script to run a "Ravenwood" host side test.
-#
-# A proper way to run these tests is to use `atest`, but `atest` has a known issue of loading
-# unrelated jar files as the class path, so for now we use this script to run host side tests.
-
-# Copy (with some changes) some functions from ../common.sh, so this script can be used without it.
-
-m() {
- if (( $SKIP_BUILD )) ; then
- echo "Skipping build: $*" 1>&2
- return 0
- fi
- run ${ANDROID_BUILD_TOP}/build/soong/soong_ui.bash --make-mode "$@"
-}
-
-run() {
- echo "Running: $*" 1>&2
- "$@"
-}
-
-run_junit_test_jar() {
- local jar="$1"
- echo "Starting test: $jar ..."
- run cd "${jar%/*}"
-
- run ${JAVA:-java} $JAVA_OPTS \
- -cp $jar \
- org.junit.runner.JUnitCore \
- com.android.hoststubgen.hosthelper.HostTestSuite || return 1
- return 0
-}
-
-help() {
- cat <<'EOF'
-
- run-ravenwood-test -- Run Ravenwood host tests
-
- Usage:
- run-ravenwood-test [options] MODULE-NAME ...
-
- Options:
- -h: Help
- -t: Run test only, without building
- -b: Build only, without running
-
- Example:
- run-ravenwood-test HostStubGenTest-framework-test-host-test
-
-EOF
-}
-
-#-------------------------------------------------------------------------
-# Parse options
-#-------------------------------------------------------------------------
-build=0
-test=0
-
-while getopts "htb" opt; do
- case "$opt" in
- h) help; exit 0 ;;
- t)
- test=1
- ;;
- b)
- build=1
- ;;
- esac
-done
-shift $(($OPTIND - 1))
-
-# If neither -t nor -b is provided, then build and run./
-if (( ( $build + $test ) == 0 )) ; then
- build=1
- test=1
-fi
-
-
-modules=("${@}")
-
-if (( "${#modules[@]}" == 0 )); then
- help
- exit 1
-fi
-
-#-------------------------------------------------------------------------
-# Build
-#-------------------------------------------------------------------------
-if (( $build )) ; then
- run m "${modules[@]}"
-fi
-
-#-------------------------------------------------------------------------
-# Run
-#-------------------------------------------------------------------------
-
-failures=0
-if (( test )) ; then
- for module in "${modules[@]}"; do
- if run_junit_test_jar "$ANDROID_BUILD_TOP/out/host/linux-x86/testcases/${module}/${module}.jar"; then
- : # passed.
- else
- failures=$(( failures + 1 ))
- fi
- done
-
- if (( $failures > 0 )) ; then
- echo "$failures test jar(s) failed." 1>&2
- exit 2
- fi
-fi
-
-exit 0 \ No newline at end of file