diff options
author | Matt Lee <matthewhlee@google.com> | 2023-06-09 14:22:32 -0700 |
---|---|---|
committer | Matt Lee <matthewhlee@google.com> | 2023-06-09 14:22:32 -0700 |
commit | e968ddf494cf99e898f65337ef4330d4a1914482 (patch) | |
tree | 830fc3bbada0ca26479486cc3b19919ee014ef4d | |
parent | ff46d6b73b7f53fe91502198b478e7612afca9e6 (diff) | |
parent | 0f3896fb482c05a0c1bd1de73b55895391110287 (diff) |
Merge t-qpr-2023-06
Change-Id: I4532c9ebf066cbd7b788cb1581b5b5db5d78a235
-rw-r--r-- | tools/recovery_l10n/res/values-te/strings.xml | 2 | ||||
-rw-r--r-- | update_verifier/Android.bp | 4 | ||||
-rw-r--r-- | update_verifier/include/update_verifier/update_verifier.h | 5 | ||||
-rw-r--r-- | update_verifier/update_verifier.cpp | 22 |
4 files changed, 32 insertions, 1 deletions
diff --git a/tools/recovery_l10n/res/values-te/strings.xml b/tools/recovery_l10n/res/values-te/strings.xml index 57470752..513ae9d5 100644 --- a/tools/recovery_l10n/res/values-te/strings.xml +++ b/tools/recovery_l10n/res/values-te/strings.xml @@ -6,7 +6,7 @@ <string name="recovery_no_command" msgid="4465476568623024327">"ఆదేశం లేదు"</string> <string name="recovery_error" msgid="5748178989622716736">"ఎర్రర్ ఏర్పడింది!"</string> <string name="recovery_installing_security" msgid="9184031299717114342">"సెక్యూరిటీ అప్డేట్ను ఇన్స్టాల్ చేస్తోంది"</string> - <string name="recovery_wipe_data_menu_header" msgid="550255032058254478">"Android సిస్టమ్ని లోడ్ చేయడం సాధ్యం కాదు. మీ డేటా పాడై ఉండవచ్చు. మీకు ఈ మెసేజ్ వస్తూనే ఉంటే, మీరు ఫ్యాక్టరీ డేటా రీసెట్ చేసి, పరికరంలో నిల్వ అయిన వినియోగదారు డేటా మొత్తాన్ని తొలగించాల్సి రావచ్చు."</string> + <string name="recovery_wipe_data_menu_header" msgid="550255032058254478">"Android సిస్టమ్ని లోడ్ చేయడం సాధ్యం కాదు. మీ డేటా పాడై ఉండవచ్చు. మీకు ఈ మెసేజ్ వస్తూనే ఉంటే, మీరు ఫ్యాక్టరీ డేటా రీసెట్ చేసి, పరికరంలో స్టోరేజ్ అయిన వినియోగదారు డేటా మొత్తాన్ని తొలగించాల్సి రావచ్చు."</string> <string name="recovery_try_again" msgid="7168248750158873496">"మళ్లీ ప్రయత్నించు"</string> <string name="recovery_factory_data_reset" msgid="7321351565602894783">"ఫ్యాక్టరీ డేటా రీసెట్"</string> <string name="recovery_wipe_data_confirmation" msgid="5439823343348043954">"వినియోగదారు డేటా మొత్తాన్ని తొలగించాలా?\n\n ఈ చర్యను రద్దు చేయలేరు!"</string> diff --git a/update_verifier/Android.bp b/update_verifier/Android.bp index 220b007f..cb97bd1f 100644 --- a/update_verifier/Android.bp +++ b/update_verifier/Android.bp @@ -73,6 +73,10 @@ cc_library_static { "libvold_binder", ], + whole_static_libs: [ + "libsnapshot_snapuserd", + ], + shared_libs: [ "android.hardware.boot@1.0", "libbase", diff --git a/update_verifier/include/update_verifier/update_verifier.h b/update_verifier/include/update_verifier/update_verifier.h index 4c64b1ea..0cccc907 100644 --- a/update_verifier/include/update_verifier/update_verifier.h +++ b/update_verifier/include/update_verifier/update_verifier.h @@ -21,6 +21,7 @@ #include <string> #include <vector> +#include <snapuserd/snapuserd_client.h> #include "otautil/rangeset.h" // The update verifier performs verification upon the first boot to a new slot on A/B devices. @@ -68,4 +69,8 @@ class UpdateVerifier { // The function to read the device property; default value: android::base::GetProperty() std::function<std::string(const std::string&)> property_reader_; + + // Check if snapuserd daemon has already completed the update verification + // Applicable only for VABC with userspace snapshots + bool CheckVerificationStatus(); }; diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp index a042f900..88fcfa50 100644 --- a/update_verifier/update_verifier.cpp +++ b/update_verifier/update_verifier.cpp @@ -52,6 +52,7 @@ #include <future> #include <thread> +#include <android-base/chrono_utils.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/parseint.h> @@ -188,7 +189,28 @@ bool UpdateVerifier::ReadBlocks(const std::string partition_name, return ret; } +bool UpdateVerifier::CheckVerificationStatus() { + auto client = + android::snapshot::SnapuserdClient::Connect(android::snapshot::kSnapuserdSocket, 5s); + if (!client) { + LOG(ERROR) << "Unable to connect to snapuserd"; + return false; + } + + return client->QueryUpdateVerification(); +} + bool UpdateVerifier::VerifyPartitions() { + const bool userspace_snapshots = + android::base::GetBoolProperty("ro.virtual_ab.userspace.snapshots.enabled", false); + + if (userspace_snapshots && CheckVerificationStatus()) { + LOG(INFO) << "Partitions verified by snapuserd daemon"; + return true; + } + + LOG(INFO) << "Partitions not verified by snapuserd daemon"; + auto dm_block_devices = FindDmPartitions(); if (dm_block_devices.empty()) { LOG(ERROR) << "No dm-enabled block device is found."; |