Loading cmds/dumpstate/DumpstateService.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -148,14 +148,13 @@ binder::Status DumpstateService::startBugreport(int32_t calling_uid, } binder::Status DumpstateService::cancelBugreport() { // This is a no-op since the cancellation is done from java side via setting sys properties. // See BugreportManagerServiceImpl. // TODO(b/111441001): maybe make native and java sides use different binder interface // to avoid these annoyances. std::lock_guard<std::mutex> lock(lock_); ds_->Cancel(); return binder::Status::ok(); } status_t DumpstateService::dump(int fd, const Vector<String16>&) { std::lock_guard<std::mutex> lock(lock_); if (ds_ == nullptr) { dprintf(fd, "Bugreport not in progress yet"); return NO_ERROR; Loading cmds/dumpstate/dumpstate.cpp +16 −3 Original line number Diff line number Diff line Loading @@ -239,6 +239,9 @@ static bool CopyFileToFd(const std::string& input_file, int out_fd) { } static bool UnlinkAndLogOnError(const std::string& file) { if (file.empty()) { return false; } if (unlink(file.c_str())) { MYLOGE("Failed to unlink file (%s): %s\n", file.c_str(), strerror(errno)); return false; Loading @@ -246,7 +249,6 @@ static bool UnlinkAndLogOnError(const std::string& file) { return true; } int64_t GetModuleMetadataVersion() { auto binder = defaultServiceManager()->getService(android::String16("package_native")); if (binder == nullptr) { Loading Loading @@ -2419,6 +2421,17 @@ Dumpstate::RunStatus Dumpstate::Run(int32_t calling_uid, const std::string& call return status; } void Dumpstate::Cancel() { CleanupTmpFiles(); android::os::UnlinkAndLogOnError(log_path_); for (int i = 0; i < NUM_OF_DUMPS; i++) { android::os::UnlinkAndLogOnError(ds.bugreport_internal_dir_ + "/" + kDumpstateBoardFiles[i]); } tombstone_data_.clear(); anr_data_.clear(); } /* * Dumps relevant information to a bugreport based on the given options. * Loading Loading @@ -2755,7 +2768,7 @@ bool Dumpstate::CalledByApi() const { return ds.options_->bugreport_fd.get() != -1 ? true : false; } void Dumpstate::CleanupFiles() { void Dumpstate::CleanupTmpFiles() { android::os::UnlinkAndLogOnError(tmp_path_); android::os::UnlinkAndLogOnError(screenshot_path_); android::os::UnlinkAndLogOnError(path_); Loading @@ -2763,7 +2776,7 @@ void Dumpstate::CleanupFiles() { Dumpstate::RunStatus Dumpstate::HandleUserConsentDenied() { MYLOGD("User denied consent; deleting files and returning\n"); CleanupFiles(); CleanupTmpFiles(); return USER_CONSENT_DENIED; } Loading cmds/dumpstate/dumpstate.h +4 −1 Original line number Diff line number Diff line Loading @@ -334,6 +334,9 @@ class Dumpstate { RunStatus ParseCommandlineAndRun(int argc, char* argv[]); /* Deletes in-progress files */ void Cancel(); /* Sets runtime options. */ void SetOptions(std::unique_ptr<DumpOptions> options); Loading Loading @@ -502,7 +505,7 @@ class Dumpstate { // Removes the in progress files output files (tmp file, zip/txt file, screenshot), // but leaves the log file alone. void CleanupFiles(); void CleanupTmpFiles(); RunStatus HandleUserConsentDenied(); Loading include/android/surface_control.h +4 −4 Original line number Diff line number Diff line Loading @@ -409,7 +409,7 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio #if __ANDROID_API__ >= 30 /* /** * Sets the intended frame rate for |surface_control|. * * On devices that are capable of running the display at different refresh rates, the system may Loading @@ -421,9 +421,9 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio * * |frameRate| is the intended frame rate of this surface, in frames per second. 0 is a special * value that indicates the app will accept the system's choice for the display frame rate, which is * the default behavior if this function isn't called. The frameRate param does *not* need to be a * valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device that can * only run the display at 60fps. * the default behavior if this function isn't called. The frameRate param does <em>not</em> need to * be a valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device * that can only run the display at 60fps. * * |compatibility| The frame rate compatibility of this surface. The compatibility value may * influence the system's choice of display frame rate. To specify a compatibility use the Loading libs/binder/include/binder/AppOpsManager.h +10 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,16 @@ public: OP_LEGACY_STORAGE = 87, OP_ACCESS_ACCESSIBILITY = 88, OP_READ_DEVICE_IDENTIFIERS = 89, _NUM_OP = 90 OP_ACCESS_MEDIA_LOCATION = 90, OP_QUERY_ALL_PACKAGES = 91, OP_MANAGE_EXTERNAL_STORAGE = 92, OP_INTERACT_ACROSS_PROFILES = 93, OP_ACTIVATE_PLATFORM_VPN = 94, OP_LOADER_USAGE_STATS = 95, OP_DEPRECATED_1 = 96, OP_AUTO_REVOKE_PERMISSIONS_IF_UNUSED = 97, OP_AUTO_REVOKE_MANAGED_BY_INSTALLER = 98, _NUM_OP = 99 }; AppOpsManager(); Loading Loading
cmds/dumpstate/DumpstateService.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -148,14 +148,13 @@ binder::Status DumpstateService::startBugreport(int32_t calling_uid, } binder::Status DumpstateService::cancelBugreport() { // This is a no-op since the cancellation is done from java side via setting sys properties. // See BugreportManagerServiceImpl. // TODO(b/111441001): maybe make native and java sides use different binder interface // to avoid these annoyances. std::lock_guard<std::mutex> lock(lock_); ds_->Cancel(); return binder::Status::ok(); } status_t DumpstateService::dump(int fd, const Vector<String16>&) { std::lock_guard<std::mutex> lock(lock_); if (ds_ == nullptr) { dprintf(fd, "Bugreport not in progress yet"); return NO_ERROR; Loading
cmds/dumpstate/dumpstate.cpp +16 −3 Original line number Diff line number Diff line Loading @@ -239,6 +239,9 @@ static bool CopyFileToFd(const std::string& input_file, int out_fd) { } static bool UnlinkAndLogOnError(const std::string& file) { if (file.empty()) { return false; } if (unlink(file.c_str())) { MYLOGE("Failed to unlink file (%s): %s\n", file.c_str(), strerror(errno)); return false; Loading @@ -246,7 +249,6 @@ static bool UnlinkAndLogOnError(const std::string& file) { return true; } int64_t GetModuleMetadataVersion() { auto binder = defaultServiceManager()->getService(android::String16("package_native")); if (binder == nullptr) { Loading Loading @@ -2419,6 +2421,17 @@ Dumpstate::RunStatus Dumpstate::Run(int32_t calling_uid, const std::string& call return status; } void Dumpstate::Cancel() { CleanupTmpFiles(); android::os::UnlinkAndLogOnError(log_path_); for (int i = 0; i < NUM_OF_DUMPS; i++) { android::os::UnlinkAndLogOnError(ds.bugreport_internal_dir_ + "/" + kDumpstateBoardFiles[i]); } tombstone_data_.clear(); anr_data_.clear(); } /* * Dumps relevant information to a bugreport based on the given options. * Loading Loading @@ -2755,7 +2768,7 @@ bool Dumpstate::CalledByApi() const { return ds.options_->bugreport_fd.get() != -1 ? true : false; } void Dumpstate::CleanupFiles() { void Dumpstate::CleanupTmpFiles() { android::os::UnlinkAndLogOnError(tmp_path_); android::os::UnlinkAndLogOnError(screenshot_path_); android::os::UnlinkAndLogOnError(path_); Loading @@ -2763,7 +2776,7 @@ void Dumpstate::CleanupFiles() { Dumpstate::RunStatus Dumpstate::HandleUserConsentDenied() { MYLOGD("User denied consent; deleting files and returning\n"); CleanupFiles(); CleanupTmpFiles(); return USER_CONSENT_DENIED; } Loading
cmds/dumpstate/dumpstate.h +4 −1 Original line number Diff line number Diff line Loading @@ -334,6 +334,9 @@ class Dumpstate { RunStatus ParseCommandlineAndRun(int argc, char* argv[]); /* Deletes in-progress files */ void Cancel(); /* Sets runtime options. */ void SetOptions(std::unique_ptr<DumpOptions> options); Loading Loading @@ -502,7 +505,7 @@ class Dumpstate { // Removes the in progress files output files (tmp file, zip/txt file, screenshot), // but leaves the log file alone. void CleanupFiles(); void CleanupTmpFiles(); RunStatus HandleUserConsentDenied(); Loading
include/android/surface_control.h +4 −4 Original line number Diff line number Diff line Loading @@ -409,7 +409,7 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio #if __ANDROID_API__ >= 30 /* /** * Sets the intended frame rate for |surface_control|. * * On devices that are capable of running the display at different refresh rates, the system may Loading @@ -421,9 +421,9 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio * * |frameRate| is the intended frame rate of this surface, in frames per second. 0 is a special * value that indicates the app will accept the system's choice for the display frame rate, which is * the default behavior if this function isn't called. The frameRate param does *not* need to be a * valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device that can * only run the display at 60fps. * the default behavior if this function isn't called. The frameRate param does <em>not</em> need to * be a valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device * that can only run the display at 60fps. * * |compatibility| The frame rate compatibility of this surface. The compatibility value may * influence the system's choice of display frame rate. To specify a compatibility use the Loading
libs/binder/include/binder/AppOpsManager.h +10 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,16 @@ public: OP_LEGACY_STORAGE = 87, OP_ACCESS_ACCESSIBILITY = 88, OP_READ_DEVICE_IDENTIFIERS = 89, _NUM_OP = 90 OP_ACCESS_MEDIA_LOCATION = 90, OP_QUERY_ALL_PACKAGES = 91, OP_MANAGE_EXTERNAL_STORAGE = 92, OP_INTERACT_ACROSS_PROFILES = 93, OP_ACTIVATE_PLATFORM_VPN = 94, OP_LOADER_USAGE_STATS = 95, OP_DEPRECATED_1 = 96, OP_AUTO_REVOKE_PERMISSIONS_IF_UNUSED = 97, OP_AUTO_REVOKE_MANAGED_BY_INSTALLER = 98, _NUM_OP = 99 }; AppOpsManager(); Loading