Loading Android.mk +17 −7 Original line number Diff line number Diff line Loading @@ -448,6 +448,7 @@ LOCAL_DROIDDOC_OPTIONS:=\ -showAnnotation android.annotation.SystemApi \ -showAnnotation android.annotation.TestApi \ -privateDexApi $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ -removedDexApi $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) \ -nodocs LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk Loading @@ -456,7 +457,8 @@ LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_DROIDDOC) $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) # ==== check javadoc comments but don't generate docs ======== include $(CLEAR_VARS) Loading Loading @@ -871,9 +873,16 @@ include $(BUILD_STATIC_JAVA_LIBRARY) # rules for building them. Other rules in the build system should depend on the # files in the build folder. # Automatically add all methods which match the following signatures. # These need to be greylisted in order to allow applications to write their # own serializers. # Merge light greylist from multiple files: # (1) manual light greylist # (2) list of usages from vendor apps # (3) list of removed APIs # @removed does not imply private in Doclava. We must take the subset also # in PRIVATE_API. # (4) list of serialization APIs # Automatically adds all methods which match the signatures in # REGEX_SERIALIZATION. These are greylisted in order to allow applications # to write their own serializers. $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "readObject\(Ljava/io/ObjectInputStream;\)V" \ "readObjectNoData\(\)V" \ Loading @@ -883,14 +892,15 @@ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "writeObject\(Ljava/io/ObjectOutputStream;\)V" \ "writeReplace\(\)Ljava/lang/Object;" $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) # Temporarily merge light greylist from two files. Vendor list will become dark # grey once we remove the UI toast. $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) sort frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" $(PRIVATE_API)) \ <(comm -12 <(sort $(REMOVED_API)) <(sort $(PRIVATE_API))) \ > $@ $(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\ Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ package android { public static final class Manifest.permission_group { ctor public Manifest.permission_group(); field public static final java.lang.String CALENDAR = "android.permission-group.CALENDAR"; field public static final java.lang.String CALL_LOG = "android.permission-group.CALL_LOG"; field public static final java.lang.String CAMERA = "android.permission-group.CAMERA"; field public static final java.lang.String CONTACTS = "android.permission-group.CONTACTS"; field public static final java.lang.String LOCATION = "android.permission-group.LOCATION"; cmds/incidentd/src/Section.cpp +11 −4 Original line number Diff line number Diff line Loading @@ -151,7 +151,8 @@ DONE: } // ================================================================================ Section::Section(int i, const int64_t timeoutMs) : id(i), timeoutMs(timeoutMs) {} Section::Section(int i, int64_t timeoutMs, bool deviceSpecific) : id(i), timeoutMs(timeoutMs), deviceSpecific(deviceSpecific) {} Section::~Section() {} Loading Loading @@ -236,8 +237,9 @@ status_t MetadataSection::Execute(ReportRequestSet* requests) const { // ================================================================================ static inline bool isSysfs(const char* filename) { return strncmp(filename, "/sys/", 5) == 0; } FileSection::FileSection(int id, const char* filename, const int64_t timeoutMs) : Section(id, timeoutMs), mFilename(filename) { FileSection::FileSection(int id, const char* filename, const bool deviceSpecific, const int64_t timeoutMs) : Section(id, timeoutMs, deviceSpecific), mFilename(filename) { name = filename; mIsSysfs = isSysfs(filename); } Loading @@ -250,7 +252,7 @@ status_t FileSection::Execute(ReportRequestSet* requests) const { unique_fd fd(open(mFilename, O_RDONLY | O_CLOEXEC)); if (fd.get() == -1) { ALOGW("FileSection '%s' failed to open file", this->name.string()); return -errno; return this->deviceSpecific ? NO_ERROR : -errno; } FdBuffer buffer; Loading Loading @@ -902,11 +904,16 @@ status_t TombstoneSection::BlockingCall(int pipeWriteFd) const { // Read from the pipe concurrently to avoid blocking the child. FdBuffer buffer; err = buffer.readFully(dumpPipe.readFd().get()); // Wait on the child to avoid it becoming a zombie process. status_t cStatus = wait_child(child); if (err != NO_ERROR) { ALOGW("TombstoneSection '%s' failed to read stack dump: %d", this->name.string(), err); dumpPipe.readFd().reset(); break; } if (cStatus != NO_ERROR) { ALOGE("TombstoneSection '%s' child had an issue: %s\n", this->name.string(), strerror(-cStatus)); } auto dump = std::make_unique<char[]>(buffer.size()); auto iterator = buffer.data(); Loading cmds/incidentd/src/Section.h +7 −5 Original line number Diff line number Diff line Loading @@ -40,9 +40,10 @@ class Section { public: const int id; const int64_t timeoutMs; // each section must have a timeout const bool deviceSpecific; String8 name; Section(int id, const int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool deviceSpecific = false); virtual ~Section(); virtual status_t Execute(ReportRequestSet* requests) const = 0; Loading Loading @@ -75,7 +76,8 @@ public: */ class FileSection : public Section { public: FileSection(int id, const char* filename, const int64_t timeoutMs = 5000 /* 5 seconds */); FileSection(int id, const char* filename, bool deviceSpecific = false, int64_t timeoutMs = 5000 /* 5 seconds */); virtual ~FileSection(); virtual status_t Execute(ReportRequestSet* requests) const; Loading Loading @@ -105,7 +107,7 @@ private: */ class WorkerThreadSection : public Section { public: WorkerThreadSection(int id, const int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); virtual ~WorkerThreadSection(); virtual status_t Execute(ReportRequestSet* requests) const; Loading @@ -118,7 +120,7 @@ public: */ class CommandSection : public Section { public: CommandSection(int id, const int64_t timeoutMs, const char* command, ...); CommandSection(int id, int64_t timeoutMs, const char* command, ...); CommandSection(int id, const char* command, ...); Loading Loading @@ -168,7 +170,7 @@ private: */ class TombstoneSection : public WorkerThreadSection { public: TombstoneSection(int id, const char* type, const int64_t timeoutMs = 30000 /* 30 seconds */); TombstoneSection(int id, const char* type, int64_t timeoutMs = 30000 /* 30 seconds */); virtual ~TombstoneSection(); virtual status_t BlockingCall(int pipeWriteFd) const; Loading cmds/incidentd/tests/Section_test.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -143,8 +143,16 @@ TEST_F(SectionTest, FileSection) { EXPECT_THAT(GetCapturedStdout(), StrEq("\xa\vatadtsetmai")); } TEST_F(SectionTest, FileSectionNotExist) { FileSection fs1(NOOP_PARSER, "notexist", false, QUICK_TIMEOUT_MS); ASSERT_EQ(NAME_NOT_FOUND, fs1.Execute(&requests)); FileSection fs2(NOOP_PARSER, "notexist", true, QUICK_TIMEOUT_MS); ASSERT_EQ(NO_ERROR, fs2.Execute(&requests)); } TEST_F(SectionTest, FileSectionTimeout) { FileSection fs(TIMEOUT_PARSER, tf.path, QUICK_TIMEOUT_MS); FileSection fs(TIMEOUT_PARSER, tf.path, false, QUICK_TIMEOUT_MS); ASSERT_EQ(NO_ERROR, fs.Execute(&requests)); ASSERT_TRUE(requests.sectionStats(TIMEOUT_PARSER)->timed_out()); } Loading Loading
Android.mk +17 −7 Original line number Diff line number Diff line Loading @@ -448,6 +448,7 @@ LOCAL_DROIDDOC_OPTIONS:=\ -showAnnotation android.annotation.SystemApi \ -showAnnotation android.annotation.TestApi \ -privateDexApi $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ -removedDexApi $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) \ -nodocs LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk Loading @@ -456,7 +457,8 @@ LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_DROIDDOC) $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) # ==== check javadoc comments but don't generate docs ======== include $(CLEAR_VARS) Loading Loading @@ -871,9 +873,16 @@ include $(BUILD_STATIC_JAVA_LIBRARY) # rules for building them. Other rules in the build system should depend on the # files in the build folder. # Automatically add all methods which match the following signatures. # These need to be greylisted in order to allow applications to write their # own serializers. # Merge light greylist from multiple files: # (1) manual light greylist # (2) list of usages from vendor apps # (3) list of removed APIs # @removed does not imply private in Doclava. We must take the subset also # in PRIVATE_API. # (4) list of serialization APIs # Automatically adds all methods which match the signatures in # REGEX_SERIALIZATION. These are greylisted in order to allow applications # to write their own serializers. $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "readObject\(Ljava/io/ObjectInputStream;\)V" \ "readObjectNoData\(\)V" \ Loading @@ -883,14 +892,15 @@ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "writeObject\(Ljava/io/ObjectOutputStream;\)V" \ "writeReplace\(\)Ljava/lang/Object;" $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) # Temporarily merge light greylist from two files. Vendor list will become dark # grey once we remove the UI toast. $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) sort frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" $(PRIVATE_API)) \ <(comm -12 <(sort $(REMOVED_API)) <(sort $(PRIVATE_API))) \ > $@ $(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\ Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ package android { public static final class Manifest.permission_group { ctor public Manifest.permission_group(); field public static final java.lang.String CALENDAR = "android.permission-group.CALENDAR"; field public static final java.lang.String CALL_LOG = "android.permission-group.CALL_LOG"; field public static final java.lang.String CAMERA = "android.permission-group.CAMERA"; field public static final java.lang.String CONTACTS = "android.permission-group.CONTACTS"; field public static final java.lang.String LOCATION = "android.permission-group.LOCATION";
cmds/incidentd/src/Section.cpp +11 −4 Original line number Diff line number Diff line Loading @@ -151,7 +151,8 @@ DONE: } // ================================================================================ Section::Section(int i, const int64_t timeoutMs) : id(i), timeoutMs(timeoutMs) {} Section::Section(int i, int64_t timeoutMs, bool deviceSpecific) : id(i), timeoutMs(timeoutMs), deviceSpecific(deviceSpecific) {} Section::~Section() {} Loading Loading @@ -236,8 +237,9 @@ status_t MetadataSection::Execute(ReportRequestSet* requests) const { // ================================================================================ static inline bool isSysfs(const char* filename) { return strncmp(filename, "/sys/", 5) == 0; } FileSection::FileSection(int id, const char* filename, const int64_t timeoutMs) : Section(id, timeoutMs), mFilename(filename) { FileSection::FileSection(int id, const char* filename, const bool deviceSpecific, const int64_t timeoutMs) : Section(id, timeoutMs, deviceSpecific), mFilename(filename) { name = filename; mIsSysfs = isSysfs(filename); } Loading @@ -250,7 +252,7 @@ status_t FileSection::Execute(ReportRequestSet* requests) const { unique_fd fd(open(mFilename, O_RDONLY | O_CLOEXEC)); if (fd.get() == -1) { ALOGW("FileSection '%s' failed to open file", this->name.string()); return -errno; return this->deviceSpecific ? NO_ERROR : -errno; } FdBuffer buffer; Loading Loading @@ -902,11 +904,16 @@ status_t TombstoneSection::BlockingCall(int pipeWriteFd) const { // Read from the pipe concurrently to avoid blocking the child. FdBuffer buffer; err = buffer.readFully(dumpPipe.readFd().get()); // Wait on the child to avoid it becoming a zombie process. status_t cStatus = wait_child(child); if (err != NO_ERROR) { ALOGW("TombstoneSection '%s' failed to read stack dump: %d", this->name.string(), err); dumpPipe.readFd().reset(); break; } if (cStatus != NO_ERROR) { ALOGE("TombstoneSection '%s' child had an issue: %s\n", this->name.string(), strerror(-cStatus)); } auto dump = std::make_unique<char[]>(buffer.size()); auto iterator = buffer.data(); Loading
cmds/incidentd/src/Section.h +7 −5 Original line number Diff line number Diff line Loading @@ -40,9 +40,10 @@ class Section { public: const int id; const int64_t timeoutMs; // each section must have a timeout const bool deviceSpecific; String8 name; Section(int id, const int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool deviceSpecific = false); virtual ~Section(); virtual status_t Execute(ReportRequestSet* requests) const = 0; Loading Loading @@ -75,7 +76,8 @@ public: */ class FileSection : public Section { public: FileSection(int id, const char* filename, const int64_t timeoutMs = 5000 /* 5 seconds */); FileSection(int id, const char* filename, bool deviceSpecific = false, int64_t timeoutMs = 5000 /* 5 seconds */); virtual ~FileSection(); virtual status_t Execute(ReportRequestSet* requests) const; Loading Loading @@ -105,7 +107,7 @@ private: */ class WorkerThreadSection : public Section { public: WorkerThreadSection(int id, const int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); virtual ~WorkerThreadSection(); virtual status_t Execute(ReportRequestSet* requests) const; Loading @@ -118,7 +120,7 @@ public: */ class CommandSection : public Section { public: CommandSection(int id, const int64_t timeoutMs, const char* command, ...); CommandSection(int id, int64_t timeoutMs, const char* command, ...); CommandSection(int id, const char* command, ...); Loading Loading @@ -168,7 +170,7 @@ private: */ class TombstoneSection : public WorkerThreadSection { public: TombstoneSection(int id, const char* type, const int64_t timeoutMs = 30000 /* 30 seconds */); TombstoneSection(int id, const char* type, int64_t timeoutMs = 30000 /* 30 seconds */); virtual ~TombstoneSection(); virtual status_t BlockingCall(int pipeWriteFd) const; Loading
cmds/incidentd/tests/Section_test.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -143,8 +143,16 @@ TEST_F(SectionTest, FileSection) { EXPECT_THAT(GetCapturedStdout(), StrEq("\xa\vatadtsetmai")); } TEST_F(SectionTest, FileSectionNotExist) { FileSection fs1(NOOP_PARSER, "notexist", false, QUICK_TIMEOUT_MS); ASSERT_EQ(NAME_NOT_FOUND, fs1.Execute(&requests)); FileSection fs2(NOOP_PARSER, "notexist", true, QUICK_TIMEOUT_MS); ASSERT_EQ(NO_ERROR, fs2.Execute(&requests)); } TEST_F(SectionTest, FileSectionTimeout) { FileSection fs(TIMEOUT_PARSER, tf.path, QUICK_TIMEOUT_MS); FileSection fs(TIMEOUT_PARSER, tf.path, false, QUICK_TIMEOUT_MS); ASSERT_EQ(NO_ERROR, fs.Execute(&requests)); ASSERT_TRUE(requests.sectionStats(TIMEOUT_PARSER)->timed_out()); } Loading