Loading cmds/statsd/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ cc_library_host_shared { // ==== java proto device library (for test only) ============================== java_library { name: "statsdprotolite", no_framework_libs: true, proto: { type: "lite", include_dirs: ["external/protobuf/src"], Loading cmds/statsd/src/atoms.proto +2 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import "frameworks/base/core/proto/android/telecomm/enums.proto"; import "frameworks/base/core/proto/android/telephony/enums.proto"; import "frameworks/base/core/proto/android/view/enums.proto"; import "frameworks/base/proto/src/stats_enums.proto"; import "frameworks/base/core/proto/android/service/procstats.proto"; /** * The master atom class. This message defines all of the available Loading Loading @@ -165,6 +166,7 @@ message Atom { DirectoryUsage directory_usage = 10026; AppSize app_size = 10027; CategorySize category_size = 10028; android.service.procstats.ProcessStatsSectionProto proc_stats = 10029; } // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above Loading tools/stats_log_api_gen/Collation.cpp +14 −5 Original line number Diff line number Diff line Loading @@ -195,9 +195,11 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl, print_error(field, "Unkown type for field: %s\n", field->name().c_str()); errorCount++; continue; } else if (javaType == JAVA_TYPE_OBJECT) { } else if (javaType == JAVA_TYPE_OBJECT && atomDecl->code < PULL_ATOM_START_ID) { // Allow attribution chain, but only at position 1. print_error(field, "Message type not allowed for field: %s\n", print_error(field, "Message type not allowed for field in pushed atoms: %s\n", field->name().c_str()); errorCount++; continue; Loading Loading @@ -233,6 +235,8 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl, java_type_t javaType = java_type(field); AtomField atField(field->name(), javaType); // Generate signature for pushed atoms if (atomDecl->code < PULL_ATOM_START_ID) { if (javaType == JAVA_TYPE_ENUM) { // All enums are treated as ints when it comes to function signatures. signature->push_back(JAVA_TYPE_INT); Loading @@ -240,6 +244,11 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl, } else { signature->push_back(javaType); } } if (javaType == JAVA_TYPE_ENUM) { // All enums are treated as ints when it comes to function signatures. collate_enums(*field->enum_type(), &atField); } atomDecl->fields.push_back(atField); if (field->options().GetExtension(os::statsd::stateFieldOption).option() == Loading tools/stats_log_api_gen/Collation.h +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ using std::vector; using google::protobuf::Descriptor; using google::protobuf::FieldDescriptor; const int PULL_ATOM_START_ID = 10000; /** * The types for atom parameters. */ Loading tools/stats_log_api_gen/main.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ using namespace std; namespace android { namespace stats_log_api_gen { const int PULL_ATOM_START_ID = 1000; int maxPushedAtomId = 2; using android::os::statsd::Atom; Loading Loading
cmds/statsd/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ cc_library_host_shared { // ==== java proto device library (for test only) ============================== java_library { name: "statsdprotolite", no_framework_libs: true, proto: { type: "lite", include_dirs: ["external/protobuf/src"], Loading
cmds/statsd/src/atoms.proto +2 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import "frameworks/base/core/proto/android/telecomm/enums.proto"; import "frameworks/base/core/proto/android/telephony/enums.proto"; import "frameworks/base/core/proto/android/view/enums.proto"; import "frameworks/base/proto/src/stats_enums.proto"; import "frameworks/base/core/proto/android/service/procstats.proto"; /** * The master atom class. This message defines all of the available Loading Loading @@ -165,6 +166,7 @@ message Atom { DirectoryUsage directory_usage = 10026; AppSize app_size = 10027; CategorySize category_size = 10028; android.service.procstats.ProcessStatsSectionProto proc_stats = 10029; } // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above Loading
tools/stats_log_api_gen/Collation.cpp +14 −5 Original line number Diff line number Diff line Loading @@ -195,9 +195,11 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl, print_error(field, "Unkown type for field: %s\n", field->name().c_str()); errorCount++; continue; } else if (javaType == JAVA_TYPE_OBJECT) { } else if (javaType == JAVA_TYPE_OBJECT && atomDecl->code < PULL_ATOM_START_ID) { // Allow attribution chain, but only at position 1. print_error(field, "Message type not allowed for field: %s\n", print_error(field, "Message type not allowed for field in pushed atoms: %s\n", field->name().c_str()); errorCount++; continue; Loading Loading @@ -233,6 +235,8 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl, java_type_t javaType = java_type(field); AtomField atField(field->name(), javaType); // Generate signature for pushed atoms if (atomDecl->code < PULL_ATOM_START_ID) { if (javaType == JAVA_TYPE_ENUM) { // All enums are treated as ints when it comes to function signatures. signature->push_back(JAVA_TYPE_INT); Loading @@ -240,6 +244,11 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl, } else { signature->push_back(javaType); } } if (javaType == JAVA_TYPE_ENUM) { // All enums are treated as ints when it comes to function signatures. collate_enums(*field->enum_type(), &atField); } atomDecl->fields.push_back(atField); if (field->options().GetExtension(os::statsd::stateFieldOption).option() == Loading
tools/stats_log_api_gen/Collation.h +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ using std::vector; using google::protobuf::Descriptor; using google::protobuf::FieldDescriptor; const int PULL_ATOM_START_ID = 10000; /** * The types for atom parameters. */ Loading
tools/stats_log_api_gen/main.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ using namespace std; namespace android { namespace stats_log_api_gen { const int PULL_ATOM_START_ID = 1000; int maxPushedAtomId = 2; using android::os::statsd::Atom; Loading