diff options
| -rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 31 | ||||
| -rw-r--r-- | libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl | 6 | ||||
| -rw-r--r-- | libs/binder/aidl/android/content/pm/OWNERS | 4 | ||||
| -rw-r--r-- | libs/nativewindow/libnativewindow.map.txt | 1 |
4 files changed, 42 insertions, 0 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 0c8b1aa55e..4ac7b689cf 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -19,6 +19,7 @@ #include <dirent.h> #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <libgen.h> #include <limits.h> #include <stdbool.h> @@ -50,9 +51,11 @@ #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> +#include <android/content/pm/IPackageManagerNative.h> #include <android/hardware/dumpstate/1.0/IDumpstateDevice.h> #include <android/hidl/manager/1.0/IServiceManager.h> #include <android/os/IIncidentCompanion.h> +#include <binder/IServiceManager.h> #include <cutils/native_handle.h> #include <cutils/properties.h> #include <debuggerd/client.h> @@ -204,6 +207,30 @@ static bool IsFileEmpty(const std::string& file_path) { return file.tellg() <= 0; } +int64_t GetModuleMetadataVersion() { + auto binder = defaultServiceManager()->getService(android::String16("package_native")); + if (binder == nullptr) { + MYLOGE("Failed to retrieve package_native service"); + return 0L; + } + auto package_service = android::interface_cast<content::pm::IPackageManagerNative>(binder); + std::string package_name; + auto status = package_service->getModuleMetadataPackageName(&package_name); + if (!status.isOk()) { + MYLOGE("Failed to retrieve module metadata package name: %s", status.toString8().c_str()); + return 0L; + } + MYLOGD("Module metadata package name: %s", package_name.c_str()); + int64_t version_code; + status = package_service->getVersionCodeForPackage(android::String16(package_name.c_str()), + &version_code); + if (!status.isOk()) { + MYLOGE("Failed to retrieve module metadata version: %s", status.toString8().c_str()); + return 0L; + } + return version_code; +} + } // namespace } // namespace os } // namespace android @@ -741,6 +768,10 @@ void Dumpstate::PrintHeader() const { printf("Bootloader: %s\n", bootloader.c_str()); printf("Radio: %s\n", radio.c_str()); printf("Network: %s\n", network.c_str()); + int64_t module_metadata_version = android::os::GetModuleMetadataVersion(); + if (module_metadata_version != 0) { + printf("Module Metadata version: %" PRId64 "\n", module_metadata_version); + } printf("Kernel: "); DumpFileToFd(STDOUT_FILENO, "", "/proc/version"); diff --git a/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl b/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl index 90980b8e62..a7a7292125 100644 --- a/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl +++ b/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl @@ -81,4 +81,10 @@ interface IPackageManagerNative { * returned Status before using the result of this function. */ int getTargetSdkVersionForPackage(in String packageName); + + /** + * Returns the name of module metadata package, or empty string if device doesn't have such + * package. + */ + @utf8InCpp String getModuleMetadataPackageName(); } diff --git a/libs/binder/aidl/android/content/pm/OWNERS b/libs/binder/aidl/android/content/pm/OWNERS new file mode 100644 index 0000000000..b99ca09674 --- /dev/null +++ b/libs/binder/aidl/android/content/pm/OWNERS @@ -0,0 +1,4 @@ +narayan@google.com +patb@google.com +svetoslavganov@google.com +toddke@google.com
\ No newline at end of file diff --git a/libs/nativewindow/libnativewindow.map.txt b/libs/nativewindow/libnativewindow.map.txt index 23a05f3dca..bad8b11540 100644 --- a/libs/nativewindow/libnativewindow.map.txt +++ b/libs/nativewindow/libnativewindow.map.txt @@ -8,6 +8,7 @@ LIBNATIVEWINDOW { AHardwareBuffer_isSupported; # introduced=29 AHardwareBuffer_lock; AHardwareBuffer_lockAndGetInfo; # introduced=29 + AHardwareBuffer_lockPlanes; # introduced=29 AHardwareBuffer_recvHandleFromUnixSocket; AHardwareBuffer_release; AHardwareBuffer_sendHandleToUnixSocket; |