Loading Android.mk +95 −46 Original line number Diff line number Diff line Loading @@ -867,23 +867,67 @@ LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks include $(BUILD_STATIC_JAVA_LIBRARY) # ==== hiddenapi lists ======================================= include $(CLEAR_VARS) # Copy light and dark greylist over into the build folder. # This is for ART buildbots which need to mock these lists and have alternative # rules for building them. Other rules in the build system should depend on the # files in the build folder. # File names of final API lists LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) # File names of source files we will use to generate the final API lists. LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) LOCAL_SRC_ALL := \ $(LOCAL_SRC_GREYLIST) \ $(LOCAL_SRC_VENDOR_LIST) \ $(LOCAL_SRC_FORCE_BLACKLIST) \ $(LOCAL_SRC_PRIVATE_API) \ $(LOCAL_SRC_REMOVED_API) define assert-has-no-overlap if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \ echo "$(1) and $(2) should not overlap" 1>&2; \ comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \ exit 1; \ fi endef define assert-is-subset if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \ echo "$(1) must be a subset of $(2)" 1>&2; \ comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \ exit 1; \ fi endef define assert-has-no-duplicates if [ ! -z "`sort $(1) | uniq -D`" ]; then \ echo "$(1) has duplicate entries" 1>&2; \ sort $(1) | uniq -D 1>&2; \ exit 1; \ fi endef # The following rules build API lists in the build folder. # By not using files from the source tree, ART buildbots can mock these lists # or have alternative rules for building them. Other rules in the build system # should depend on the files in the build folder. # Merge light greylist from multiple files: # (1) manual light greylist # (2) list of usages from vendor apps # (3) list of removed APIs # (1) manual greylist LOCAL_SRC_GREYLIST # (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST # (3) list of removed APIs in LOCAL_SRC_REMOVED_API # @removed does not imply private in Doclava. We must take the subset also # in PRIVATE_API. # in LOCAL_SRC_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 := \ $(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "readObject\(Ljava/io/ObjectInputStream;\)V" \ "readObjectNoData\(\)V" \ "readResolve\(\)Ljava/lang/Object;" \ Loading @@ -891,43 +935,48 @@ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \ "writeObject\(Ljava/io/ObjectOutputStream;\)V" \ "writeReplace\(\)Ljava/lang/Object;" $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(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_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))) \ $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL) sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \ <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \ $(LOCAL_SRC_PRIVATE_API)) \ <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \ > $@ $(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\ $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST))) # Generate dark greylist as private API minus (blacklist plus light greylist). $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) \ $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) if [ ! -z "`comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST))`" ]; then \ echo "There should be no overlap between $(LIGHT_GREYLIST) and $(DARK_GREYLIST)" 1>&2; \ comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST)) 1>&2; \ exit 1; \ elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST))`" ]; then \ echo "$(LIGHT_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \ comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST)) 1>&2; \ exit 2; \ elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \ echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \ comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST)) 1>&2; \ exit 3; \ fi comm -23 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST) $(DARK_GREYLIST)) > $@ $(call assert-has-no-duplicates,$@) $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST)) # Generate dark greylist as remaining members of classes on the light greylist, # as well as the members of their inner classes. # The algorithm is as follows: # (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST # (2) strip the final semicolon and anything after (and including) a dollar sign, # e.g. 'Lpackage/class$inner;' turns into 'Lpackage/class' # (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the stripped # descriptor followed by a semi-colon or a dollar sign, e.g. matching a regex # '^Lpackage/class[;$]' # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \ <(sed 's/;\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/$$.*//' | sort | uniq | \ while read CLASS_DESC; do \ grep -E "^$${CLASS_DESC}[;$$]" $(LOCAL_SRC_PRIVATE_API); \ done | sort | uniq) \ > $@ $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-duplicates,$@) $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST)) $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST)) # Generate blacklist as private API minus (light greylist plus dark greylist). $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST) comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \ <(sort $(LOCAL_SRC_PRIVATE_API)) \ > $@ $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-duplicates,$@) $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST)) $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST)) $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@) # Include subdirectory makefiles # ============================================================ Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11274,6 +11274,7 @@ package android.content.pm { field public static final java.lang.String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; field public static final java.lang.String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; field public static final java.lang.String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; field public static final java.lang.String FEATURE_CANT_SAVE_STATE = "android.software.cant_save_state"; field public static final java.lang.String FEATURE_COMPANION_DEVICE_SETUP = "android.software.companion_device_setup"; field public static final java.lang.String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; field public static final java.lang.String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; cmds/incidentd/src/Reporter.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "report_directory.h" #include "section_list.h" #include <android-base/properties.h> #include <android/os/DropBoxManager.h> #include <private/android_filesystem_config.h> #include <utils/SystemClock.h> Loading @@ -31,6 +32,7 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <string> /** * The directory where the incident reports are stored. Loading Loading @@ -129,6 +131,8 @@ Reporter::run_report_status_t Reporter::runReport(size_t* reportByteSize) { int mainDest = -1; HeaderSection headers; MetadataSection metadataSection; std::string buildType = android::base::GetProperty("ro.build.type", ""); const bool isUserdebugOrEng = buildType == "userdebug" || buildType == "eng"; // See if we need the main file for (ReportRequestSet::iterator it = batch.begin(); it != batch.end(); it++) { Loading Loading @@ -175,6 +179,11 @@ Reporter::run_report_status_t Reporter::runReport(size_t* reportByteSize) { // and report to those that care that we're doing it. for (const Section** section = SECTION_LIST; *section; section++) { const int id = (*section)->id; if ((*section)->userdebugAndEngOnly && !isUserdebugOrEng) { ALOGD("Skipping incident report section %d '%s' because it's limited to userdebug/eng", id, (*section)->name.string()); continue; } if (this->batch.containsSection(id)) { ALOGD("Taking incident report section %d '%s'", id, (*section)->name.string()); for (ReportRequestSet::iterator it = batch.begin(); it != batch.end(); it++) { Loading cmds/incidentd/src/Section.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -151,8 +151,11 @@ DONE: } // ================================================================================ Section::Section(int i, int64_t timeoutMs, bool deviceSpecific) : id(i), timeoutMs(timeoutMs), deviceSpecific(deviceSpecific) {} Section::Section(int i, int64_t timeoutMs, bool userdebugAndEngOnly, bool deviceSpecific) : id(i), timeoutMs(timeoutMs), userdebugAndEngOnly(userdebugAndEngOnly), deviceSpecific(deviceSpecific) {} Section::~Section() {} Loading Loading @@ -239,7 +242,7 @@ static inline bool isSysfs(const char* filename) { return strncmp(filename, "/sy FileSection::FileSection(int id, const char* filename, const bool deviceSpecific, const int64_t timeoutMs) : Section(id, timeoutMs, deviceSpecific), mFilename(filename) { : Section(id, timeoutMs, false, deviceSpecific), mFilename(filename) { name = filename; mIsSysfs = isSysfs(filename); } Loading Loading @@ -417,8 +420,8 @@ WorkerThreadData::WorkerThreadData(const WorkerThreadSection* sec) WorkerThreadData::~WorkerThreadData() {} // ================================================================================ WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs) : Section(id, timeoutMs) {} WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs, bool userdebugAndEngOnly) : Section(id, timeoutMs, userdebugAndEngOnly) {} WorkerThreadSection::~WorkerThreadSection() {} Loading Loading @@ -615,8 +618,8 @@ status_t CommandSection::Execute(ReportRequestSet* requests) const { } // ================================================================================ DumpsysSection::DumpsysSection(int id, const char* service, ...) : WorkerThreadSection(id), mService(service) { DumpsysSection::DumpsysSection(int id, bool userdebugAndEngOnly, const char* service, ...) : WorkerThreadSection(id, REMOTE_CALL_TIMEOUT_MS, userdebugAndEngOnly), mService(service) { name = "dumpsys "; name += service; Loading cmds/incidentd/src/Section.h +6 −3 Original line number Diff line number Diff line Loading @@ -40,10 +40,12 @@ class Section { public: const int id; const int64_t timeoutMs; // each section must have a timeout const bool userdebugAndEngOnly; const bool deviceSpecific; String8 name; Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool deviceSpecific = false); Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool userdebugAndEngOnly = false, bool deviceSpecific = false); virtual ~Section(); virtual status_t Execute(ReportRequestSet* requests) const = 0; Loading Loading @@ -107,7 +109,8 @@ private: */ class WorkerThreadSection : public Section { public: WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool userdebugAndEngOnly = false); virtual ~WorkerThreadSection(); virtual status_t Execute(ReportRequestSet* requests) const; Loading Loading @@ -137,7 +140,7 @@ private: */ class DumpsysSection : public WorkerThreadSection { public: DumpsysSection(int id, const char* service, ...); DumpsysSection(int id, bool userdebugAndEngOnly, const char* service, ...); virtual ~DumpsysSection(); virtual status_t BlockingCall(int pipeWriteFd) const; Loading Loading
Android.mk +95 −46 Original line number Diff line number Diff line Loading @@ -867,23 +867,67 @@ LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks include $(BUILD_STATIC_JAVA_LIBRARY) # ==== hiddenapi lists ======================================= include $(CLEAR_VARS) # Copy light and dark greylist over into the build folder. # This is for ART buildbots which need to mock these lists and have alternative # rules for building them. Other rules in the build system should depend on the # files in the build folder. # File names of final API lists LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) # File names of source files we will use to generate the final API lists. LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) LOCAL_SRC_ALL := \ $(LOCAL_SRC_GREYLIST) \ $(LOCAL_SRC_VENDOR_LIST) \ $(LOCAL_SRC_FORCE_BLACKLIST) \ $(LOCAL_SRC_PRIVATE_API) \ $(LOCAL_SRC_REMOVED_API) define assert-has-no-overlap if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \ echo "$(1) and $(2) should not overlap" 1>&2; \ comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \ exit 1; \ fi endef define assert-is-subset if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \ echo "$(1) must be a subset of $(2)" 1>&2; \ comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \ exit 1; \ fi endef define assert-has-no-duplicates if [ ! -z "`sort $(1) | uniq -D`" ]; then \ echo "$(1) has duplicate entries" 1>&2; \ sort $(1) | uniq -D 1>&2; \ exit 1; \ fi endef # The following rules build API lists in the build folder. # By not using files from the source tree, ART buildbots can mock these lists # or have alternative rules for building them. Other rules in the build system # should depend on the files in the build folder. # Merge light greylist from multiple files: # (1) manual light greylist # (2) list of usages from vendor apps # (3) list of removed APIs # (1) manual greylist LOCAL_SRC_GREYLIST # (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST # (3) list of removed APIs in LOCAL_SRC_REMOVED_API # @removed does not imply private in Doclava. We must take the subset also # in PRIVATE_API. # in LOCAL_SRC_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 := \ $(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "readObject\(Ljava/io/ObjectInputStream;\)V" \ "readObjectNoData\(\)V" \ "readResolve\(\)Ljava/lang/Object;" \ Loading @@ -891,43 +935,48 @@ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \ "writeObject\(Ljava/io/ObjectOutputStream;\)V" \ "writeReplace\(\)Ljava/lang/Object;" $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(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_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))) \ $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL) sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \ <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \ $(LOCAL_SRC_PRIVATE_API)) \ <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \ > $@ $(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\ $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST))) # Generate dark greylist as private API minus (blacklist plus light greylist). $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) \ $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) if [ ! -z "`comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST))`" ]; then \ echo "There should be no overlap between $(LIGHT_GREYLIST) and $(DARK_GREYLIST)" 1>&2; \ comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST)) 1>&2; \ exit 1; \ elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST))`" ]; then \ echo "$(LIGHT_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \ comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST)) 1>&2; \ exit 2; \ elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \ echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \ comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST)) 1>&2; \ exit 3; \ fi comm -23 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST) $(DARK_GREYLIST)) > $@ $(call assert-has-no-duplicates,$@) $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST)) # Generate dark greylist as remaining members of classes on the light greylist, # as well as the members of their inner classes. # The algorithm is as follows: # (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST # (2) strip the final semicolon and anything after (and including) a dollar sign, # e.g. 'Lpackage/class$inner;' turns into 'Lpackage/class' # (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the stripped # descriptor followed by a semi-colon or a dollar sign, e.g. matching a regex # '^Lpackage/class[;$]' # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \ <(sed 's/;\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/$$.*//' | sort | uniq | \ while read CLASS_DESC; do \ grep -E "^$${CLASS_DESC}[;$$]" $(LOCAL_SRC_PRIVATE_API); \ done | sort | uniq) \ > $@ $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-duplicates,$@) $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST)) $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST)) # Generate blacklist as private API minus (light greylist plus dark greylist). $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST) comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \ <(sort $(LOCAL_SRC_PRIVATE_API)) \ > $@ $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API)) $(call assert-has-no-duplicates,$@) $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST)) $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST)) $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@) # Include subdirectory makefiles # ============================================================ Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11274,6 +11274,7 @@ package android.content.pm { field public static final java.lang.String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; field public static final java.lang.String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; field public static final java.lang.String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; field public static final java.lang.String FEATURE_CANT_SAVE_STATE = "android.software.cant_save_state"; field public static final java.lang.String FEATURE_COMPANION_DEVICE_SETUP = "android.software.companion_device_setup"; field public static final java.lang.String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; field public static final java.lang.String FEATURE_CONSUMER_IR = "android.hardware.consumerir";
cmds/incidentd/src/Reporter.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "report_directory.h" #include "section_list.h" #include <android-base/properties.h> #include <android/os/DropBoxManager.h> #include <private/android_filesystem_config.h> #include <utils/SystemClock.h> Loading @@ -31,6 +32,7 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <string> /** * The directory where the incident reports are stored. Loading Loading @@ -129,6 +131,8 @@ Reporter::run_report_status_t Reporter::runReport(size_t* reportByteSize) { int mainDest = -1; HeaderSection headers; MetadataSection metadataSection; std::string buildType = android::base::GetProperty("ro.build.type", ""); const bool isUserdebugOrEng = buildType == "userdebug" || buildType == "eng"; // See if we need the main file for (ReportRequestSet::iterator it = batch.begin(); it != batch.end(); it++) { Loading Loading @@ -175,6 +179,11 @@ Reporter::run_report_status_t Reporter::runReport(size_t* reportByteSize) { // and report to those that care that we're doing it. for (const Section** section = SECTION_LIST; *section; section++) { const int id = (*section)->id; if ((*section)->userdebugAndEngOnly && !isUserdebugOrEng) { ALOGD("Skipping incident report section %d '%s' because it's limited to userdebug/eng", id, (*section)->name.string()); continue; } if (this->batch.containsSection(id)) { ALOGD("Taking incident report section %d '%s'", id, (*section)->name.string()); for (ReportRequestSet::iterator it = batch.begin(); it != batch.end(); it++) { Loading
cmds/incidentd/src/Section.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -151,8 +151,11 @@ DONE: } // ================================================================================ Section::Section(int i, int64_t timeoutMs, bool deviceSpecific) : id(i), timeoutMs(timeoutMs), deviceSpecific(deviceSpecific) {} Section::Section(int i, int64_t timeoutMs, bool userdebugAndEngOnly, bool deviceSpecific) : id(i), timeoutMs(timeoutMs), userdebugAndEngOnly(userdebugAndEngOnly), deviceSpecific(deviceSpecific) {} Section::~Section() {} Loading Loading @@ -239,7 +242,7 @@ static inline bool isSysfs(const char* filename) { return strncmp(filename, "/sy FileSection::FileSection(int id, const char* filename, const bool deviceSpecific, const int64_t timeoutMs) : Section(id, timeoutMs, deviceSpecific), mFilename(filename) { : Section(id, timeoutMs, false, deviceSpecific), mFilename(filename) { name = filename; mIsSysfs = isSysfs(filename); } Loading Loading @@ -417,8 +420,8 @@ WorkerThreadData::WorkerThreadData(const WorkerThreadSection* sec) WorkerThreadData::~WorkerThreadData() {} // ================================================================================ WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs) : Section(id, timeoutMs) {} WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs, bool userdebugAndEngOnly) : Section(id, timeoutMs, userdebugAndEngOnly) {} WorkerThreadSection::~WorkerThreadSection() {} Loading Loading @@ -615,8 +618,8 @@ status_t CommandSection::Execute(ReportRequestSet* requests) const { } // ================================================================================ DumpsysSection::DumpsysSection(int id, const char* service, ...) : WorkerThreadSection(id), mService(service) { DumpsysSection::DumpsysSection(int id, bool userdebugAndEngOnly, const char* service, ...) : WorkerThreadSection(id, REMOTE_CALL_TIMEOUT_MS, userdebugAndEngOnly), mService(service) { name = "dumpsys "; name += service; Loading
cmds/incidentd/src/Section.h +6 −3 Original line number Diff line number Diff line Loading @@ -40,10 +40,12 @@ class Section { public: const int id; const int64_t timeoutMs; // each section must have a timeout const bool userdebugAndEngOnly; const bool deviceSpecific; String8 name; Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool deviceSpecific = false); Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool userdebugAndEngOnly = false, bool deviceSpecific = false); virtual ~Section(); virtual status_t Execute(ReportRequestSet* requests) const = 0; Loading Loading @@ -107,7 +109,8 @@ private: */ class WorkerThreadSection : public Section { public: WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS); WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool userdebugAndEngOnly = false); virtual ~WorkerThreadSection(); virtual status_t Execute(ReportRequestSet* requests) const; Loading Loading @@ -137,7 +140,7 @@ private: */ class DumpsysSection : public WorkerThreadSection { public: DumpsysSection(int id, const char* service, ...); DumpsysSection(int id, bool userdebugAndEngOnly, const char* service, ...); virtual ~DumpsysSection(); virtual status_t BlockingCall(int pipeWriteFd) const; Loading